Skip to content

Commit e09d38c

Browse files
committed
feat(layouts): Add CDATA tag for description in RSS feed
1 parent 273da09 commit e09d38c

File tree

1 file changed

+10
-10
lines changed

1 file changed

+10
-10
lines changed

layouts/index.xml

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,17 @@
11
{{- $pctx := . -}}
2-
{{- if .IsHome -}}{{ $pctx = .Site }}{{- end -}}
3-
{{- $pages := slice -}}
4-
{{- $sectionsToInclude := (slice "blog" "workshops") -}}
5-
{{- $typesToInclude := (slice "student-talks" "hacking-hours") -}}
2+
{{- if .IsHome -}}{{ $pctx = .Site }}{{- end -}}
3+
{{- $pages := slice -}}
4+
{{- $sectionsToInclude := (slice "blog" "workshops") -}}
5+
{{- $typesToInclude := (slice "student-talks" "hacking-hours") -}}
66

7-
{{- range $pctx.RegularPages -}}
7+
{{- range $pctx.RegularPages -}}
88
{{- if and .Date (not .Date.IsZero) (or (in $sectionsToInclude .Section) (in $typesToInclude .Type)) (ne .Params.upcoming true) -}}
9-
{{- $pages = $pages | append . -}}
9+
{{- $pages = $pages | append . -}}
10+
{{- end -}}
1011
{{- end -}}
11-
{{- end -}}
1212

13-
{{- $limit := .Site.Config.Services.RSS.Limit | default 20 -}}
14-
{{- printf "<?xml version=\"1.0\" encoding=\"utf-8\" standalone=\"yes\"?>" | safeHTML }}
13+
{{- $limit := .Site.Config.Services.RSS.Limit | default 20 -}}
14+
{{- printf "<?xml version=\"1.0\" encoding=\"utf-8\" standalone=\"yes\"?>" | safeHTML }}
1515
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
1616
<channel>
1717
<title>{{ if eq .Title .Site.Title }}{{ .Site.Title }}{{ else }}{{ with .Title }}{{ . }} on {{ end }}{{ .Site.Title }}{{ end }}</title>
@@ -31,7 +31,7 @@
3131
<link>{{ .Permalink }}</link>
3232
<pubDate>{{ .Date.Format "Mon, 02 Jan 2006 15:04:05 -0700" | safeHTML }}</pubDate>
3333
<guid>{{ .Permalink }}</guid>
34-
<description>{{ .Description }}</description>
34+
<description><![CDATA[{{ .Description | plainify }}]]></description>
3535
</item>
3636
{{- end -}}
3737
</channel>

0 commit comments

Comments
 (0)