diff --git a/layouts/partials/paige/menu.html b/layouts/partials/paige/menu.html index e65bdee4..36c7beec 100644 --- a/layouts/partials/paige/menu.html +++ b/layouts/partials/paige/menu.html @@ -30,7 +30,10 @@ {{ range site.Menus.main }} {{ $pagepath := strings.TrimPrefix $basepath $.RelPermalink }} {{ $menupath := strings.TrimPrefix $basepath .URL }} - {{ $active := or (and (eq $menupath "/") (eq $pagepath "/")) (and (ne $menupath "/") (hasPrefix $pagepath $menupath)) }} + {{ $home := (and (eq $menupath "/") (eq $pagepath "/")) }} + {{ $menuprefix := (and (ne $menupath "/") (hasPrefix $pagepath $menupath)) }} + {{ $sectionprefix := (and (ne $menupath "/") (hasPrefix $menupath (printf "/%s/" $page.Section))) }} + {{ $active := or $home $menuprefix $sectionprefix }} {{ .Name }} {{ end }}