Debian Codegraph @

website/layouts/changes/list.rss.xml

raw
1 <!-- Copy of Docsy's layout, but
2 - without a special case for first-level lists that would only include regular pages
3 - using the actual section title, not title-casing the section name
4 - not including a featured image
5 - not including a zero pubDate
6 - not incorrectly using safeHTML in dates
7 - formatting the template in a readable way; we don't care about some empty lines in the XML
8 -->
9
10 <rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
11 <channel>
12 <title>{{ .Site.Title }} – {{ .Title }}</title>
13 <link>{{ .Permalink }}</link>
14 <description>Recent content {{ if ne .Title .Site.Title }}{{ with .Title }}in {{.}} {{ end }}{{ end }}on {{ .Site.Title }}</description>
15 <generator>Hugo -- gohugo.io</generator>
16 {{ with .Site.LanguageCode }}
17 <language>{{.}}</language>
18 {{end}}
19 {{ with .Site.Author.email }}
20 <managingEditor>{{.}}{{ with $.Site.Author.name }} ({{.}}){{end}}</managingEditor>
21 {{end}}
22 {{ with .Site.Author.email }}
23 <webMaster>{{.}}{{ with $.Site.Author.name }} ({{.}}){{end}}</webMaster>
24 {{end}}
25 {{ with .Site.Copyright }}
26 <copyright>{{.}}</copyright>
27 {{end}}
28 {{ if not .Date.IsZero }}
29 <lastBuildDate>{{ .Date.Format "Mon, 02 Jan 2006 15:04:05 -0700" | safeHTML }}</lastBuildDate>
30 {{ end }}
31 {{ with .OutputFormats.Get "RSS" }}
32 {{ printf "<atom:link href=%q rel=\"self\" type=%q />" .Permalink .MediaType | safeHTML }}
33 {{ end }}
34
35 {{ if not $.Section }}
36 {{ $sections := .Site.Params.rss_sections | default (slice "blog") }}
37 {{ .Scratch.Set "rss_pages" (first 50 (where $.Site.RegularPages "Type" "in" $sections )) }}
38 {{ else }}
39 {{ .Scratch.Set "rss_pages" (first 50 $.Pages) }}
40 {{ end }}
41 {{ range (.Scratch.Get "rss_pages") }}
42 <item>
43 <title>{{ $.Page.Title }}: {{ .Title }}</title>
44 <link>{{ .Permalink }}</link>
45 {{ if not .Date.IsZero }}
46 <pubDate>{{ .Date.Format "Mon, 02 Jan 2006 15:04:05 -0700" }}</pubDate>
47 {{ end }}
48 {{ with .Site.Author.email }}
49 <author>{{.}}{{ with $.Site.Author.name }} ({{.}}){{end}}</author>
50 {{end}}
51 <guid>{{ .Permalink }}</guid>
52 <description>
53 {{ .Content | html }}
54 </description>
55 </item>
56 {{ end }}
57 </channel>
58 </rss>