Limit number of tags shown

This commit is contained in:
Brandon Rozek 2025-11-30 12:09:55 -05:00
parent fd4db04d3a
commit 56de4bacdb
No known key found for this signature in database
GPG key ID: DFB0E78F805F4567

View file

@ -31,11 +31,15 @@
<div class="bloglist-item"> <div class="bloglist-item">
<p><a href="{{ .Permalink }}">{{ .Title }}</a></p> <p><a href="{{ .Permalink }}">{{ .Title }}</a></p>
<p class="bloglist-item-tag"> <p class="bloglist-item-tag">
{{ $tag_count := 0 }}
{{ range .Params.tags }} {{ range .Params.tags }}
{{ if lt $tag_count 2 }}
{{ $name := . }} {{ $name := . }}
{{ with $.Site.GetPage (printf "/tags/%s" (. | urlize)) }} {{ with $.Site.GetPage (printf "/tags/%s" (. | urlize)) }}
<span><a href="{{ .Permalink }}">#{{ $name }}</a> </span> <span><a href="{{ .Permalink }}">#{{ $name }}</a> </span>
{{ end }} {{ end }}
{{ $tag_count = add $tag_count 1 }}
{{ end }}
{{ end }} {{ end }}
</p> </p>
</div> </div>