From f2e20f0fab361964ba674f437fc6d490ae05009b Mon Sep 17 00:00:00 2001 From: razonyang Date: Thu, 8 Sep 2022 01:34:39 +0800 Subject: [PATCH] chore(rss): beautify the description format via CDATA --- layouts/partials/rss.html | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/layouts/partials/rss.html b/layouts/partials/rss.html index 79e94235f..2a767943e 100644 --- a/layouts/partials/rss.html +++ b/layouts/partials/rss.html @@ -34,7 +34,13 @@ {{ .Date.Format "Mon, 02 Jan 2006 15:04:05 -0700" | safeHTML }} {{ with .Site.Author.email }}{{.}}{{ with $.Site.Author.name }} ({{.}}){{end}}{{end}} {{ .Permalink }} - {{ if default false $.Site.Params.feeds.contentAsDescription }}{{ .Content | html }}{{ else }}{{ .Summary | html }}{{ end }} + + {{- if default false $.Site.Params.feeds.contentAsDescription }} + {{- printf "" .Content | safeHTML }} + {{- else }} + {{- printf "" .Summary | safeHTML }} + {{- end }} + {{- partial "rss/enclosure" . }} {{ end }}