From aac22d71648e9e204dd2e9a60877602b7e40a2f847b9fabfa23eb9c8c41e8055 Mon Sep 17 00:00:00 2001 From: Nicholas Johnson Date: Sun, 12 Mar 2023 00:00:00 +0000 Subject: Fix Gemini entry indexing logic --- layouts/term/term.gmi | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-) (limited to 'layouts/term') diff --git a/layouts/term/term.gmi b/layouts/term/term.gmi index 4beb9ea..d4c0d7d 100644 --- a/layouts/term/term.gmi +++ b/layouts/term/term.gmi @@ -7,13 +7,11 @@ => {{ .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" . }} +{{ $entriesMinusOne := sub (len .Data.Pages) 1 -}} +{{ range first $entriesMinusOne .Data.Pages.ByPublishDate.Reverse -}} +{{ partial "metadata.gmi" . }} +{{ end -}} +{{ range last 1 .Data.Pages.ByPublishDate.Reverse -}} +{{ partial "metadata.gmi" . -}} +{{ end -}} {{ end }} -{{- if gt (len .Data.Pages) 1 }} - -{{- range last 1 .Data.Pages.ByPublishDate.Reverse }} -{{- partial "metadata.gmi" . }}{{ end }} -{{- end }} -{{- end }} -- cgit v1.2.3