mirror of
https://github.com/McShelby/hugo-theme-relearn.git
synced 2024-11-22 23:37:53 +00:00
theme: remove author deprecation warning #919
This commit is contained in:
parent
0bfd766acc
commit
a1ab7ecb2d
2 changed files with 8 additions and 22 deletions
|
@ -1,19 +1,13 @@
|
|||
{{- /* based on Hugo 0.125.5 rss.xml */}}
|
||||
{{- /* Deprecate site.Author.email in favor of site.Params.author.email */}}
|
||||
{{- /* based on Hugo 0.135.0 rss.xml */}}
|
||||
{{- $authorEmail := "" }}
|
||||
{{- if and .Site.Params.author (reflect.IsMap .Site.Params.author) .Site.Params.author.email }}
|
||||
{{- $authorEmail = .Site.Params.author.email }}
|
||||
{{- else }}
|
||||
{{- with .Site.Author.email }}
|
||||
{{- $authorEmail = . }}
|
||||
{{- $hugoVersion := "0.120.0" }}
|
||||
{{- if ge hugo.Version $hugoVersion }}
|
||||
{{- warnf "The author key in site configuration is deprecated. Use params.author.email instead." }}
|
||||
{{- with .Site.Params.author }}
|
||||
{{- if reflect.IsMap . }}
|
||||
{{- with .email }}
|
||||
{{- $authorEmail = . }}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
|
||||
{{- /* Deprecate site.Author.name in favor of site.Params.author.name */}}
|
||||
{{- $authorName := partialCached "_relearn/authorName.gotmpl" . }}
|
||||
|
||||
{{- $pages := .Pages }}
|
||||
|
|
|
@ -1,20 +1,12 @@
|
|||
{{- $authorName := "" }}
|
||||
{{- if .Site.Params.author }}
|
||||
{{- if reflect.IsMap .Site.Params.author }}
|
||||
{{- with .Site.Params.author.name }}
|
||||
{{- with .Site.Params.author }}
|
||||
{{- if reflect.IsMap . }}
|
||||
{{- with .name }}
|
||||
{{- $authorName = . }}
|
||||
{{- end }}
|
||||
{{- else }}
|
||||
{{- warnf "DEPRECATED usage of 'params.author' config parameter found, replace it with `params.author.name` in your hugo.toml; see https://mcshelby.github.io/hugo-theme-relearn/basics/releasenotes/5/#5-23-0" }}
|
||||
{{- $authorName = .Site.Params.author }}
|
||||
{{- end }}
|
||||
{{- else }}
|
||||
{{- with .Site.Author.name }}
|
||||
{{- $authorName = . }}
|
||||
{{- $hugoVersion := "0.120.0" }}
|
||||
{{- if ge hugo.Version $hugoVersion }}
|
||||
{{- warnf "The author key in site configuration is deprecated. Use params.author.name instead." }}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
{{- return $authorName }}
|
Loading…
Reference in a new issue