From d18edef261f04f9a71ec5bd2807cbb29ca92f58c Mon Sep 17 00:00:00 2001 From: Eryn Wells Date: Sun, 24 Sep 2023 08:59:40 -0700 Subject: [PATCH] Add section.atom templates to blog and photos that are identical to the home feed --- layouts/blog/section.atom.atom | 29 +++++++++++++++++++++++++++++ layouts/photos/section.atom.atom | 29 +++++++++++++++++++++++++++++ 2 files changed, 58 insertions(+) create mode 100644 layouts/blog/section.atom.atom create mode 100644 layouts/photos/section.atom.atom diff --git a/layouts/blog/section.atom.atom b/layouts/blog/section.atom.atom new file mode 100644 index 0000000..191a04c --- /dev/null +++ b/layouts/blog/section.atom.atom @@ -0,0 +1,29 @@ +{{- $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 -}} +{{ printf "" | safeHTML }} + + {{ .Site.Title }} + + + + {{ if not .Date.IsZero }}{{ .Date.Format "2006-01-02T15:04:05-07:00" | safeHTML }}{{ end }} + {{ .Permalink }} + {{ with .Site.Author.name }} + + {{ . }} + {{ with $.Site.Author.email }}{{ . }}{{ end }} + {{ $.Site.Home.Permalink }} + + {{ end }} + Hugo {{ hugo.Version }} + © 2020-{{ now.Year }} Eryn Wells + {{ range $pages }}{{ .Render "atom_entry" }}{{ end }} + diff --git a/layouts/photos/section.atom.atom b/layouts/photos/section.atom.atom new file mode 100644 index 0000000..191a04c --- /dev/null +++ b/layouts/photos/section.atom.atom @@ -0,0 +1,29 @@ +{{- $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 -}} +{{ printf "" | safeHTML }} + + {{ .Site.Title }} + + + + {{ if not .Date.IsZero }}{{ .Date.Format "2006-01-02T15:04:05-07:00" | safeHTML }}{{ end }} + {{ .Permalink }} + {{ with .Site.Author.name }} + + {{ . }} + {{ with $.Site.Author.email }}{{ . }}{{ end }} + {{ $.Site.Home.Permalink }} + + {{ end }} + Hugo {{ hugo.Version }} + © 2020-{{ now.Year }} Eryn Wells + {{ range $pages }}{{ .Render "atom_entry" }}{{ end }} +