Skip to content

Commit 0478155

Browse files
fix multiauthors
1 parent 2e1951d commit 0478155

File tree

2 files changed

+23
-6
lines changed

2 files changed

+23
-6
lines changed

hugo.toml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,8 @@ defaultContentLanguage = 'en'
1818
# defaultContentLanguageInSubdir need to be true if you want to use the language code as a subdirectory and language specific 404 page
1919
defaultContentLanguageInSubdir = false
2020

21+
removePathAccents = true
22+
2123
########################### Services #############################
2224
[services]
2325
#[services.googleAnalytics]
@@ -37,7 +39,6 @@ disableAliases = false
3739
pagerSize = 10
3840
path = 'page'
3941

40-
4142
############################# Build ##############################
4243
[build]
4344
[build.buildStats]

themes/hugoplate/layouts/blog/single.html

Lines changed: 21 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -14,11 +14,27 @@ <h1 class="h2 mb-4">
1414
</h1>
1515
<ul class="mb-4">
1616
<li class="mr-4 inline-block">
17-
<a
18-
href="{{ `authors/` | relLangURL }}{{ .Params.Author | urlize }}/">
19-
<i class="fa-regular fa-circle-user mr-2"></i
20-
>{{ .Params.author }}
21-
</a>
17+
{{- $authors := .Params.authors }}
18+
{{- if $authors }}
19+
{{- $last := index $authors (sub (len $authors) 1) }}
20+
{{- range $index, $author := $authors }}
21+
<a
22+
href="{{ `authors/` | relLangURL }}{{ $author | urlize }}/">
23+
{{- if ne $author $last }}
24+
<i class="fa-regular fa-circle-user mr-2"></i
25+
>{{ $author }},
26+
{{- else }}
27+
{{ $author }}
28+
{{- end }}
29+
</a>
30+
{{- end }}
31+
{{- else if .Params.author }}
32+
<a
33+
href="{{ `authors/` | relLangURL }}{{ .Params.author | urlize }}/">
34+
<i class="fa-regular fa-circle-user mr-2"></i
35+
>{{ .Params.author }}
36+
</a>
37+
{{- end }}
2238
</li>
2339
{{ $categories:= .Params.categories }}
2440
{{ if $categories }}

0 commit comments

Comments
 (0)