mirror of
https://github.com/yuzu-emu/shared-bulma-theme.git
synced 2024-12-22 13:35:32 +00:00
layout/entry/single: add support for multiple coauthors
This commit is contained in:
parent
5a87667766
commit
c5ac01dd28
|
@ -1,25 +1,41 @@
|
|||
{{ define "header" }}
|
||||
{{ $author := index .Site.Data.authors ( .Params.author | default "" ) }}
|
||||
{{ $coauthor := index .Site.Data.authors ( .Params.coauthor | default "" ) }}
|
||||
{{ $coauthors := split ( .Params.coauthor | default "" ) "," }}
|
||||
<div class="mb-md blog-entry-header single" style="background-image: url('{{ .Site.BaseURL }}/{{ .Dir }}banner.png')"></div>
|
||||
<div class="has-text-centered">
|
||||
<div>
|
||||
<span class="title px-md py-sm">{{ .Title }}</span>
|
||||
</div>
|
||||
{{ if and $author $coauthor }}
|
||||
{{ if and $author $coauthors }}
|
||||
<div>
|
||||
<span class="h3 px-md py-sm">
|
||||
Written by <a href="https://community.citra-emu.org/users/{{ $author.key }}">{{ $author.name }}</a>
|
||||
and <a href="https://community.citra-emu.org/users/{{ $coauthor.key }}">{{ $coauthor.name }}</a>
|
||||
<p class="h3 px-md py-sm">
|
||||
Written by <a href="https://community.citra-emu.org/users/{{ $author.key }}">{{ $author.name }}</a>
|
||||
{{/* if len($coauthors) < 2 */}}
|
||||
{{ if lt (len $coauthors) 2 }}
|
||||
{{ $coauthor := index .Site.Data.authors ( .Params.coauthor | default "" ) }}
|
||||
and <a href="https://community.citra-emu.org/users/{{ $coauthor.key }}">{{ $coauthor.name }}</a>
|
||||
{{ else }}
|
||||
in collaboration with
|
||||
{{ $length := len $coauthors }}
|
||||
{{ range $i, $name := $coauthors }}
|
||||
{{ $coauthor := index $.Site.Data.authors $name }}
|
||||
{{/* if i == length -1 */}}
|
||||
{{ if eq $i (sub $length 1) }}
|
||||
and
|
||||
{{ end }}
|
||||
<a href="https://community.citra-emu.org/users/{{ $coauthor.key }}">{{ $coauthor.name }}</a>{{- if lt $i (sub $length 1) -}},{{- end -}}
|
||||
{{/* if i < length - 1 */}}
|
||||
{{ end }}
|
||||
{{ end }}
|
||||
on {{ .Date.Format $.Site.Params.fmt.Date }}
|
||||
</span>
|
||||
</p>
|
||||
</div>
|
||||
{{ else if $author }}
|
||||
<div>
|
||||
<span class="h3 px-md py-sm">
|
||||
Written by <a href="https://community.citra-emu.org/users/{{ $author.key }}">{{ $author.name }}</a>
|
||||
Written by <a href="https://community.citra-emu.org/users/{{ $author.key }}">{{ $author.name }}</a>
|
||||
on {{ .Date.Format $.Site.Params.fmt.Date }}
|
||||
</span>
|
||||
</span>
|
||||
</div>
|
||||
{{ else }}
|
||||
<div>
|
||||
|
|
Loading…
Reference in a new issue