summaryrefslogtreecommitdiff
path: root/themes/new_theme/layouts/partials/widgets/categories.html
diff options
context:
space:
mode:
authorAndreas Baumann <mail@andreasbaumann.cc>2020-06-05 16:57:53 +0200
committerAndreas Baumann <mail@andreasbaumann.cc>2020-06-05 16:57:53 +0200
commit983b64ca51f5e769f790a5ebc55e3808157b8d94 (patch)
tree4fb52d8e2f449e44a51ed0549cec9debbcd3d157 /themes/new_theme/layouts/partials/widgets/categories.html
parentff7e6bde0be9ac60e694097ce3598f9b552c4807 (diff)
downloadwww-andreasbaumann-cc-983b64ca51f5e769f790a5ebc55e3808157b8d94.tar.gz
www-andreasbaumann-cc-983b64ca51f5e769f790a5ebc55e3808157b8d94.tar.bz2
updated to newest theme supporting newer hugo versions
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 7b93a4e..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">Categories</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 }}