hugo-theme-hoogi/layouts/partials/nav.html

14 lines
668 B
HTML

<nav class="page-nav">
<ul>
{{ $current := . }}
{{ range .Site.Menus.nav }}
{{ $active := or ($current.IsMenuCurrent "nav" .) ($current.HasMenuCurrent "nav" .) }}
{{ $active = or $active (eq .Name $current.Title) }}
{{ $active = or $active (eq .Identifier $current.Title) }}
{{ $active = or $active (and (eq .Name "Articles") (eq $current.Section "posts")) }}
<li class="nav-item page-nav--items">
<a class="link-button link-button--left{{if $active}} link-button--left-active{{end}}" href="{{ .URL | relLangURL }}">{{ .Name }}</a>
</li>
{{ end }}
</ul>
</nav>