summaryrefslogtreecommitdiff
path: root/layouts/index.atom.xml
diff options
context:
space:
mode:
authorNicholas Johnson <nick@nicksphere.ch>2022-04-28 00:00:00 +0000
committerNicholas Johnson <nick@nicksphere.ch>2022-04-28 00:00:00 +0000
commitb1efd00585f84abc397a040852b67c31d36d177d44367a7581afd3e4389b6fd2 (patch)
tree20ff16d4b8db72a0f387faf722fc1534440678d8cd6663111ec052bde04718d4 /layouts/index.atom.xml
downloadhugo-theme-journal-b1efd00585f84abc397a040852b67c31d36d177d44367a7581afd3e4389b6fd2.tar.gz
hugo-theme-journal-b1efd00585f84abc397a040852b67c31d36d177d44367a7581afd3e4389b6fd2.zip
Initial commit
Diffstat (limited to 'layouts/index.atom.xml')
-rw-r--r--layouts/index.atom.xml33
1 files changed, 33 insertions, 0 deletions
diff --git a/layouts/index.atom.xml b/layouts/index.atom.xml
new file mode 100644
index 0000000..7cb8ae6
--- /dev/null
+++ b/layouts/index.atom.xml
@@ -0,0 +1,33 @@
+{{ $pctx := . }}
+{{- if .IsHome }}{{ $pctx = .Site }}{{ end }}
+{{- $pages := slice }}
+{{- if or $.IsHome $.IsSection }}
+{{- $pages = $pctx.RegularPages }}
+{{- else }}
+{{- $pages = $pctx.Pages }}
+{{- end }}
+{{- $limit := .Site.Config.Services.RSS.Limit }}
+{{- if ge $limit 1 }}
+{{- $pages = $pages | first $limit }}
+{{- end -}}
+<feed xmlns="http://www.w3.org/2005/Atom">
+ <title>{{ if eq .Title .Site.Title }}{{ .Site.Title }}{{ else }}{{ with .Title }}{{ . }} on {{ end }}{{ .Site.Title }}{{ end }}</title>
+ <link href="{{ .Permalink }}atom.xml" rel="self"/>
+ <link href="{{ .Permalink }}"/>{{ if not .Date.IsZero }}
+ <updated>{{ .Date.Format "2006-01-02T15:04:05-07:00" | safeHTML }}</updated>{{ end }}
+ <id>{{ .Permalink }}</id>
+ <author>
+ <name>{{ $.Site.Author.name }}</name>
+ <email>{{ $.Site.Author.email }}</email>
+ </author>
+ <generator>Hugo -- gohugo.io</generator>{{ range $pages }}
+ <entry>
+ {{ `<title type="html"><![CDATA[` | safeHTML }}{{ .Title }}]]></title>
+ <link href="{{ .Permalink }}"/>
+ <id>{{ .Permalink }}</id>
+ <updated>{{ .Date.Format "2006-01-02T15:04:05-07:00" | safeHTML }}</updated>
+ {{- if .Content }}
+ {{ `<content type="html"><![CDATA[` | safeHTML }}{{ .Content }}]]></content>
+ {{- end }}
+ </entry>{{ end }}
+</feed>