diff options
Diffstat (limited to 'layouts/partials/widgets/categories.html')
-rw-r--r-- | layouts/partials/widgets/categories.html | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/layouts/partials/widgets/categories.html b/layouts/partials/widgets/categories.html index 2242bab..0a7e126 100644 --- a/layouts/partials/widgets/categories.html +++ b/layouts/partials/widgets/categories.html @@ -4,17 +4,20 @@ <div class="panel panel-default sidebar-menu"> <div class="panel-heading"> - <h3 class="panel-title">{{ i18n "categoriesTitle" }}</h3> + <h3 class="panel-title">{{ i18n "categoriesTitle" }}</h3> </div> <div class="panel-body"> <ul class="nav nav-pills nav-stacked"> + {{ $current := . }} {{ range $name, $items := .Site.Taxonomies.categories }} - <li><a href="{{ $.Site.BaseURL }}categories/{{ $name | urlize | lower }}">{{ $name }} ({{ len $items }})</a> + <li{{ if eq $current.RelPermalink ($name | urlize | lower | printf "/categories/%s/") }} class="active"{{ end }}> + <a href="{{ $.Site.BaseURL }}categories/{{ $name | urlize | lower }}">{{ $name }} ({{ len $items }})</a> </li> {{ end }} </ul> </div> + </div> {{ end }} {{ end }} |