Skip to content

Commit 23fcfb7

Browse files
authored
tpl/tplimpl: Fix deprecation logic in RSS template
Closes #11639
1 parent 47bf2fc commit 23fcfb7

1 file changed

Lines changed: 14 additions & 4 deletions

File tree

  • tpl/tplimpl/embedded/templates/_default

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

Lines changed: 14 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,11 @@
11
{{- /* Deprecate site.Author.email in favor of site.Params.author.email */}}
22
{{- $authorEmail := "" }}
3-
{{- with site.Params.author.email }}
4-
{{- $authorEmail = . }}
3+
{{- with site.Params.author }}
4+
{{- if reflect.IsMap . }}
5+
{{- with .email }}
6+
{{- $authorEmail = . }}
7+
{{- end }}
8+
{{- end }}
59
{{- else }}
610
{{- with site.Author.email }}
711
{{- $authorEmail = . }}
@@ -11,8 +15,14 @@
1115

1216
{{- /* Deprecate site.Author.name in favor of site.Params.author.name */}}
1317
{{- $authorName := "" }}
14-
{{- with site.Params.author.name }}
15-
{{- $authorName = . }}
18+
{{- with site.Params.author }}
19+
{{- if reflect.IsMap . }}
20+
{{- with .name }}
21+
{{- $authorName = . }}
22+
{{- end }}
23+
{{- else }}
24+
{{- $authorName = . }}
25+
{{- end }}
1626
{{- else }}
1727
{{- with site.Author.name }}
1828
{{- $authorName = . }}

0 commit comments

Comments
 (0)