Fix navbar highlighting on section page itself

This commit is contained in:
BBaoVanC 2023-10-15 17:49:56 -05:00
parent c0426f191a
commit fde24f7438
Signed by: bbaovanc
GPG Key ID: 18089E4E3CCF1D3A

View File

@ -11,7 +11,8 @@
{{ range .Site.Menus.main }} {{ range .Site.Menus.main }}
{{ $isActive := false }} {{ $isActive := false }}
{{ if or ($.HasMenuCurrent .Menu .) ($.IsMenuCurrent .Menu .) }} {{/* https://discourse.gohugo.io/t/ismenucurrent-not-working-with-using-sectionpagesmenu/46687/2?u=bbaovanc */}}
{{ if or ($.HasMenuCurrent .Menu .) (eq .Page $) }}
{{ $isActive = true }} {{ $isActive = true }}
{{ end }} {{ end }}
<a class="navbar-item{{ if $isActive }} active{{ end }}" <a class="navbar-item{{ if $isActive }} active{{ end }}"