Mark current page active in menu

This commit is contained in:
Benjamin Bach 2022-11-12 00:17:57 +01:00
parent 8af9ecc791
commit e939f07c03
Signed by untrusted user: benjaoming
GPG key ID: 7D49441634585664

View file

@ -1,15 +1,16 @@
<nav>
<ol>
{{ $currentPage := . }}
{{ range .Site.Menus.nav }}
<li><a href="{{ .URL }}">{{ .Name }}</a></li>
<li><a href="{{ .URL }}"{{ if (eq $currentPage.URL .URL) }} class="active"{{ end }}>{{ .Name }}</a></li>
{{ end }}
</ol>
<footer>
<ol>
{{ range $.Site.Home.AllTranslations }}
{{ range $.Site.Home.AllTranslations }}
<li><a href="{{ .Permalink }}">{{ .Language.LanguageName }}</a></li>
{{ end }}
{{ end }}
</ol>
</footer>
</nav>