website/layouts/partials/nav.html
2020-10-09 10:00:12 +02:00

47 lines
1.2 KiB
HTML

{{ $currentPage := . }}
<nav>
<div class="container">
<section class="website-name">
{{ range .Site.Menus.name }}
{{ if $currentPage.IsMenuCurrent "name" . }}
<a href="{{ .URL }}" class="active">{{ .Name }}</a>
{{ else }}
<a href="{{ .URL }}">{{ .Name }}</a>
{{ end }}
{{ end }}
</section>
<span class="seperator">/</span>
<section class="website-mainmenu">
<ul>
{{ range .Site.Menus.main }}
{{ if or ($currentPage.IsMenuCurrent "main" .) ($currentPage.HasMenuCurrent "main" .) }}
<li class="active">
<a href="{{ .URL }}">
<span>{{ .Name }}</span>
</a>
</li>
{{ else }}
<li>
<a href="{{ .URL }}">
<span>{{ .Name }}</span>
</a>
</li>
{{ end }}
{{ end }}
</ul>
</section>
<section class="website-externallinks">
<ul>
{{ range .Site.Menus.externallinks }}
<li>
<a title="{{ .URL }}" href="{{ .URL }}">
{{ .Pre }}
<span>{{ .Name }}</span>
</a>
</li>
{{ end }}
</ul>
</section>
</div>
</nav>