hackertours-theme/layouts/partials/menu.html
Fredrik Jonsson b7977e1c28 First commit.
2017-03-09 14:29:29 +01:00

19 lines
706 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 $section, $taxonomy := .Site.Sections }}
{{ if eq $section "" }}
{{ range $taxonomy.Pages }}
<li><a class="{{ if eq $currentID .UniqueID }}active{{ end }}" href="{{ .RelPermalink }}">{{ .LinkTitle }}</a></li>
{{ end }}
{{ else }}
<li><a class="{{ if eq $currentSection $section }}active{{ end }}" href="/{{ urlize $section }}">{{ humanize $section }}</a></li>
{{ end }}
{{ end }}
</ul>
</nav>
</div>