Debian Codegraph @

docs/layouts/list.rss.xml

raw
1 {{- printf "<?xml version=\"1.0\" encoding=\"utf-8\" standalone=\"yes\"?>" | safeHTML }}
2 <rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
3 <channel>
4 <title>Hugo News</title>
5 <description>Recent news about Hugo, a static site generator written in Go, optimized for speed and designed for flexibility.</description>
6 <link>{{ .Permalink }}</link>
7 <generator>Hugo {{ hugo.Version }}</generator>
8 <language>{{ site.Language.Locale }}</language>
9 {{- with site.Copyright }}
10 <copyright>{{ . }}</copyright>
11 {{- end }}
12 {{- with .OutputFormats.Get "rss" }}
13 {{ printf "<atom:link href=%q rel=\"self\" type=%q />" .Permalink .MediaType | safeHTML }}
14 {{- end }}
15 {{- $limit := cond (gt site.Config.Services.RSS.Limit 0) site.Config.Services.RSS.Limit 999 }}
16 {{- $pages := "" }}
17 {{- with site.GetPage "/news" }}
18 {{- $pages = .Pages.ByPublishDate.Reverse | first $limit }}
19 {{- else }}
20 {{- errorf "The list.rss.xml layout was unable to find the 'news' page." }}
21 {{- end }}
22 <lastBuildDate>{{ (index $pages 0).PublishDate.Format "Mon, 02 Jan 2006 15:04:05 -0700" | safeHTML }}</lastBuildDate>
23 {{- range $pages }}
24 <item>
25 <title>{{ .Title }}</title>
26 <link>{{ or .Params.permalink .Permalink }}</link>
27 <pubDate>{{ .PublishDate.Format "Mon, 02 Jan 2006 15:04:05 -0700" | safeHTML }}</pubDate>
28 <guid>{{ or .Params.permalink .Permalink }}</guid>
29 <description>{{ .Summary | transform.XMLEscape | safeHTML }}</description>
30 </item>
31 {{- end }}
32 </channel>
33 </rss>