Use comma delimiting for series and tags

This commit is contained in:
BBaoVanC 2021-11-15 21:11:50 -06:00
parent b2036d3bfe
commit 6d456768fa
Signed by: bbaovanc
GPG Key ID: 18089E4E3CCF1D3A
2 changed files with 19 additions and 11 deletions

View File

@ -1,10 +1,12 @@
{{ with .Params.series }} {{ with (.GetTerms "series") }}
{{ $series := slice }}
{{ range . }}
{{ $series = $series | append (printf `<a href="%s">%s</a>` .Permalink .LinkTitle) }}
{{ end }}
<div class="series"> <div class="series">
{{ range ($.GetTerms "series") }} {{ partial "icon.html" "files" }}
<span class="post-meta-item"> {{ delimit $series ", " }}
{{ partial "icon.html" "files" }}
<a href="{{ .Permalink }}">{{ .LinkTitle }}</a>
</span>
{{ end }}
</div> </div>
{{ end }} {{ end }}

View File

@ -1,8 +1,14 @@
{{ with (.GetTerms "tags") }}
{{ $tags := slice }}
{{ range . }}
{{ $tags = $tags | append (printf `<a href="%s">%s</a>` .Permalink .LinkTitle) }}
{{ end }}
<div class="tags"> <div class="tags">
{{ range (.GetTerms "tags") }} {{ partial "icon.html" "tag" }}
<span class="post-meta-item"> <span class="post-meta-item">
{{ partial "icon.html" "tag" }} {{ delimit $tags ", " }}
<a href="{{ .Permalink }}">{{ .LinkTitle }}</a>
</span> </span>
{{ end }}
</div> </div>
{{ end }}