hugo-toha/layouts/partials/helpers/get-author-image.html
alex bezek d0c32c5d08
Fix the single template to use the authors avatar correctly (#107)
* Fix the single template to use the authors avatar correctly

* Replace absURL with relURL and .Site.X with site.X

Co-authored-by: Emruz Hossain <emruz@appscode.com>
2020-10-25 08:07:18 +06:00

17 lines
504 B
HTML

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