mirror of
https://github.com/McShelby/hugo-theme-relearn.git
synced 2025-05-17 15:34:02 +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
layouts
|
@ -1,19 +1,13 @@
|
||||||
{{- /* based on Hugo 0.125.5 rss.xml */}}
|
{{- /* based on Hugo 0.135.0 rss.xml */}}
|
||||||
{{- /* Deprecate site.Author.email in favor of site.Params.author.email */}}
|
|
||||||
{{- $authorEmail := "" }}
|
{{- $authorEmail := "" }}
|
||||||
{{- if and .Site.Params.author (reflect.IsMap .Site.Params.author) .Site.Params.author.email }}
|
{{- with .Site.Params.author }}
|
||||||
{{- $authorEmail = .Site.Params.author.email }}
|
{{- if reflect.IsMap . }}
|
||||||
{{- else }}
|
{{- with .email }}
|
||||||
{{- with .Site.Author.email }}
|
{{- $authorEmail = . }}
|
||||||
{{- $authorEmail = . }}
|
|
||||||
{{- $hugoVersion := "0.120.0" }}
|
|
||||||
{{- if ge hugo.Version $hugoVersion }}
|
|
||||||
{{- warnf "The author key in site configuration is deprecated. Use params.author.email instead." }}
|
|
||||||
{{- end }}
|
{{- end }}
|
||||||
{{- end }}
|
{{- end }}
|
||||||
{{- end }}
|
{{- end }}
|
||||||
|
|
||||||
{{- /* Deprecate site.Author.name in favor of site.Params.author.name */}}
|
|
||||||
{{- $authorName := partialCached "_relearn/authorName.gotmpl" . }}
|
{{- $authorName := partialCached "_relearn/authorName.gotmpl" . }}
|
||||||
|
|
||||||
{{- $pages := .Pages }}
|
{{- $pages := .Pages }}
|
||||||
|
|
|
@ -1,20 +1,12 @@
|
||||||
{{- $authorName := "" }}
|
{{- $authorName := "" }}
|
||||||
{{- if .Site.Params.author }}
|
{{- with .Site.Params.author }}
|
||||||
{{- if reflect.IsMap .Site.Params.author }}
|
{{- if reflect.IsMap . }}
|
||||||
{{- with .Site.Params.author.name }}
|
{{- with .name }}
|
||||||
{{- $authorName = . }}
|
{{- $authorName = . }}
|
||||||
{{- end }}
|
{{- end }}
|
||||||
{{- else }}
|
{{- 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" }}
|
{{- 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 = . }}
|
{{- $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 }}
|
||||||
{{- end }}
|
{{- end }}
|
||||||
{{- return $authorName }}
|
{{- return $authorName }}
|
Loading…
Add table
Add a link
Reference in a new issue