25 lines
1.2 KiB
HTML
25 lines
1.2 KiB
HTML
<nav class="main-menu layout__navigation">
|
|
<h2 class="visually-hidden">{{ i18n "menu_title" }}</h2>
|
|
<ul class="navbar">
|
|
{{ $currentPage := . }}
|
|
{{ range .Site.Menus.main }}
|
|
{{ if .HasChildren }}
|
|
<li class="dropdown">
|
|
<a href="{{ .URL | relLangURL }}"{{ if or ($currentPage.IsMenuCurrent "main" .) ($currentPage.HasMenuCurrent "main" .) }} class="active" aria-current="page"{{ end }}>{{ .Name }}</a>
|
|
<ul class="dropdown-content">
|
|
{{ range .Children }}
|
|
<li>
|
|
<a href="{{ .URL | relLangURL }}"{{ if or ($currentPage.IsMenuCurrent "main" .) ($currentPage.HasMenuCurrent "main" .) }} class="active" aria-current="page"{{ end }}>{{ .Name }}</a>
|
|
</li>
|
|
{{ end }}
|
|
</ul>
|
|
</li>
|
|
{{ else }}
|
|
<li>
|
|
<a href="{{ .URL | relLangURL }}"{{ if or ($currentPage.IsMenuCurrent "main" .) ($currentPage.HasMenuCurrent "main" .) }} class="active" aria-current="page"{{ end }}>{{ .Name }}</a>
|
|
</li>
|
|
{{ end }}
|
|
{{ end }}
|
|
</ul>
|
|
</nav>
|