Finish RSS and Atom implementations

This commit is contained in:
Eryn Wells 2024-10-20 09:12:07 -07:00
parent d971696e11
commit 256eae44e9
9 changed files with 118 additions and 0 deletions

View file

@ -0,0 +1,26 @@
{{- $context := .context -}}
{{- $pages := .pages -}}
{{- $limit := .limit -}}
{{ printf "<?xml version=\"1.0\" encoding=\"utf-8\" standalone=\"yes\"?>" | safeHTML }}
<feed xmlns="http://www.w3.org/2005/Atom">
<title>{{ $context.Site.Title }}</title>
<link href="{{ $context.Permalink }}" />
<link href="{{ `/feed.atom` | absURL }}" rel="self" />
<link href="{{ `/icons/favicon.png` | absURL }}" rel="shortcut icon" />
{{ with $context.Date }}
<updated>{{ . | time.Format "2006-01-02T15:04:05-07:00" | safeHTML }}</updated>
{{ end }}
<id>{{ $context.Permalink }}</id>
{{ with $context.Site.Author }}
<author>
{{ with .name }}<name>{{ . }}</name>{{ end }}
{{ with .email }}<email>{{ . }}</email>{{ end }}
<uri>{{ $context.Site.Home.Permalink }}</uri>
</author>
{{ end }}
<generator version="{{ hugo.Version }}" uri="https://gohugo.io">Hugo {{ hugo.Version }}</generator>
<rights>© 2020-{{ now.Year }} Eryn Wells</rights>
{{ range $pages }}
{{ .Render "atom_entry" }}
{{ end }}
</feed>