omegamma/layouts/partials/header.html
2021-06-08 16:19:46 +02:00

46 lines
1.6 KiB
HTML

<nav>
<div class="center nav-flex">
{{ $currentPage := . }}
<div class="nav-mobile">
<a class="navbar-brand" href="//ad5001.eu">
<img src="/img/icon.png" class="icon-brand" alt=""></img>
{{ .Site.Title }}
</a>
<button id="navbar-toggler">
<img src="/icons/menu.svg" class=""/>
</button>
</div>
<div class="navbar-menu">
<ul class="navbar-list">
{{ range .Site.Menus.main }}
{{ if .HasChildren }}
<a href="#">
<li class="{{ if $currentPage.HasMenuCurrent "main" . }}active{{ end }}">
{{ .Pre }}
<span>{{ .Name }}</span>
</li>
</a>
<ul class="sub-menu">
{{ range .Children }}
<a href="{{ .URL }}">
<li class="{{ if $currentPage.IsMenuCurrent "main" . }}active{{ end }}">
{{ .Name }}
</li>
</a>
{{ end }}
</ul>
{{ else }}
<a href="{{ .URL }}">
<li class="{{ if $currentPage.IsMenuCurrent "main" . }}active{{ end }}">
{{ .Pre }}
<span>{{ .Name }}</span>
</li>
</a>
{{ end }}
{{ end }}
</ul>
</div>
</div>
</nav>