diff options
author | Joe Mooring <[email protected]> | 2023-10-31 00:34:30 -0700 |
---|---|---|
committer | GitHub <[email protected]> | 2023-10-31 08:34:30 +0100 |
commit | 23fcfb7f741a417f53a8ef4997bb68e64631df01 (patch) | |
tree | 2fd1eb29b0c793c4d2050c6e744f291a22ecf096 | |
parent | 47bf2fcbe275c9259641ffcbc75df904fbe7a9c9 (diff) | |
download | hugo-23fcfb7f741a417f53a8ef4997bb68e64631df01.tar.gz hugo-23fcfb7f741a417f53a8ef4997bb68e64631df01.zip |
tpl/tplimpl: Fix deprecation logic in RSS template
Closes #11639
-rw-r--r-- | tpl/tplimpl/embedded/templates/_default/rss.xml | 18 |
1 files changed, 14 insertions, 4 deletions
diff --git a/tpl/tplimpl/embedded/templates/_default/rss.xml b/tpl/tplimpl/embedded/templates/_default/rss.xml index 12756e781..a4cdd2383 100644 --- a/tpl/tplimpl/embedded/templates/_default/rss.xml +++ b/tpl/tplimpl/embedded/templates/_default/rss.xml @@ -1,7 +1,11 @@ {{- /* Deprecate site.Author.email in favor of site.Params.author.email */}} {{- $authorEmail := "" }} -{{- with site.Params.author.email }} - {{- $authorEmail = . }} +{{- with site.Params.author }} + {{- if reflect.IsMap . }} + {{- with .email }} + {{- $authorEmail = . }} + {{- end }} + {{- end }} {{- else }} {{- with site.Author.email }} {{- $authorEmail = . }} @@ -11,8 +15,14 @@ {{- /* Deprecate site.Author.name in favor of site.Params.author.name */}} {{- $authorName := "" }} -{{- with site.Params.author.name }} - {{- $authorName = . }} +{{- with site.Params.author }} + {{- if reflect.IsMap . }} + {{- with .name }} + {{- $authorName = . }} + {{- end }} + {{- else }} + {{- $authorName = . }} + {{- end }} {{- else }} {{- with site.Author.name }} {{- $authorName = . }} |