Override builtin RSS template to cleanup and add encoded content
This commit is contained in:
parent
ef6c17f3c0
commit
0a328b0ca2
1 changed files with 27 additions and 0 deletions
27
layouts/_default/rss.xml
Normal file
27
layouts/_default/rss.xml
Normal file
|
@ -0,0 +1,27 @@
|
|||
|
||||
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0">
|
||||
<channel>
|
||||
<title>{{ .Title }}</title>
|
||||
<link>{{ .Permalink }}</link>
|
||||
<description>Recent content in {{ .Title }}</description>
|
||||
<generator>Hugo -- gohugo.io</generator>
|
||||
<language>{{ .Site.LanguageCode }}</language>
|
||||
<copyright>{{ partial "copyright.html" . | html }}</copyright>
|
||||
<managingEditor>{{ .Site.Params.author }}</managingEditor>
|
||||
<webMaster>{{ .Site.Params.author }}</webMaster>
|
||||
<lastBuildDate>{{ now.Format "Mon, 02 Jan 2006 15:04:05 -0700" | safeHTML }}</lastBuildDate>
|
||||
{{ with .OutputFormats.Get "RSS" }}
|
||||
{{ printf "<atom:link href=%q rel=\"self\" type=%q />" .Permalink .MediaType | safeHTML }}
|
||||
{{ end }}
|
||||
{{ range .Data.Pages }}
|
||||
<item>
|
||||
<title>{{ .Title }}</title>
|
||||
<link>{{ .Permalink }}</link>
|
||||
<pubDate>{{ .Date.Format "Mon, 02 Jan 2006 15:04:05 -0700" | safeHTML }}</pubDate>
|
||||
<guid>{{ .Permalink }}</guid>
|
||||
<atom:updated>{{ .Date.Format .Site.Params.iso8601 }}</atom:updated>
|
||||
<content:encoded>{{ printf "<![CDATA[%s]]>" (replace .Content "\n" "") | safeHTML }}</content:encoded>
|
||||
</item>
|
||||
{{ end }}
|
||||
</channel>
|
||||
</rss>
|
Loading…
Reference in a new issue