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