Ananke v2.23.0
- Hyphenation for post content
- Change or turn off hyphenation
- Documentation
- Requirements and contributors
Hyphenation for post content
Ananke now hyphenates long words in the content of single pages. Browsers break words at the end of a line and add a hyphen, which gives a more regular right edge, particularly on narrow screens.
Tachyons has no hyphenation class, so the theme adds its own hyphenate utility class. It uses hyphens: auto and hyphenate-limit-chars: 6 3 3: only words with six or more letters are hyphenated, with at least three letters on each side of the break. Headings, inline code, keyboard input, and sample output keep their words whole. Code blocks are not hyphenated.
Browsers hyphenate only text in a language that they have a dictionary for. Ananke sets the page language from your site's locale (or languageCode), so check that this setting matches the language of your content.
Change or turn off hyphenation
Redefine the class in a file that you register in ananke.custom_css. Your CSS comes after the theme's CSS, so your rule wins. To turn off automatic hyphenation:
.hyphenate {
hyphens: manual;
}You can also add the hyphenate class to elements in your own layouts.
Documentation
- The styles guide explains the class, the language requirement, and how to change or turn off hyphenation.
- The custom CSS guide shows how to override a theme class.
These sections go live when the documentation is published for this release.
Requirements and contributors
The minimum Hugo version remains 0.160.0. A new browser test, tests/e2e/hyphenation.spec.ts, checks the class, its exclusions, and that site CSS can redefine it.