hugo-toha/layouts/partials/helpers/get-author-name.html
Andreas Deininger 3edd8e7858
Fix deprecation warnings (#908)
* Example site: bump hugo modules to latest versions

* Fix deprecation warnings emitted by hugo v0.124

* Fix typos

* Netlify: bump hugo version

---------

Co-authored-by: Emruz Hossain <hossainemruz@gmail.com>
2024-05-11 00:00:29 +06:00

17 lines
612 B
HTML

{{/* Uses the top level site's config for a single author across all locales */}}
{{ $authorName:= site.Params.author.name }}
{{/* Overrides with the locale specific author if provided */}}
{{ if (index site.Data site.Language.Lang).author }}
{{ $authorName = (index site.Data site.Language.Lang).author.name }}
{{ end }}
{{/* Lastly, overrides with the post specific author if provided */}}
{{ if eq (printf "%T" .Params.author ) "maps.Params" }}
{{ with .Params.author }}
{{ if .name }}
{{ $authorName = .name }}
{{ end }}
{{ end }}
{{ end }}
{{ return $authorName }}