Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/shaform/hugo-theme-den.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorShaform <shaform@gmail.com>2018-11-17 06:15:54 +0300
committerShaform <shaform@gmail.com>2018-11-17 06:15:54 +0300
commita6624c4dd9c120c105e4852f4dfa5e5723be45ad (patch)
tree4402080acb97d2da7a667b2c97333af9a622b783 /layouts
parent0ebd7323f87e083cfa957801c5a4849f120b0527 (diff)
fix bug and add example
Diffstat (limited to 'layouts')
-rw-r--r--layouts/posts/single.html4
1 files changed, 3 insertions, 1 deletions
diff --git a/layouts/posts/single.html b/layouts/posts/single.html
index 8f42523..ea1aecb 100644
--- a/layouts/posts/single.html
+++ b/layouts/posts/single.html
@@ -9,7 +9,9 @@
{{- $last := (sub (len .Params.authors) 1) -}}
{{- i18n "author_by" }}
{{ range $index, $value := .Params.authors -}}
- {{ (index (index $.Site.Data.authors $value) $.Site.LanguageCode).name.display | default (index $.Site.Data.authors $value).name.display | default $value }}{{ if ne $index $last }}, {{ end -}}
+ {{- $author := index $.Site.Data.authors $value -}}
+ {{- $author_lang := index ($author | default $.Site.Data.authors) $.Site.LanguageCode | default $author -}}
+ {{ $author_lang.name.display | default $value }}{{ if ne $index $last }}, {{ end -}}
{{ end }} /
{{ end }}
{{ .Date.Format (.Site.Params.dateFormatToUse | default "Mon 02 January 2006") -}}