Skip to content

Commit 3f66bea

Browse files
Merge pull request #48 from mastodon/add-full-feeds
Add full posts to RSS feeds and clean up template.
2 parents abf1912 + 59edad1 commit 3f66bea

File tree

2 files changed

+9
-11
lines changed

2 files changed

+9
-11
lines changed

config.toml

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,10 @@ theme = "mastodon"
2424
weight = 3
2525

2626
[outputs]
27-
home = ["HTML", "RSS"]
28-
page = ["HTML"]
27+
home = ['html', 'rss']
28+
page = ['html']
29+
section = ['html', 'rss']
30+
taxonomy = ['html', 'rss']
2931

3032
[build]
3133
writeStats = true

themes/mastodon/layouts/_default/rss.xml

Lines changed: 5 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -4,23 +4,19 @@
44
<title>{{ if eq .Title .Site.Title }}{{ .Site.Title }}{{ else }}{{ with .Title }}{{.}} on {{ end }}{{ .Site.Title }}{{ end }}</title>
55
<link>{{ .Permalink }}</link>
66
<description>Recent content {{ if ne .Title .Site.Title }}{{ with .Title }}in {{.}} {{ end }}{{ end }}on {{ .Site.Title }}</description>
7-
<generator>Hugo -- gohugo.io</generator>{{ with .Site.LanguageCode }}
8-
<language>{{.}}</language>{{end}}{{ with .Site.Author.email }}
9-
<managingEditor>{{.}}{{ with $.Site.Author.name }} ({{.}}){{end}}</managingEditor>{{end}}{{ with .Site.Author.email }}
10-
<webMaster>{{.}}{{ with $.Site.Author.name }} ({{.}}){{end}}</webMaster>{{end}}{{ with .Site.Copyright }}
11-
<copyright>{{.}}</copyright>{{end}}{{ if not .Date.IsZero }}
7+
<generator>Hugo</generator>{{ with .Site.LanguageCode }}
8+
<language>{{.}}</language>{{end}}{{ if not .Date.IsZero }}
129
<lastBuildDate>{{ .Date.Format "Mon, 02 Jan 2006 15:04:05 -0700" | safeHTML }}</lastBuildDate>{{ end }}
1310
{{ with .OutputFormats.Get "RSS" }}
1411
{{ printf "<atom:link href=%q rel=\"self\" type=%q />" .Permalink .MediaType | safeHTML }}
1512
{{ end }}
1613
{{ range .Site.RegularPages }}
1714
<item>
18-
<title>{{ .Title }}</title>
15+
<title>{{ .Title | transform.XMLEscape | safeHTML }}</title>
1916
<link>{{ .Permalink }}</link>
20-
<pubDate>{{ .Date.Format "Mon, 02 Jan 2006 15:04:05 -0700" | safeHTML }}</pubDate>
21-
{{ with .Site.Author.email }}<author>{{.}}{{ with $.Site.Author.name }} ({{.}}){{end}}</author>{{end}}
17+
<pubDate>{{ .PublishDate.Format "Mon, 02 Jan 2006 15:04:05 -0700" | safeHTML }}</pubDate>
2218
<guid>{{ .Permalink }}</guid>
23-
<description>{{ .Summary | html }}</description>
19+
<description>{{ .Content | transform.XMLEscape | safeHTML }}</description>
2420
</item>
2521
{{ end }}
2622
</channel>

0 commit comments

Comments
 (0)