Skip to content

Commit e70d2c2

Browse files
fix: Rendering errors in RSS feed (#155)
Resolves #154 --------- Co-authored-by: Lennart Rommeiss <[email protected]>
1 parent 66a0820 commit e70d2c2

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

layouts/_default/rss.xml

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,17 @@
44
<title>{{ .Site.Title }}</title>
55
<link>{{ .Site.BaseURL }}</link>
66
<description>{{ .Site.Params.description }}</description>
7+
<language>{{ site.Language.LanguageCode }}</language>
8+
<image>{{ (resources.Get "images/logo.svg").Permalink }}</image>
79
{{ range where .Site.RegularPages "Section" "news" }}
810
<item>
911
<title>{{ .Title }}</title>
1012
<link>{{ .Permalink }}</link>
11-
<description>{{ .Summary | plainify }}</description>
12-
<pubDate>{{ .Date.Format "Mon, 02 Jan 2006 15:04:05 MST" }}</pubDate>
13+
<!-- Remove the icons and XML escape the summary -->
14+
{{ $cleanedHTML := .Summary | replaceRE `<span[^>]*class="material-symbols-rounded"[^>]*>.*?</span>` "" | transform.XMLEscape | safeHTML}}
15+
<description>{{ $cleanedHTML }}</description>
16+
<pubDate>{{ .PublishDate.Format "Mon, 02 Jan 2006 15:04:05 -0700" | safeHTML }}</pubDate>
17+
<enclosure url="{{ (partial "helper/contentImage" . ).Permalink }}" />
1318
</item>
1419
{{ end }}
1520
</channel>

0 commit comments

Comments
 (0)