Skip to content

Commit

Permalink
Fix multiple active menu in taxonomy (hugo-toha#397)
Browse files Browse the repository at this point in the history
Signed-off-by: hossainemruz <[email protected]>
  • Loading branch information
hossainemruz committed Aug 16, 2021
1 parent 7b92452 commit 3c62ede
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion layouts/partials/navigators/taxonomies.html
Original file line number Diff line number Diff line change
@@ -1,13 +1,14 @@
{{ $context := .context }}
{{ $taxo := .taxo }}
{{ $title := .title }}
{{ $class:= "" }}
{{ if isset $context.Site.Taxonomies ( lower $taxo ) }}
{{ $taxonomy := index $context.Site.Taxonomies ( lower $taxo ) }}
{{ if (gt (len $taxonomy) 0)}}
{{ range $taxonomy }}
{{if eq $context.Title .Page.Title}}
{{ $class = "active" }}
{{else}}
{{$class = ""}}
{{end}}
<li><a class="taxonomy-term {{ $class }}" href="{{ .Page.Permalink }}" data-taxonomy-term="{{ urlize .Page.Title }}"><span class="taxonomy-label">{{ .Page.Title }}</span></a></li>
{{ end }}
Expand Down

0 comments on commit 3c62ede

Please sign in to comment.