hugo-toha/layouts/partials/helpers/get-author-image.html
Jean-Baptiste Le Duigou 5517dae23a
If no author specified in blog post, it should default to site author (#6)
* 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
2020-06-24 13:27:28 +06:00

12 lines
377 B
HTML

{{ $authorImage:= "/assets/images/default-avatar.png"}}
{{ if .Site.Data.site.author}}
{{ $authorImage = .Site.Data.site.author.image | relURL }}
{{ end}}
{{ if eq (printf "%T" .Params.author ) "maps.Params" }}
{{ with .Params.author }}
{{ if .image }}
{{ $authorImage = .image }}
{{ end }}
{{ end }}
{{ end }}
{{ return $authorImage }}