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
1 changed files with 2 additions and 1 deletions

View File

@ -11,7 +11,8 @@
{{ range .Site.Menus.main }}
{{ $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 }}
{{ end }}
<a class="navbar-item{{ if $isActive }} active{{ end }}"