hackertours-theme/layouts/partials/menu.html
2017-06-19 08:57:41 +02:00

16 lines
655 B
HTML

{{ $currentSection := .Section }}
{{ $currentID := .UniqueID }}
<div class="layout-swap__top layout-3col__full">
<nav class="main-menu" role="navigation">
<h2 class="visually-hidden">Main menu</h2>
<ul class="navbar clearfix">
<li><a class="{{ if .IsHome }}active{{ end }}" href="/">Home</a></li>
{{ range after 1 (where .Site.Pages "Section" "") -}}
<li><a class="{{ if eq $currentID .UniqueID }}active{{ end }}" href="{{ .RelPermalink }}">{{ .Title }}</a></li>
{{ end -}}
{{ range $.Site.Home.Sections -}}
<li><a class="{{ if eq $currentSection .Section }}active{{ end }}" href="{{ .RelPermalink }}">{{ .Title }}</a></li>
{{ end -}}
</ul>
</nav>
</div>