mirror of
https://github.com/adityatelange/hugo-PaperMod.git
synced 2023-12-21 10:22:58 +01:00
Fall back post author to '.Site.Author.name' when it is not set.
'.Site.Author' is a recognized Hugo site variable, c.f. [1]. It's also already used elsewhere within PaperMod, namely in rss.xml. By falling back to this variable users' configs can be simplified, being effectively unnecessary to set the author twice, in .Site.Params.author. [1]: c.f. https://gohugo.io/variables/site/#site-variables-list
This commit is contained in:
parent
54a3c60735
commit
4b663ca8e3
@ -1,5 +1,5 @@
|
||||
{{- if or .Params.author .Site.Params.author }}
|
||||
{{- $author := (.Params.author | default .Site.Params.author) }}
|
||||
{{- if or .Params.author .Site.Params.author .Site.Author.name }}
|
||||
{{- $author := (.Params.author | default .Site.Params.author | default .Site.Author.name) }}
|
||||
{{- $author_type := (printf "%T" $author) }}
|
||||
{{- if (or (eq $author_type "[]string") (eq $author_type "[]interface {}")) }}
|
||||
{{- (delimit $author ", " ) }}
|
||||
|
Loading…
Reference in New Issue
Block a user