Skip to content

Instantly share code, notes, and snippets.

@DominikVogel
Created June 2, 2022 07:44
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save DominikVogel/79927a8a5f1ea27ba6cb0bcbd46bda5f to your computer and use it in GitHub Desktop.
Save DominikVogel/79927a8a5f1ea27ba6cb0bcbd46bda5f to your computer and use it in GitHub Desktop.
Enable hyphenation of project title in legacy hugo academic

Problem

Titles of projects look ugly on homepage when words are too long.

Solution

Add HTML soft-hyphen to the title: Digitalization -> Digital­ization.

Adaptation

To enable correct rendering in the main page, the code for the header needs to be modified:

  1. Open \themes\hugo-academic\layouts\partials\page_header.html
  2. Look for <div class="article-container pt-3">
  3. Modify <h1>{{ $title }}</h1> to <h1>{{ $title | markdownify }}</h1>
  4. Rebuild Site
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment