mirror of https://github.com/theNewDynamic/gohugo-theme-ananke.git

Patrick Kollitsch
16 hours ago daca88d9ec3fb681188993378ce3eeb5c1105083
refs
author Patrick Kollitsch <83281+davidsneighbour@users.noreply.github.com>
Saturday, November 21, 2026 05:24 +0100
committer Patrick Kollitsch <83281+davidsneighbour@users.noreply.github.com>
Saturday, November 21, 2026 05:26 +0100
commitdaca88d9ec3fb681188993378ce3eeb5c1105083
tree c347bbf26365677ee23c2c371a10b144f597250d tree | zip | gz
parent 0d86514affd10f9a8efd1225c4b9a6dce76b1a1b view | diff
feat(styles): add hyphenation utility for post content (#1128)

Adds a `hyphenate` utility class, because Tachyons has no hyphenation
classes, and applies it to single-page content (`layouts/single.html`
and `layouts/page/single.html`).

* `hyphens: auto` with `hyphenate-limit-chars: 6 3 3`.
* Headings, inline code, `kbd`, and `samp` keep their words whole; code
blocks keep `hyphens: none`.
* Sites change or disable it by redefining `.hyphenate` in
`ananke.custom_css`, for example `.hyphenate { hyphens: manual; }`.
* `DESIGN.md` lists the class in the typography section.

Documentation: `gohugo-ananke/documentation` branch `docs/hyphenation`
(styles guide and custom CSS guide).

## Validation

* `npm test`: 57/57 with Hugo 0.160.0 and 0.170.1.
* `npm run test:coverage-gate`: passes (no new parameter).
* `npx playwright test`: 109 passed, including the new
`tests/e2e/hyphenation.spec.ts`; the hyphenation spec also passes with
Hugo 0.160.0.
* Lint results are unchanged from v2.22.0. Visual snapshots: the same 8
of 12 fail on v2.22.0 and on this branch.
* Rendered hyphenation confirmed in Firefox. Playwright's Chromium build
has no hyphenation dictionaries, so it shows no visual change.

* [x] Added or updated feature fixtures and tests, and registered
parameters and shortcodes in `tests/catalog.yaml` (or explained why no
tests are needed). No new parameter or shortcode, so no catalogue entry;
added `tests/e2e/hyphenation.spec.ts`.
4 files modified
1 files added
56 ■■■■■ changed files
DESIGN.md 2 ●●●●● diff | view | raw | blame | history
assets/ananke/css/_styles.css 20 ●●●●● diff | view | raw | blame | history
layouts/page/single.html 2 ●●●●● diff | view | raw | blame | history
layouts/single.html 2 ●●●●● diff | view | raw | blame | history
tests/e2e/hyphenation.spec.ts 30 ●●●●● diff | view | raw | blame | history