Menu: work with sub-pages

This commit is contained in:
Théophile Bastian 2021-11-22 17:28:03 +01:00
parent 63d25e43e7
commit bfde3425a4

View file

@ -1,7 +1,7 @@
<ul>
<ul class="navmenu">
{{ $currentPage := . }}
{{ range .Site.Menus.main }}
<li class="{{ if $currentPage.IsMenuCurrent "main" . }}active{{ end }}">
<li class="{{ if or ($currentPage.IsMenuCurrent "main" .) ($currentPage.HasMenuCurrent "main" .) }}active{{ end }}">
<a href="{{ .URL }}">
{{ .Pre }}
<span>{{ .Name }}</span>