binario/layouts/partials/header_menu.html

27 lines
1.2 KiB
HTML
Raw Normal View History

2018-05-10 05:40:56 +00:00
{{- if .Site.Menus.main }}
2020-01-07 15:50:28 +00:00
<nav class="main-nav{{ if eq .Site.Params.mainMenuAlignment "right" }} main-nav--right{{ end }}" role="navigation">
<button id="toggle" class="main-nav__btn" aria-label="Menu toggle" aria-expanded="false" tabindex="0">
<div class="main-nav__btn-box" tabindex="-1">
2018-12-02 16:25:17 +00:00
<svg class="main-nav__icon icon-menu" width="18" height="18" viewBox="0 0 18 18">
<path class="icon-menu__burger" d="M18 0v3.6H0V0h18zM0 10.8h18V7.2H0v3.6zM0 18h18v-3.6H0V18z"/>
<path class="icon-menu__x" d="M11.55 9L18 15.45 15.45 18 9 11.55 2.55 18 0 15.45 6.45 9 0 2.55 2.55 0 9 6.45 15.45 0 18 2.55 11.55 9z"/>
</svg>
</div>
2018-04-01 12:56:28 +00:00
</button>
2020-01-07 15:50:28 +00:00
<ul id="menu" class="main-nav__list">
2018-04-01 12:56:28 +00:00
{{- $currentNode := . }}
2020-03-12 23:08:53 +00:00
{{- range .Site.Menus.main }}
{{- $current := (or ($currentNode.IsMenuCurrent "main" .) ($currentNode.HasMenuCurrent "main" .)) }}
{{- if .Name }}
<li class="main-nav__item{{ if $current }} main-nav__item--active{{ end }}">
{{ if not $current }}<a class="main-nav__link" href="{{ .URL }}">{{ end }}
{{ .Pre }}
<span class="main-nav__text">{{ .Name }}</span>
{{ .Post }}
{{ if not $current }}</a>{{ end }}
</li>
{{- end }}
2018-04-01 12:56:28 +00:00
{{- end }}
</ul>
2018-05-10 05:40:56 +00:00
</nav>
{{- end }}