1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556 |
- <div class="panel panel-default sidebar-menu">
- <div class="panel-heading">
- <h3 class="panel-title">{{ i18n "categoriesTitle" }}</h3>
- </div>
- {{ $blogFolder := .Site.GetPage "section" "blog" }}
- {{ $current := . }}
- {{ with $blogFolder }}
- {{ $blogPages := .Pages }}
- <div class="panel-body">
- <ul class="nav nav-pills nav-stacked">
- {{ $uniqueCategories := slice }}
-
- {{ range $blogPages }}
- {{ with .Params.categories }}
- {{ range . }}
- {{ $categoryName := . }}
- {{ if not (in $uniqueCategories $categoryName) }}
- {{ $uniqueCategories = $uniqueCategories | append $categoryName }}
- <li{{ if eq $current.RelPermalink (printf "/categories/%s/" $categoryName | urlize | lower) }} class="active"{{ end }}>
- <a href="{{ "categories/" | relURL }}{{ $categoryName | urlize | lower }}">{{ $categoryName | title }}</a>
- </li>
- {{ end }}
- {{ end }}
- {{ end }}
- {{ end }}
- </ul>
- </div>
- {{ end }}
- </div>
- <!-- {{ if .Site.Params.widgets.categories }}
- {{ if isset .Site.Taxonomies "categories" }}
- {{ if not (eq (len .Site.Taxonomies.categories) 0) }}
- <div class="panel panel-default sidebar-menu">
- <div class="panel-heading">
- <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{{ if eq $current.RelPermalink ($name | urlize | lower | printf "/categories/%s/") }} class="active"{{ end }}>
- <a href="{{ "categories/" | relURL }}{{ $name | urlize | lower }}">{{ $name }} ({{ len $items }})</a>
- </li>
- {{ end }}
- </ul>
- </div>
- </div>
- {{ end }}
- {{ end }}
- {{ end }} -->
|