arbejdsfaellesskab.dk/hugo_site/themes/tranetheme/layouts/partials/nav.html

41 lines
1.2 KiB
HTML
Raw Normal View History

2019-04-30 14:39:24 +00:00
<header class="header">
<a href="{{ .Site.BaseURL }}">
Arbejdsfællesskabet
</a>
<nav>
<ul>
{{ $currentPage := . }}
{{ range .Site.Menus.main }}
<li class="{{ if (or ($currentPage.HasMenuCurrent "main" .) ($currentPage.IsMenuCurrent "main" .))}}active{{ end }}">
<a href="{{ .URL | absURL }}">{{ .Name }}</a>
</li>
{{ end }}
</ul>
</nav>
</header>
{{ range .Site.Menus.main }}
{{ if or ($currentPage.IsMenuCurrent "main" .) ($currentPage.HasMenuCurrent "main" .) }}
<ul class="header-submenu">
{{ if and ($currentPage.IsMenuCurrent "main" .) (.HasChildren) }}
<li class="active">
<a href="{{ .URL | absURL }}">{{ .Name }}</a>
</li>
{{ end }}
{{ if and ($currentPage.HasMenuCurrent "main" .) (not (eq $currentPage.Name .Name)) }}
<li>
<a href="{{ .URL | absURL }}">{{ .Name }}</a>
</li>
{{ end }}
{{ if .HasChildren }}
{{ range .Children }}
<li class="{{ if $currentPage.IsMenuCurrent "main" . }}active{{ end }}">
<a href="{{ .URL | absURL }}">{{ .Name }}</a>
</li>
{{ end }}
{{ end }}
</ul>
{{ end }}
{{ end }}