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

Patrick Kollitsch
18 hours ago e23014b6bc60875b45c855397489a4121ddb58aa
refs
author Patrick Kollitsch <davidsneighbourdev+gh@gmail.com>
Thursday, November 19, 2026 08:55 +0100
committer Patrick Kollitsch <davidsneighbourdev+gh@gmail.com>
Friday, November 20, 2026 00:10 +0100
commite23014b6bc60875b45c855397489a4121ddb58aa
tree 59fbc4dbc3b5c0b447ff7dae235f2d046ea98c06 tree | zip | gz
parent 765107d45836cd73ba48f1415213db3150f3b895 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