♿️ Add header and main menu nav landmarks (#3048)

Wrap the page header in a header element and the subnavigation menu in
a labelled nav landmark. Addresses #3023.

Co-authored-by: Chris Herborth <chrish@taffer.ca>
This commit is contained in:
Nuno C.andChris Herborth authored and GitHub committed 2026-08-16 22:09:35 +01:00
1 parent 3ea1c3b49f
commit 74d03343b9
3 files changed
+5

No files matched your search

+1
View File
@@ -60,6 +60,7 @@ list:
no_articles: "There are no articles to list here yet." no_articles: "There are no articles to list here yet."
nav: nav:
main_menu: "Main menu"
scroll_to_top_title: "Scroll to top" scroll_to_top_title: "Scroll to top"
skip_to_main: "Skip to main content" skip_to_main: "Skip to main content"
+2
View File
@@ -19,12 +19,14 @@
{{ i18n "nav.skip_to_main" }} {{ i18n "nav.skip_to_main" }}
</a> </a>
</div> </div>
<header>
{{ $header := print "header/" site.Params.header.layout ".html" }} {{ $header := print "header/" site.Params.header.layout ".html" }}
{{ if templates.Exists ( printf "partials/%s" $header ) }} {{ if templates.Exists ( printf "partials/%s" $header ) }}
{{ partial $header . }} {{ partial $header . }}
{{ else }} {{ else }}
{{ partial "header/basic.html" . }} {{ partial "header/basic.html" . }}
{{ end }} {{ end }}
</header>
<div class="relative flex flex-col grow"> <div class="relative flex flex-col grow">
<main id="main-content" class="grow"> <main id="main-content" class="grow">
{{ block "main" . }}{{ end }} {{ block "main" . }}{{ end }}
+2
View File
@@ -37,6 +37,7 @@
</div> </div>
{{ if .Site.Menus.subnavigation }} {{ if .Site.Menus.subnavigation }}
<nav id="main-menu" aria-label="{{ i18n "nav.main_menu" }}">
<div <div
class="main-menu flex pb-3 flex-col items-end justify-between md:justify-start space-x-3 {{ if .Site.Params.Logo }} class="main-menu flex pb-3 flex-col items-end justify-between md:justify-start space-x-3 {{ if .Site.Params.Logo }}
-mt-[15px] -mt-[15px]
@@ -61,6 +62,7 @@
{{ end }} {{ end }}
</div> </div>
</div> </div>
</nav>
{{ end }} {{ end }}
{{ if .Site.Params.highlightCurrentMenuArea }} {{ if .Site.Params.highlightCurrentMenuArea }}