hackertours-theme/layouts/partials/menu.html
2017-10-24 11:45:29 +02:00

16 lines
673 B
HTML

{{ $currentSection := .Section }}
{{ $currentID := .UniqueID }}
<nav class="main-menu layout__navigation" role="navigation">
<h2 class="visually-hidden">{{ i18n "menu_title" }}</h2>
<ul class="navbar">
<li><a class="{{ if .IsHome }}active{{ end }}" href="/">{{ i18n "menu_home" }}</a></li>
{{ range where .Site.Pages "Section" "" -}}
{{ if ne .RelPermalink "/" -}}
<li><a class="{{ if eq $currentID .UniqueID }}active{{ end }}" href="{{ .RelPermalink }}">{{ .Title }}</a></li>
{{ end -}}
{{ end -}}
{{ range $.Site.Home.Sections -}}
<li><a class="{{ if eq $currentSection .Section }}active{{ end }}" href="{{ .RelPermalink }}">{{ .Title }}</a></li>
{{ end -}}
</ul>
</nav>