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

26 lines
973 B
HTML
Raw Permalink Normal View History

2019-02-13 06:11:59 +01:00
<nav id="patterns-nav" class="patterns" role="navigation">
<h2 class="vh">{{ T "nav_main_navigation" }}</h2>
2019-02-13 06:11:59 +01:00
<button id="menu-button" aria-expanded="false">
<svg viewBox="0 0 50 50" aria-hidden="true" focusable="false">
2022-05-31 04:33:30 +02:00
<use href="#menu"></use>
2019-02-13 06:11:59 +01:00
</svg>
{{ T "nav_button_menu" }}
2019-02-13 06:11:59 +01:00
</button>
{{ $current := . }}
<ul id="patterns-list">
{{ range .Site.Menus.nav }}
<li class="pattern">
{{ $active := or ($current.IsMenuCurrent "nav" .) ($current.HasMenuCurrent "nav" .) }}
2022-11-30 11:35:45 +01:00
{{ $active = or $active (eq .URL $current.RelPermalink) }}
2019-02-13 06:11:59 +01:00
{{ $active = or $active (and (eq .Name "Tags") (eq $current.Section "tags")) }}
<a href="{{ .URL }}" {{ if $active }}aria-current="page"{{ end }}>
<svg class="bookmark-icon" aria-hidden="true" focusable="false" viewBox="0 0 40 50">
2022-05-31 04:33:30 +02:00
<use href="#bookmark"></use>
2019-02-13 06:11:59 +01:00
</svg>
<span class="text">{{ .Name }}</span>
</a>
</li>
{{ end }}
</ul>
2022-11-30 11:35:45 +01:00
</nav>