fixup tag handling ; no longer mangle them (use what we provide!) and do not shuffle (use the order we set!)
This commit is contained in:
parent
161d718664
commit
ddde2d77d1
|
@ -1,16 +1,14 @@
|
|||
<div class="tags">
|
||||
<p class="clearfix">Tags:
|
||||
{{ if (isset . 0) }} {{/* Hack to check if this is an array https://discourse.gohugo.io/t/how-to-check-if-a-variable-is-string-or-array/7460/7 */}}
|
||||
{{ $humanized := apply . "humanize" "." }}
|
||||
{{ $sorted := sort $humanized }}
|
||||
{{ range first 1 $sorted }}
|
||||
{{ range first 1 . }}
|
||||
<a href="{{ ( printf "tags/%s/" ( . | urlize | lower ) ) | relLangURL }}"><span itemprop="keyword">{{ . }}</span></a>
|
||||
{{ end }}
|
||||
{{ range after 1 $sorted }}
|
||||
{{ range after 1 . }}
|
||||
• <a href="{{ ( printf "tags/%s/" ( . | urlize | lower ) ) | relLangURL }}"><span itemprop="keyword">{{ . }}</span></a>
|
||||
{{ end }}
|
||||
{{ else }}
|
||||
<a href="{{ ( printf "tags/%s/" ( . | urlize | lower ) ) | relLangURL }}"><span itemprop="keyword">{{ . | humanize }}</span></a>
|
||||
<a href="{{ ( printf "tags/%s/" ( . | urlize ) ) | relLangURL }}"><span itemprop="keyword">{{ . }}</span></a>
|
||||
{{ end }}
|
||||
</p>
|
||||
</div>
|
Loading…
Reference in a new issue