summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPatrick Spek <p.spek@tyil.nl>2023-03-14 17:30:14 +0100
committerPatrick Spek <p.spek@tyil.nl>2023-03-14 17:30:14 +0100
commit8c1aa52a84cfc2f1cfe19462b5048a7355c5728d (patch)
tree745432933bca384c4f9a6f888b4fd36898cc36bf
parent0b6247b8f70add13989ff036a718f5dcf1d63b7d (diff)
Add RSS feed for project releases
-rw-r--r--layouts/project-release/list.html2
-rw-r--r--layouts/project-release/list.xml27
2 files changed, 29 insertions, 0 deletions
diff --git a/layouts/project-release/list.html b/layouts/project-release/list.html
index d288169..b52dd0e 100644
--- a/layouts/project-release/list.html
+++ b/layouts/project-release/list.html
@@ -9,4 +9,6 @@
</li>
{{- end }}
</ul>
+<p>Follow the <a href="{{ .Permalink }}index.xml">RSS feed</a> to stay up to date with
+the latest {{ .Parent.Title }} releases.</p>
{{- end }}
diff --git a/layouts/project-release/list.xml b/layouts/project-release/list.xml
new file mode 100644
index 0000000..74cdda2
--- /dev/null
+++ b/layouts/project-release/list.xml
@@ -0,0 +1,27 @@
+{{- printf "<?xml version=\"1.0\" encoding=\"utf-8\" standalone=\"yes\"?>" | safeHTML }}
+<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
+ <channel>
+ <title>{{ .Title }}</title>
+ <link>{{ .Permalink }}</link>
+ <description>{{ .Title }} Releases</description>
+ <generator>Hugo -- gohugo.io</generator>{{ with .Site.LanguageCode }}
+ <language>{{.}}</language>{{end}}{{ with .Site.Author.email }}
+ <managingEditor>{{.}}{{ with $.Site.Author.name }} ({{.}}){{end}}</managingEditor>{{end}}{{ with .Site.Author.email }}
+ <webMaster>{{.}}{{ with $.Site.Author.name }} ({{.}}){{end}}</webMaster>{{end}}{{ with .Site.Copyright }}
+ <copyright>{{.}}</copyright>{{end}}{{ if not .Date.IsZero }}
+ <lastBuildDate>{{ .Date.Format "Mon, 02 Jan 2006 15:04:05 -0700" | safeHTML }}</lastBuildDate>{{ end }}
+ {{- with .OutputFormats.Get "RSS" -}}
+ {{ printf "<atom:link href=%q rel=\"self\" type=%q />" .Permalink .MediaType | safeHTML }}
+ {{- end -}}
+ {{ range .Pages }}
+ <item>
+ <title>{{ .Title }}</title>
+ <link>{{ .Permalink }}</link>
+ <pubDate>{{ .Date.Format "Mon, 02 Jan 2006 15:04:05 -0700" | safeHTML }}</pubDate>
+ {{ with .Site.Author.email }}<author>{{.}}{{ with $.Site.Author.name }} ({{.}}){{end}}</author>{{end}}
+ <guid>{{ .Permalink }}</guid>
+ <description>{{ .Content | html }}</description>
+ </item>
+ {{ end }}
+ </channel>
+</rss>