Mark current page active in menu (#49)

This commit is contained in:
valberg 2022-11-12 05:58:20 +00:00
commit e33bf7b8c5

View file

@ -1,7 +1,8 @@
<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>