feat: multiple authors

Signed-off-by: jolheiser <john.olheiser@gmail.com>
This commit is contained in:
jolheiser 2023-01-24 23:34:09 -06:00
parent 9237f02532
commit 7890d3276f
No known key found for this signature in database
GPG Key ID: B853ADA5DA7BBF7A
3 changed files with 29 additions and 7 deletions

View File

@ -10,9 +10,20 @@
<div class="media-content">
<a class="title is-4" href="{{ .Permalink }}">{{ .Title }}</a>
<p class="subtitle is-6">{{ .Date.Format "Mon Jan 2, 2006" }} {{ i18n "authored_by" }}
<a href="https://gitea.com/{{ .Params.author | default .Site.Params.author }}">
{{ .Params.author | default .Site.Params.author }}
</a>
{{ if .Params.authors }}
{{ $s := newScratch }}
{{ $s.Set "len" (len .Params.authors) }}
{{ $s.Add "len" -1 }}
{{ range $idx, $author := .Params.authors -}}
<a href="https://gitea.com/{{ $author | default $.Site.Params.author }}">
{{ $author | default $.Site.Params.author }}
</a>{{ if ne $idx ($s.Get "len") }}, {{end}}
{{- end }}
{{ else }}
<a href="https://gitea.com/{{ .Params.author | default .Site.Params.author }}">
{{ .Params.author | default .Site.Params.author }}
</a>
{{ end }}
</p>
</div>
</div>

View File

@ -13,9 +13,20 @@
<i>{{ .Date.Format "Mon Jan 2, 2006" }}</i>
{{ i18n "authored_by" }}
<b>
<a href="https://gitea.com/{{ .Params.author | default .Site.Params.author }}">
{{ .Params.author | default .Site.Params.author }}
</a>
{{ if .Params.authors }}
{{ $s := newScratch }}
{{ $s.Set "len" (len .Params.authors) }}
{{ $s.Add "len" -1 }}
{{ range $idx, $author := .Params.authors -}}
<a href="https://gitea.com/{{ $author | default $.Site.Params.author }}">
{{ $author | default $.Site.Params.author }}
</a>{{ if ne $idx ($s.Get "len") }}, {{end}}
{{- end }}
{{ else }}
<a href="https://gitea.com/{{ .Params.author | default .Site.Params.author }}">
{{ .Params.author | default .Site.Params.author }}
</a>
{{ end }}
</b>
</p>

View File

@ -57,7 +57,7 @@ $tertiary: #4183c4;
border-radius: 0.2em;
.media-content a{
display: block;
display: inline-block;
}
}