From 50a9f3bd4f8ff2ca7351c29373b484ca0b3518bd Mon Sep 17 00:00:00 2001 From: Joe Mooring Date: Mon, 30 Oct 2023 14:25:07 -0700 Subject: [PATCH] tpl/tplimpl: Fix deprecation logic in RSS template --- .../embedded/templates/_default/rss.xml | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) diff --git a/tpl/tplimpl/embedded/templates/_default/rss.xml b/tpl/tplimpl/embedded/templates/_default/rss.xml index 12756e78107..a4cdd2383a2 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 = . }}