Hey there,
I’m currently writing a Documenation with Hugo and I’ve encountered an Issue while creating a Sidebar-Navigation.
I have a Taxonomy called Topics and these Taxonomies have Help Articles
{{ range $name, $taxonomy := .Site.Taxonomies.topics }} <li> {{ $name }} </li> <ul class="help-side-subnav"> {{ range $taxonomy.Pages }} <li hugo-nav="{{ .RelPermalink}}"><a href="{{ .Permalink}}">{{ .LinkTitle }}</a></li> {{ end }} </ul> {{ end }}
How do I give the Page of the Taxonomy an Active state when being on that page?
A second small issue I encountered is that when I enter a subpage of my Main Menu’s Entries i lose the active state of the main menu.
It currently works like this
{{ $currentNode := . }} {{ range .Site.Menus.main }} <li><a class="nav-link-white {{ if $currentNode.IsMenuCurrent "main" . }} active {{end}}" href="{{.URL}}"> {{ .Name }} </a></li> {{ end }}
When I’m on /help IsMenuCurrent is work but when im on a subpage like /help/my-article i lose the active state. How can I keep it?