add aria-current to active class in menus and sidebar
This commit is contained in:
parent
8ad67c1716
commit
8802e49a6b
1 changed files with 8 additions and 8 deletions
|
|
@ -12,12 +12,12 @@
|
|||
<nav class="mobile-nav__main-menu">
|
||||
<h2 class="visually-hidden">{{ i18n "menu_title" }}</h2>
|
||||
<ul class="mobile-nav__navbar">
|
||||
{{ with .Site.Home }}<li><a class="{{ if eq $currentID .File.UniqueID }}active{{ end }}" href="{{ .RelPermalink }}">{{ i18n "menu_home" }}</a></li>{{ end }}
|
||||
{{ with .Site.Home }}<li><a class="{{ if eq $currentID .File.UniqueID }}active" aria-current="page{{ end }}" href="{{ .RelPermalink }}">{{ i18n "menu_home" }}</a></li>{{ end }}
|
||||
{{ range where .Site.RegularPages "Section" "" -}}
|
||||
<li><a class="{{ if eq $currentID .File.UniqueID }}active{{ end }}" href="{{ .RelPermalink }}">{{ .Title }}</a></li>
|
||||
<li><a class="{{ if eq $currentID .File.UniqueID }}active" aria-current="page{{ end }}" href="{{ .RelPermalink }}">{{ .Title }}</a></li>
|
||||
{{ end -}}
|
||||
{{ range .Site.Sections -}}
|
||||
<li><a class="{{ if eq $currentSection .Section }}active{{ end }}" href="{{ .RelPermalink }}">{{ .Title }}</a></li>
|
||||
<li><a class="{{ if eq $currentSection .Section }}active" aria-current="page{{ end }}" href="{{ .RelPermalink }}">{{ .Title }}</a></li>
|
||||
{{ end -}}
|
||||
</ul>
|
||||
</nav>
|
||||
|
|
|
|||
Loading…
Reference in a new issue