Hello,
I am trying to set an active class on the <a>
element below when the current page is loaded:
{{ range $taxonomyname, $taxonomy := .Site.Taxonomies }} <ul class="global-nav"> {{ range $key, $value := $taxonomy }} <li> {{ $key }} </li> <ul> {{ range $value.Pages }} <li hugo-nav="{{ .RelPermalink}}"> <a class="active if current page" href="{{ .Permalink}}"> {{ .LinkTitle }} </a> </li> {{ end }} </ul> {{ end }} </ul> {{ end }}
Can someone please help me to achieve this?