Fix tags and categories using GetTerms

See [documentation](https://gohugo.io/templates/taxonomy-templates/#display-a-single-piece-of-contents-taxonomies)
This commit is contained in:
romainx
2020-10-09 19:26:28 +02:00
parent 1d95c4b8ff
commit ddebaee028
4 changed files with 14 additions and 20 deletions
+3 -6
View File
@@ -1,5 +1,3 @@
{{ $tags := .Site.Taxonomies.tags.ByCount }}
<section class="widget tagCloud">
<div class="widget-icon">
{{ (resources.Get "icons/tag.svg").Content | safeHTML }}
@@ -7,10 +5,9 @@
<h1 class="widget-title">{{ T "widgetTagCloudTitle" }}</h1>
<div class="tagCloud-tags">
{{ range first .Site.Params.widgets.tagCloud.limit $tags }}
{{ $term := $.Site.GetPage (printf "/tags/%s" .Term) }}
<a href="{{ $term.Permalink }}" class="font_size_{{ .Count }}">
{{ $term.Title | humanize }}
{{ range first .Site.Params.widgets.tagCloud.limit .Site.Taxonomies.tags.ByCount }}
<a href="{{ .Page.Permalink }}" class="font_size_{{ .Count }}">
{{ .Page.Title | humanize }}
</a>
{{ end }}
</div>