7
0
Fork 0

Buttons voorzien van een label voor verbeterde toegankelijkheid

This commit is contained in:
Michael Boelen 2023-05-22 11:46:34 +02:00
parent 019a7e145b
commit 49ff9a64c3

View file

@ -16,11 +16,11 @@
<ul class="menus menu"> <ul class="menus menu">
{{ $currentPage := . }} {{ $currentPage := . }}
{{ range .Site.Menus.main }} {{ range .Site.Menus.main }}
{{ $.Scratch.Set "counter" (add ($.Scratch.Get "counter") 1) }} {{ $.Scratch.Set "counter" (add ($.Scratch.Get "counter") 1) }}
{{ if .Children }} {{ if .Children }}
<li> <li>
<button type="button" aria-haspopup="true" aria-expanded="true" aria-controls="dropdown-{{ $.Scratch.Get "counter" }}"></button> <button type="button" aria-haspopup="true" aria-expanded="true" aria-controls="dropdown-{{ $.Scratch.Get "counter" }}" aria-labelledby="button-link-{{ $.Scratch.Get "counter" }}"></button>
<a href="{{ .URL }}">{{ .Name }}</a> <a id="button-link-{{ $.Scratch.Get "counter" }}" href="{{ .URL }}">{{ .Name }}</a>
<ul class="dropdown" id="dropdown-{{ $.Scratch.Get "counter" }}"> <ul class="dropdown" id="dropdown-{{ $.Scratch.Get "counter" }}">
{{ range .Children }} {{ range .Children }}
<li><a href="{{ .URL }}">{{ .Name }}</a></li> <li><a href="{{ .URL }}">{{ .Name }}</a></li>
@ -29,13 +29,13 @@
</li> </li>
{{ else }} {{ else }}
<li> <li>
<button type="button" aria-haspopup="true" aria-expanded="true"></button> <button type="button" aria-haspopup="true" aria-expanded="true" aria-labelledby="button-link-{{ $.Scratch.Get "counter" }}"></button>
<a href="{{ .URL }}">{{ .Name }}</a> <a id="button-link-{{ $.Scratch.Get "counter" }}" href="{{ .URL }}">{{ .Name }}</a>
</li> </li>
{{ end }} {{ end }}
{{ end }} {{ end }}
<li> <li>
<button type="button" aria-haspopup="false" aria-expanded="true"></button> <button type="button" aria-haspopup="false" aria-expanded="true" aria-label="Zoeken"></button>
<a href="{{ relLangURL "/zoeken/"}}">{{ partial "show-svg-icon.html" (dict "context" . "icon" "magnifying-glass" "class" "shownormal") }}</a> <a href="{{ relLangURL "/zoeken/"}}">{{ partial "show-svg-icon.html" (dict "context" . "icon" "magnifying-glass" "class" "shownormal") }}</a>
</li> </li>
</ul> </ul>