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

Patrick Kollitsch
14 hours ago 25691e21ab91e6f13a2fdaf4212969e81e6f1d15
refs
author Patrick Kollitsch <davidsneighbourdev+gh@gmail.com>
Thursday, November 19, 2026 08:55 +0100
committer Patrick Kollitsch <davidsneighbourdev+gh@gmail.com>
Thursday, November 19, 2026 08:55 +0100
commit25691e21ab91e6f13a2fdaf4212969e81e6f1d15
tree 4920ae2defdaf584b56d72d1c933722341315495 tree | zip | gz
parent 2cc393abfa86d92d08e6dfb9ec0bc3def8264a74 view | diff
feat(layouts): render child entries of the main menu as submenus

Render children of `main` menu entries (Hugo `parent`/`identifier` in configuration, or `menus` with `parent` in front matter) as a nested list under their parent. A parent with a URL keeps its link and gets a separate toggle button; a parent without a URL becomes the button. The button is hidden until JavaScript reveals it, so without JavaScript all child links stay visible as a nested list. Entries below the second level render as nested lists inside the submenu, without their own button.

Mark every main menu entry with `aria-current="page"` (`.IsMenuCurrent`) or `aria-current="true"` (`.HasMenuCurrent`). Flat menus keep their classes and appearance; the only change in their markup is this attribute.

Note for the changelog: sites that already define child entries in the `main` menu will now show them in the header. Before, the theme ignored them.
1 files modified
71 ■■■■■ changed files
layouts/_partials/site-navigation.html 71 ●●●●● diff | view | raw | blame | history