Skip to content

Commit

Permalink
Changed aria label in main nav to resolve redundancy (#256)
Browse files Browse the repository at this point in the history
* Changed aria label to resolve redundancy

The main navigation had an aria label that said main navigation.
However, because it is a nav element, this results in hearing the word
"navigation" twice with a screen reader. Changed "main navigation" to
"main" to resolve this.

Signed-off-by: Patrick Smyth <patrick@iotaschool.com>

* Used primary/secondary aria labels for nav

Signed-off-by: Patrick Smyth <patrick@iotaschool.com>

* Removed "naviation" from label for tertiary nav

Signed-off-by: Patrick Smyth <patrick@iotaschool.com>

* Removed aria label "main navigation"

Signed-off-by: Patrick Smyth <patrick@iotaschool.com>

* Changed secondary nav to secondary in docs menu

Signed-off-by: Patrick Smyth <patrick@iotaschool.com>

---------

Signed-off-by: Patrick Smyth <patrick@iotaschool.com>
  • Loading branch information
smythp authored Oct 3, 2023
1 parent 62c403a commit 8e86f54
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
4 changes: 2 additions & 2 deletions layouts/docs/single.html
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
{{ define "main" }}
<div class="row flex-xl-nowrap">
<div class="col-lg-5 col-xl-4 docs-sidebar{{ if ne .Site.Params.options.navbarSticky true }} docs-sidebar-top{{ end }} d-none d-lg-block">
<nav {{ if eq .Site.Params.menu.section.collapsibleSidebar false }}id="sidebar-default" {{ end }}class="docs-links" aria-label="Main navigation">
<nav {{ if eq .Site.Params.menu.section.collapsibleSidebar false }}id="sidebar-default" {{ end }}class="docs-links">
{{ partial "sidebar/docs-menu.html" . }}
</nav>
</div>
{{ if ne .Params.toc false -}}
<nav class="docs-toc{{ if ne .Site.Params.options.navbarSticky true }} docs-toc-top{{ end }} d-none d-xl-block col-xl-3" aria-label="Secondary navigation">
<nav class="docs-toc{{ if ne .Site.Params.options.navbarSticky true }} docs-toc-top{{ end }} d-none d-xl-block col-xl-3" aria-label="Secondary">
{{ partial "sidebar/docs-toc.html" . }}
</nav>
{{ end -}}
Expand Down
10 changes: 5 additions & 5 deletions layouts/partials/header/header.html
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
<div class="header-bar"></div>

<header class="navbar navbar-expand-lg navbar-light doks-navbar">
<nav class="container-{{ if .Site.Params.options.fullWidth }}fluid{{ else }}xxl{{ end }} flex-wrap flex-lg-nowrap" aria-label="Main navigation">
<nav class="container-{{ if .Site.Params.options.fullWidth }}fluid{{ else }}xxl{{ end }} flex-wrap flex-lg-nowrap" aria-label="Primary">

<img alt="Sigstore logo" class="nav-image" src="{{ .Site.BaseURL }}/sigstore-logo.png" style="margin-right: 0.25em;height: 2em;">
<a class="navbar-brand order-0" href="{{ .Site.BaseURL | relLangURL }}" aria-label="{{ .Site.Params.Title }}">
Expand All @@ -28,7 +28,7 @@ <h5 class="offcanvas-title" id="offcanvasExampleLabel">{{ i18n "browse" }} {{ .S
</div>
<div class="offcanvas-body">
<aside class="doks-sidebar mt-n3">
<nav id="doks-docs-nav" aria-label="Tertiary navigation">
<nav id="doks-docs-nav" aria-label="Tertiary">
{{ partial "sidebar/docs-menu.html" . }}
</nav>
</aside>
Expand Down Expand Up @@ -171,15 +171,15 @@ <h2 class="h5 offcanvas-title ps-2" id="offcanvasDoksLabel"><a class="text-dark"
{{ if eq .Section "docs" -}}
<div class="container-{{ if .Site.Params.options.fullWidth }}fluid{{ else }}xxl{{ end }}">
<aside class="doks-sidebar">
<nav id="doks-docs-nav" class="collapse d-lg-none" aria-label="Tertiary navigation">
<nav id="doks-docs-nav" class="collapse d-lg-none" aria-label="Tertiary">
{{ partial "sidebar/docs-menu.html" . }}
</nav>
</aside>
</div>

{{ else if ne .CurrentSection .FirstSection -}}
<!--
<nav class="doks-subnavbar py-2 sticky-lg-top d-lg-none" aria-label="Secondary navigation">
<nav class="doks-subnavbar py-2 sticky-lg-top d-lg-none" aria-label="Secondary">
<div class="container-{{ if .Site.Params.options.fullWidth }}fluid{{ else }}xxl{{ end }} d-flex align-items-lg-center">
<span class="navbar-text ms-0">{{ .Section | humanize }}</span>
<button class="btn doks-sidebar-toggle d-lg-none ms-auto order-3 collapsed" type="button" data-bs-toggle="collapse" data-bs-target="#doks-docs-nav" aria-controls="doks-docs-nav" aria-expanded="false" aria-label="Toggle documentation navigation">
Expand All @@ -192,7 +192,7 @@ <h2 class="h5 offcanvas-title ps-2" id="offcanvasDoksLabel"><a class="text-dark"

<div class="container-{{ if .Site.Params.options.fullWidth }}fluid{{ else }}xxl{{ end }}">
<aside class="doks-sidebar">
<nav id="doks-docs-nav" class="collapse d-lg-none" aria-label="Tertiary navigation">
<nav id="doks-docs-nav" class="collapse d-lg-none" aria-label="Tertiary">
{{ partial "sidebar/docs-menu.html" . }}
</nav>
</aside>
Expand Down

0 comments on commit 8e86f54

Please sign in to comment.