add cover image to rss

This commit is contained in:
Victor Ananyev 2023-12-29 13:36:50 +01:00
parent 66904cc4c2
commit bdaf17bc7c

View file

@ -73,8 +73,17 @@
{{- with $authorEmail }}<author>{{ . }}{{ with $authorName }} ({{ . }}){{ end }}</author>{{ end }}
<guid>{{ .Permalink }}</guid>
<description>{{ with .Description | html }}{{ . }}{{ else }}{{ .Summary | html }}{{ end -}}</description>
{{- if and site.Params.ShowFullTextinRSS .Content }}
<content:encoded>{{ (printf "<![CDATA[%s]]>" .Content) | safeHTML }}</content:encoded>
{{- $isCoverHidden := .Params.cover.hidden | default site.Params.cover.hiddenInSingle | default site.Params.cover.hidden }}
{{- $cover := (partial "cover.html" (dict "cxt" . "IsSingle" false "IsHome" false "isHidden" $isCoverHidden)) -}}
{{- if (or $cover (and site.Params.ShowFullTextinRSS .Content)) -}}
<content:encoded>
{{- if $cover -}}
{{ (printf "<![CDATA[%s]]>" $cover) | safeHTML }}
{{- end -}}
{{- if and site.Params.ShowFullTextinRSS .Content }}
{{ (printf "<![CDATA[%s]]>" .Content) | safeHTML }}
{{- end -}}
</content:encoded>
{{- end }}
</item>
{{- end }}