mirror of
https://github.com/McShelby/hugo-theme-relearn
synced 2025-05-09 15:54:17 +08:00
17 lines
679 B
Plaintext
17 lines
679 B
Plaintext
|
{{- $authorName := "" }}
|
||
|
{{- if .Site.Params.author }}
|
||
|
{{- if reflect.IsMap .Site.Params.author }}
|
||
|
{{- with .Site.Params.author.name }}
|
||
|
{{- $authorName = . }}
|
||
|
{{- end }}
|
||
|
{{- else }}
|
||
|
{{- warnf "%q: DEPRECATED usage of 'params.author' config parameter found, replace it with `params.author.name` in your config.toml; see https://mcshelby.github.io/hugo-theme-relearn/basics/migration/#5230" .File.Path }}
|
||
|
{{- $authorName = .Site.Params.author }}
|
||
|
{{- end }}
|
||
|
{{- else }}
|
||
|
{{- with .Site.Author.name }}
|
||
|
{{- $authorName = . }}
|
||
|
{{- warnf "The author key in site configuration is deprecated. Use params.author.name instead." }}
|
||
|
{{- end }}
|
||
|
{{- end }}
|
||
|
{{- return $authorName }}
|