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") }}
<div class="series">
{{ range ($.GetTerms "series") }} {{ $series := slice }}
<span class="post-meta-item"> {{ range . }}
{{ partial "icon.html" "files" }} {{ $series = $series | append (printf `<a href="%s">%s</a>` .Permalink .LinkTitle) }}
<a href="{{ .Permalink }}">{{ .LinkTitle }}</a>
</span>
{{ end }} {{ end }}
<div class="series">
{{ partial "icon.html" "files" }}
{{ delimit $series ", " }}
</div> </div>
{{ end }} {{ end }}

View File

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