diff options
author | Nicholas Johnson <nick@nicholasjohnson.ch> | 2023-03-12 00:00:00 +0000 |
---|---|---|
committer | Nicholas Johnson <nick@nicholasjohnson.ch> | 2023-03-12 00:00:00 +0000 |
commit | aac22d71648e9e204dd2e9a60877602b7e40a2f847b9fabfa23eb9c8c41e8055 (patch) | |
tree | aa9bf0744825c88546697121f23e6819c6cf76d4e50f19b69c29f825ef8fd7a2 | |
parent | 2cc237aa5124d6168f54ea7c85ace3b75c02ffcbbd83beeaec455a0908b90a6b (diff) | |
download | hugo-theme-journal-aac22d71648e9e204dd2e9a60877602b7e40a2f847b9fabfa23eb9c8c41e8055.tar.gz hugo-theme-journal-aac22d71648e9e204dd2e9a60877602b7e40a2f847b9fabfa23eb9c8c41e8055.zip |
Fix Gemini entry indexing logicv0.4.2
-rw-r--r-- | layouts/index.gmi | 17 | ||||
-rw-r--r-- | layouts/term/term.gmi | 16 |
2 files changed, 15 insertions, 18 deletions
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 }} 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 }} |