Skip to content

Commit

Permalink
tpl/tplimpl: Fix deprecation logic in RSS template
Browse files Browse the repository at this point in the history
Closes #11639
  • Loading branch information
jmooring committed Oct 31, 2023
1 parent 47bf2fc commit 23fcfb7
Showing 1 changed file with 14 additions and 4 deletions.
18 changes: 14 additions & 4 deletions tpl/tplimpl/embedded/templates/_default/rss.xml
Original file line number Diff line number Diff line change
@@ -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 = . }}
Expand All @@ -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 = . }}
Expand Down

0 comments on commit 23fcfb7

Please sign in to comment.