add full encoded content to the rss feeds for the blog

This commit is contained in:
Greg Gauthier 2022-01-03 21:57:51 +00:00
parent dd506baf76
commit 902b9d144f
3 changed files with 23 additions and 3 deletions

View File

@ -11,7 +11,7 @@
{{- $pages = $pages | first $limit -}}
{{- end -}}
{{- printf "<?xml version=\"1.0\" encoding=\"utf-8\" standalone=\"yes\"?>" | safeHTML }}
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:content="http://purl.org/rss/1.0/modules/content/">
<channel>
<title>{{ if eq .Title .Site.Title }}{{ .Site.Title }}{{ else }}{{ with .Title }}{{.}} on {{ end }}{{ .Site.Title }}{{ end }}</title>
<link>{{ .Permalink }}</link>
@ -56,6 +56,17 @@
{{ .Summary | safeHTML }}
]]>
</description>
<content:encoded>
{{`<![CDATA[ ` | safeHTML }}
{{ if isset .Params "image" }}
{{ $cdnUrl := .Site.Params.blogCdnUrl }}
<p><img src="{{ $cdnUrl }}{{ with .Params.image }}{{.}}{{ end }}"/></p>
{{end}}
{{ .Content | safeHTML }}
]]>
</content:encoded>
</item>
{{ end }}
</channel>

View File

@ -11,7 +11,7 @@
{{- $pages = $pages | first $limit -}}
{{- end -}}
{{- printf "<?xml version=\"1.0\" encoding=\"utf-8\" standalone=\"yes\"?>" | safeHTML }}
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:content="http://purl.org/rss/1.0/modules/content/">
<channel>
<title>{{ if eq .Title .Site.Title }}{{ .Site.Title }}{{ else }}{{ with .Title }}{{.}} on {{ end }}{{ .Site.Title }}{{ end }}</title>
<link>{{ .Permalink }}</link>

View File

@ -11,7 +11,7 @@
{{- $pages = $pages | first $limit -}}
{{- end -}}
{{- printf "<?xml version=\"1.0\" encoding=\"utf-8\" standalone=\"yes\"?>" | safeHTML }}
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:content="http://purl.org/rss/1.0/modules/content/">
<channel>
<title>{{ if eq .Title .Site.Title }}{{ .Site.Title }}{{ else }}{{ with .Title }}{{.}} on {{ end }}{{ .Site.Title }}{{ end }}</title>
<link>{{ .Permalink }}</link>
@ -53,6 +53,15 @@
{{ .Summary | safeHTML }}
]]>
</description>
<content:encoded>
{{`<![CDATA[ ` | safeHTML }}
{{ if isset .Params "image" }}
{{ $cdnUrl := .Site.Params.blogCdnUrl }}
<p><img src="{{ $cdnUrl }}{{ with .Params.image }}{{.}}{{ end }}"/></p>
{{end}}
{{ .Content | safeHTML }}
]]>
</content:encoded>
</item>
{{ end }}
</channel>