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

Patrick Kollitsch
yesterday 634cc090072fbc2f99eaef4a19639c016e3e245c
refs
author Patrick Kollitsch <83281+davidsneighbour@users.noreply.github.com>
Saturday, June 6, 2026 07:38 +0200
committer Patrick Kollitsch <davidsneighbourdev+gh@gmail.com>
Sunday, June 7, 2026 05:47 +0200
commit634cc090072fbc2f99eaef4a19639c016e3e245c
tree 8d4d7dc92bba6bf1ad5adc4129a0840fb9a88af2 tree | zip | gz
parent 52ec6cd4b85f0d861100c6ab78bc2f8d3f073675 view | diff
fix: make header height configurable (#972)

Makes the hero header height configurable via a new
`header_section_class` parameter, instead of hard-coding the vertical
padding in the header partials.

- Adds `header_section_class` to `layouts/_partials/site-header.html`
(home/list, both with and without a featured image) and
`layouts/_partials/page-header.html` (single page with a featured
image).
- Resolved with `.Param`, so it can be set site-wide under `[params]` or
overridden per page in front matter.
- Keeps the existing Tachyons defaults for each header, so current sites
render identically unless they opt in.

Closes #504

Documentation PR: gohugo-ananke/documentation#20

Adds a phase to `scripts/test-hugo-quickstart.ts` that builds two single
pages with featured images — one overriding `header_section_class` and
one using the default — and asserts the override is applied, does not
leak to other pages, and the historical default spacing (`tc-l pv6 ph3
ph4-ns`) is preserved.

Verified manually that:

- The site-wide param, per-page override, and `.Param` precedence all
resolve correctly across the site header (featured + non-featured) and
page header.
- Defaults are byte-for-byte unchanged when the parameter is unset.
- The new assertion fails if the partial regresses to a hard-coded
class.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

---------

Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
3 files modified
142 ■■■■■ changed files
layouts/_partials/page-header.html 3 ●●●● diff | view | raw | blame | history
layouts/_partials/site-header.html 6 ●●●●● diff | view | raw | blame | history
scripts/test-hugo-quickstart.ts 133 ●●●●● diff | view | raw | blame | history