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/index.gmi | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) (limited to 'layouts/index.gmi') diff --git a/layouts/index.gmi b/layouts/index.gmi index e629fe7..ab4fdb4 100644 --- a/layouts/index.gmi +++ b/layouts/index.gmi @@ -7,12 +7,11 @@ => {{ .URL }} {{ emojify ":link:" | safeHTML }} {{ .Name | safeHTML }} {{ end }} ## Journal Entries -{{ $entriesMinusOne := sub (len (where .Site.RegularPages.ByTitle "Section" "entry").ByPublishDate.Reverse) 1 }} -{{- range first $entriesMinusOne (where .Site.RegularPages.ByTitle "Section" "entry").ByPublishDate.Reverse }} -{{- partial "metadata.gmi" . }} -{{ end }}{{- if gt (len .Data.Pages) 1 }} - -{{- range last 1 (where .Site.RegularPages.ByTitle "Section" "entry").ByPublishDate.Reverse }} -{{- partial "metadata.gmi" . }}{{ end }} -{{- end }} -{{- end }} +{{ $entriesMinusOne := sub (len (where .Site.RegularPages.ByTitle "Section" "entry")) 1 -}} +{{ range first $entriesMinusOne (where .Site.RegularPages.ByTitle "Section" "entry").ByPublishDate.Reverse -}} +{{ partial "metadata.gmi" . }} +{{ end -}} +{{ range last 1 (where .Site.RegularPages.ByTitle "Section" "entry").ByPublishDate.Reverse -}} +{{ partial "metadata.gmi" . -}} +{{ end -}} +{{ end }} -- cgit v1.2.3