From dc89efa0d1ba80e8a7c61ddd2d0d4243cc82e52fb2c9104311b4ba5e2af81ff6 Mon Sep 17 00:00:00 2001 From: Nicholas Johnson Date: Fri, 24 Feb 2023 00:00:00 +0000 Subject: Implement term Atom feeds --- layouts/_default/term.gmi | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) (limited to 'layouts/_default/term.gmi') diff --git a/layouts/_default/term.gmi b/layouts/_default/term.gmi index 8c47843..4beb9ea 100644 --- a/layouts/_default/term.gmi +++ b/layouts/_default/term.gmi @@ -2,8 +2,18 @@ => / {{ emojify ":link:" | safeHTML }} Return to homepage -# All entries for {{ .Type | singularize | safeHTML }} "{{ .Title | safeHTML }}" -{{ range .Data.Pages }} -=> {{ .RelPermalink }} {{ emojify ":link:" | safeHTML }} {{ .Title | safeHTML }} +# {{ .Type | singularize | humanize | safeHTML }} "{{ .Title | safeHTML }}" +## Feeds +=> {{ .RelPermalink | replaceRE `(?m)index.gmi$` "atom.xml" | safeHTML }} {{ emojify ":link:" | safeHTML }} Atom Feed + +## Journal Entries +{{ $entriesMinusOne := sub (len (where .Site.RegularPages.ByTitle "Section" "entry").ByPublishDate.Reverse) 1 }} +{{- range first $entriesMinusOne .Data.Pages.ByPublishDate.Reverse }} +{{- partial "metadata.gmi" . }} +{{ end }} +{{- if gt (len .Data.Pages) 1 }} + +{{- range last 1 .Data.Pages.ByPublishDate.Reverse }} +{{- partial "metadata.gmi" . }}{{ end }} {{- end }} {{- end }} -- cgit v1.2.3