Highlighting of current page stopped working, something with new URLS, this fix fixes it, but I don't know if it is the correct way to accomplish it.

This commit is contained in:
Halfdan 2022-12-13 20:24:39 +01:00
parent f65718db01
commit 7b4e3ac695

View file

@ -2,7 +2,9 @@
<ol>
{{ $currentPage := . }}
{{ range .Site.Menus.nav }}
<li><a href="{{ .URL }}"{{ if (eq $currentPage.URL .URL) }} class="active"{{ end }}>{{ .Name }}</a></li>
{{ $atURL := absURL $currentPage.URL }}
{{ $compURL := absURL .URL }}
<li><a href="{{ .URL }}"{{ if (eq $atURL $compURL) }} class="active"{{ end }}>{{ .Name }}</a></li>
{{ end }}
</ol>