]> git.maquefel.me Git - brevno-suite/hugo/commitdiff
tpl/tplimpl: Fix deprecation logic in RSS template
authorJoe Mooring <joe@mooring.com>
Tue, 31 Oct 2023 07:34:30 +0000 (00:34 -0700)
committerGitHub <noreply@github.com>
Tue, 31 Oct 2023 07:34:30 +0000 (08:34 +0100)
Closes #11639

tpl/tplimpl/embedded/templates/_default/rss.xml

index 12756e7810737acf67552a8c231a913bba8493fb..a4cdd2383a26da7e50725baa0f2b0b4f4fd7c823 100644 (file)
@@ -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 = . }}
 
 {{- /* 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 = . }}