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

Patrick Kollitsch
12 hours ago aa7f234ec3736d192eb4ac777bfd63f77c9ade79
refs
author Patrick Kollitsch <davidsneighbourdev+gh@gmail.com>
Thursday, November 19, 2026 09:43 +0100
committer Patrick Kollitsch <davidsneighbourdev+gh@gmail.com>
Thursday, November 19, 2026 12:51 +0100
commitaa7f234ec3736d192eb4ac777bfd63f77c9ade79
tree ffc342eb10f459e3ccde964b10bf451a10420299 tree | zip | gz
parent 8263c013685ba4e5628315ff8c3125ebf286fd7e view | diff
feat(layouts): make the header layout configurable

Add params.ananke.header with two lists:

- navigation: groups of components in the navigation bar. Groups are
spread over the width of the bar, so layouts like
"logo - search - menu" or "menu, search - logo" need only config.
- content: components below the navigation bar, from top to bottom.

Each name renders the hook partial hooks/header/<name>.html, so a site
adds its own component (for example a search form) by creating that
partial. Pages can override both lists in their front matter. A name
without a hook partial prints a warning.

Each navigation group gets a role for the collapsed layout below 60em:
the group with `menu` is the collapsible panel (the menu button sits
directly before it), the group with `logo` shares the first row with
the button, and every other group is a slot with its own row. Add the
`group` key to [ananke.navigation.classes] for the non-panel groups.

The configurable groups replace the unreleased `navigation-start` and
`navigation-end` hooks: a search box is now a component in its own
group, or in a `header/<name>-before` or `-after` hook.
1 files deleted
11 files modified
3 files added
355 ■■■■■ changed files
assets/ananke/css/_styles.css 15 ●●●●● diff | view | raw | blame | history
assets/ananke/css/navigation-classes.css 26 ●●●●● diff | view | raw | blame | history
config/_default/params.toml 23 ●●●●● diff | view | raw | blame | history
layouts/_partials/func/header/GetNavigationClasses.html 1 ●●●●● diff | view | raw | blame | history
layouts/_partials/header/component.html 6 ●●●●● diff | view | raw | blame | history
layouts/_partials/header/content.html 13 ●●●●● diff | view | raw | blame | history
layouts/_partials/site-navigation.html 82 ●●●●● diff | view | raw | blame | history
tests/catalog.yaml 2 ●●●●● diff | view | raw | blame | history
tests/e2e/accessibility.spec.ts 1 ●●●●● diff | view | raw | blame | history
tests/e2e/header.spec.ts 151 ●●●●● diff | view | raw | blame | history
tests/e2e/navigation.spec.ts 2 ●●●●● diff | view | raw | blame | history
tests/fixtures/site/content/header-layout/_index.md 12 ●●●●● diff | view | raw | blame | history
tests/fixtures/site/hugo.toml 6 ●●●●● diff | view | raw | blame | history
tests/fixtures/site/layouts/_partials/hooks/header/search.html 10 ●●●●● diff | view | raw | blame | history
tests/fixtures/site/layouts/_partials/hooks/navigation-start.html 5 ●●●●● diff | view | raw | blame | history