mirror of
https://github.com/yuzu-emu/shared-bulma-theme.git
synced 2024-11-27 21:04:16 +01:00
layouts/entry/single: fix a regression ...
... where if there is exactly one co-author, hugo will not treat this as an array, so that the if condition will fail. The fix simply fix this comparison by using the original value in the comparison
This commit is contained in:
parent
08055d9f35
commit
1991fdee58
@ -6,7 +6,8 @@
|
|||||||
<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 (gt (len $coauthors) 1) }}
|
{{/* if $author && .Params.coauthor */}}
|
||||||
|
{{ if and $author .Params.coauthor }}
|
||||||
<div>
|
<div>
|
||||||
<p 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>
|
||||||
@ -19,12 +20,12 @@
|
|||||||
{{ $length := len $coauthors }}
|
{{ $length := len $coauthors }}
|
||||||
{{ range $i, $name := $coauthors }}
|
{{ range $i, $name := $coauthors }}
|
||||||
{{ $coauthor := index $.Site.Data.authors $name }}
|
{{ $coauthor := index $.Site.Data.authors $name }}
|
||||||
{{/* if i == length -1 */}}
|
{{/* if i == (length -1) */}}
|
||||||
{{ if eq $i (sub $length 1) }}
|
{{ if eq $i (sub $length 1) }}
|
||||||
and
|
and
|
||||||
{{ end }}
|
{{ end }}
|
||||||
<a href="https://community.citra-emu.org/users/{{ $coauthor.key }}">{{ $coauthor.name }}</a>{{- if lt $i (sub $length 1) -}},{{- 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 */}}
|
{{/* if i < (length - 1) */}}
|
||||||
{{ end }}
|
{{ end }}
|
||||||
{{ end }}
|
{{ end }}
|
||||||
on {{ .Date.Format $.Site.Params.fmt.Date }}
|
on {{ .Date.Format $.Site.Params.fmt.Date }}
|
||||||
|
Loading…
Reference in New Issue
Block a user