* Author name should default to site author If author name is not present in the blog post it should default to site author * Default to site author If author image is not present in the blog post, it should default to the site author
12 lines
332 B
HTML
12 lines
332 B
HTML
{{ $authorName:= "John Doe"}}
|
|
{{ if .Site.Data.site.author}}
|
|
{{ $authorName = .Site.Data.site.author.name }}
|
|
{{ end}}
|
|
{{ if eq (printf "%T" .Params.author ) "maps.Params" }}
|
|
{{ with .Params.author }}
|
|
{{ if .name }}
|
|
{{ $authorName = .name }}
|
|
{{ end }}
|
|
{{ end }}
|
|
{{ end }}
|
|
{{ return $authorName }}
|