home.rss.xml (1314B)
1 {{- $authorName := site.Params.author.name }} 2 {{- $pages := where site.RegularPages "Params.norss" "ne" true }} 3 {{- printf "<?xml version=\"1.0\" encoding=\"utf-8\" standalone=\"yes\"?>" | safeHTML }} 4 <rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"> 5 <channel> 6 <title>{{ .Site.Title }}</title> 7 <link>{{ .Permalink }}</link> 8 <description>Recent content on {{ .Site.Title }}</description> 9 <generator>Hugo</generator> 10 <language>{{ site.Language.LanguageCode }}</language> 11 <managingEditor>{{ $authorName }}</managingEditor> 12 <webMaster>{{ $authorName }}</webMaster> 13 <lastBuildDate>{{ (index $pages.ByLastmod.Reverse 0).Lastmod.Format "Mon, 02 Jan 2006 15:04:05 -0700" | safeHTML }}</lastBuildDate> 14 {{- with .OutputFormats.Get "RSS" }} 15 {{ printf "<atom:link href=%q rel=\"self\" type=%q />" .Permalink .MediaType | safeHTML }} 16 {{- end }} 17 {{- range $pages }} 18 <item> 19 <title>{{ .Title }}</title> 20 <link>{{ .Permalink }}</link> 21 <pubDate>{{ .PublishDate.Format "Mon, 02 Jan 2006 15:04:05 -0700" | safeHTML }}</pubDate> 22 <author>{{ with $authorName }}{{ . }}{{ end }}</author> 23 <guid>{{ .Permalink }}</guid> 24 <description>{{ .Summary | transform.XMLEscape | safeHTML }}</description> 25 </item> 26 {{- end }} 27 </channel> 28 </rss>