summaryrefslogtreecommitdiff
path: root/themes/new_theme/layouts/partials/widgets/categories.html
diff options
context:
space:
mode:
Diffstat (limited to 'themes/new_theme/layouts/partials/widgets/categories.html')
-rw-r--r--themes/new_theme/layouts/partials/widgets/categories.html17
1 files changed, 9 insertions, 8 deletions
diff --git a/themes/new_theme/layouts/partials/widgets/categories.html b/themes/new_theme/layouts/partials/widgets/categories.html
index 506cb1f..4998c44 100644
--- a/themes/new_theme/layouts/partials/widgets/categories.html
+++ b/themes/new_theme/layouts/partials/widgets/categories.html
@@ -1,16 +1,17 @@
-{{- if .Site.Params.widgets.categories }}
-{{- if isset .Site.Taxonomies "categories" }}
-{{- if not (eq (len .Site.Taxonomies.categories) 0) }}
+{{- $categories := .Site.Taxonomies.categories }}
+{{- if gt (len $categories) 0 }}
<div class="widget-categories widget">
- <h4 class="widget__title"><a href="/categories/">Categories</a></h4>
+ <h4 class="widget__title">{{ T "categories_title" }}</h4>
<div class="widget__content">
<ul class="widget__list">
- {{- range $name, $items := .Site.Taxonomies.categories }}
- <li class="widget__item"><a class="widget__link" href="{{ $.Site.BaseURL }}categories/{{ $name | urlize | lower }}">{{ $name | title }}</a></li>
+ {{- range $name, $taxonomy := $categories }}
+ {{- with $.Site.GetPage (printf "/categories/%s" $name) }}
+ <li class="widget__item">
+ <a class="widget__link" href="{{ .RelPermalink }}">{{ .Title }}</a>
+ </li>
{{- end }}
+ {{- end }}
</ul>
</div>
</div>
{{- end }}
-{{- end }}
-{{- end }}