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

Patrick Kollitsch
13 hours ago a1ba67bd918c63a72b7eb3ee70f30b498baada0e
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 12:51 +0100
commita1ba67bd918c63a72b7eb3ee70f30b498baada0e
tree 972630336940a718e2a01b13ea301fa8ab77d984 tree | zip | gz
parent 966b62f4a3ce2274c45ea3242061a5e527ae2441 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