rss.xml (2061B)
1 {{- $pctx := . -}} 2 {{- if .IsHome -}}{{ $pctx = .Site }}{{- end -}} 3 {{- $pages := slice -}} 4 {{- if or $.IsHome $.IsSection -}} 5 {{- $pages = $pctx.RegularPages -}} 6 {{- else -}} 7 {{- $pages = $pctx.Pages -}} 8 {{- end -}} 9 {{- $limit := .Site.Config.Services.RSS.Limit -}} 10 {{- if ge $limit 1 -}} 11 {{- $pages = $pages | first $limit -}} 12 {{- end -}} 13 {{- printf "<?xml version=\"1.0\" encoding=\"utf-8\" standalone=\"yes\"?>" | safeHTML }} 14 {{printf "<?xml-stylesheet href=\"/css/pretty-feed-v3.xsl\" type=\"text/xsl\"?>" | safeHTML }} 15 <rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"> 16 <channel> 17 <title>{{ if eq .Title .Site.Title }}{{ .Site.Title }}{{ else }}{{ with .Title }}{{.}} on {{ end }}{{ .Site.Title }}{{ end }}</title> 18 <link>{{ .Permalink }}</link> 19 <description>Recent content {{ if ne .Title .Site.Title }}{{ with .Title }}in {{.}} {{ end }}{{ end }}on {{ .Site.Title }}</description> 20 <generator>Hugo -- gohugo.io</generator>{{ with .Site.LanguageCode }} 21 <language>{{.}}</language>{{end}}{{ with .Site.Author.email }} 22 <managingEditor>{{.}}{{ with $.Site.Author.name }} ({{.}}){{end}}</managingEditor>{{end}}{{ with .Site.Author.email }} 23 <webMaster>{{.}}{{ with $.Site.Author.name }} ({{.}}){{end}}</webMaster>{{end}}{{ with .Site.Copyright }} 24 <copyright>booooo {{.}}</copyright>{{end}}{{ if not .Date.IsZero }} 25 <lastBuildDate>{{ .Date.Format "Mon, 02 Jan 2006 15:04:05 -0700" | safeHTML }}</lastBuildDate>{{ end }} 26 {{- with .OutputFormats.Get "RSS" -}} 27 {{ printf "<atom:link href=%q rel=\"self\" type=%q />" .Permalink .MediaType | safeHTML }} 28 {{- end -}} 29 {{ range $pages }} 30 <item> 31 <title>{{ .Title }}</title> 32 <link>{{ .Permalink }}</link> 33 <pubDate>{{ .Date.Format "Mon, 02 Jan 2006 15:04:05 -0700" | safeHTML }}</pubDate> 34 {{ with .Site.Author.email }}<author>{{.}}{{ with $.Site.Author.name }} ({{.}}){{end}}</author>{{end}} 35 <guid>{{ .Permalink }}</guid> 36 <description>{{ .Content | html }}</description> 37 </item> 38 {{ end }} 39 </channel> 40 </rss>