Skip to content

Commit 13c1ab2

Browse files
committed
Fix multiple authors
1 parent 87ffb0c commit 13c1ab2

File tree

1 file changed

+9
-6
lines changed

1 file changed

+9
-6
lines changed

layouts/_default/single.html

+9-6
Original file line numberDiff line numberDiff line change
@@ -4,21 +4,24 @@ <h1>{{ .Title }}</h1>
44
<span class="text-faded"
55
>Posted on <time datetime="{{ .Date.Format "2006-01-02" }}">{{ dateFormat ":date_long" .Date }}</time> by
66
</span>
7-
{{ range .Params.authors }}
8-
{{- if isset . "social" -}}
9-
<a href="{{ .social }}">{{ .name }}</a>
7+
{{ range $authorIndex, $author := .Params.authors -}}
8+
{{ if ne $authorIndex 0 -}}
9+
,
10+
{{ end -}}
11+
{{- if isset $author "social" -}}
12+
<a href="{{ $author.social }}">{{ $author.name }}</a>
1013
{{- else -}}
11-
<span>{{ .name }}</span>
14+
<span>{{ $author.name }}</span>
1215
{{- end -}}
13-
{{ if and (.links) (gt (len .links) 0) }}
16+
{{- if and (.links) (gt (len .links) 0) }}
1417
(
1518
{{- range $index, $link := .links -}}
1619
{{ if ne $index 0 -}}
1720
,
1821
{{ end -}}<a href="{{ $link.link }}">{{ $link.name }}</a>
1922
{{- end -}}
2023
)
21-
{{ end }}
24+
{{- end }}
2225
{{- end -}}
2326

2427
{{- if .Draft -}}

0 commit comments

Comments
 (0)