浏览代码

Fix multiple active menu in taxonomy (#397)

Signed-off-by: hossainemruz <hossainemruz@gmail.com>
Emruz Hossain 3 年之前
父节点
当前提交
3c62edec20
共有 1 个文件被更改,包括 2 次插入1 次删除
  1. 2 1
      layouts/partials/navigators/taxonomies.html

+ 2 - 1
layouts/partials/navigators/taxonomies.html

@@ -1,6 +1,5 @@
 {{ $context := .context  }}
 {{ $taxo := .taxo  }}
-{{ $title := .title  }}
 {{ $class:= "" }}
 {{ if isset $context.Site.Taxonomies ( lower $taxo ) }}
   {{ $taxonomy := index $context.Site.Taxonomies ( lower $taxo ) }}
@@ -8,6 +7,8 @@
         {{ 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 }}