If authors taxonomy is enabled, link to it in metadata

This commit is contained in:
BBaoVanC 2021-11-06 19:12:56 -05:00
parent 4e27a6ce8a
commit 8ada21c609
Signed by: bbaovanc
GPG Key ID: 18089E4E3CCF1D3A
1 changed files with 13 additions and 0 deletions

View File

@ -27,7 +27,20 @@
{{ with .Params.authors }}
<span class="post-meta-item">
{{ partial "icon.html" "user-circle" }}
{{ if index $.Site.Taxonomies "authors" }}
{{ $authors := slice }}
{{ range . }}
{{ $url := (printf "/authors/%s" (. | anchorize)) | absLangURL }}
{{ $authors = $authors | append (printf `<a href="%s">%s</a>` $url . | safeHTML) }}
{{ end }}
{{ delimit $authors ", " }}
{{ else }}
{{ delimit . ", " }}
{{ end }}
</span>
{{ end }}