mirror of
https://github.com/yuzu-emu/shared-bulma-theme.git
synced 2024-12-22 19:25:30 +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" }}
|
{{ define "header" }}
|
||||||
{{ $author := index .Site.Data.authors ( .Params.author | default "" ) }}
|
{{ $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="mb-md blog-entry-header single" style="background-image: url('{{ .Site.BaseURL }}/{{ .Dir }}banner.png')"></div>
|
||||||
<div class="has-text-centered">
|
<div class="has-text-centered">
|
||||||
<div>
|
<div>
|
||||||
<span class="title px-md py-sm">{{ .Title }}</span>
|
<span class="title px-md py-sm">{{ .Title }}</span>
|
||||||
</div>
|
</div>
|
||||||
{{ if and $author $coauthor }}
|
{{ if and $author $coauthors }}
|
||||||
<div>
|
<div>
|
||||||
<span class="h3 px-md py-sm">
|
<p 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>
|
||||||
and <a href="https://community.citra-emu.org/users/{{ $coauthor.key }}">{{ $coauthor.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 }}
|
on {{ .Date.Format $.Site.Params.fmt.Date }}
|
||||||
</span>
|
</p>
|
||||||
</div>
|
</div>
|
||||||
{{ else if $author }}
|
{{ else if $author }}
|
||||||
<div>
|
<div>
|
||||||
<span class="h3 px-md py-sm">
|
<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 }}
|
on {{ .Date.Format $.Site.Params.fmt.Date }}
|
||||||
</span>
|
</span>
|
||||||
</div>
|
</div>
|
||||||
{{ else }}
|
{{ else }}
|
||||||
<div>
|
<div>
|
||||||
|
|
Loading…
Reference in a new issue