From fde870a4c5e9692b15495c3de8228a45dbd5d4c960d01d32b87641a7e5465c99 Mon Sep 17 00:00:00 2001 From: Nicholas Johnson <> Date: Fri, 18 Sep 2026 00:00:00 +0000 Subject: Fix empty entry heading on sites without journal entries The "Journal Entries" heading was guarded by .Site.RegularPages while the list below it was filtered to the "entry" section. A site with pages but no entries rendered the heading with nothing under it. Guard on the filtered collection instead. This also drops the .ByTitle sort, which was immediately discarded by the .ByPublishDate.Reverse that followed it. Co-Authored-By: Claude Opus 5 --- layouts/home.gmi | 4 ++-- layouts/home.html | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/layouts/home.gmi b/layouts/home.gmi index 4ce3bf1..3668e45 100644 --- a/layouts/home.gmi +++ b/layouts/home.gmi @@ -13,11 +13,11 @@ {{ end -}} -{{ if .Site.RegularPages }} +{{ with (where .Site.RegularPages "Section" "entry").ByPublishDate.Reverse }} ## {{ i18n "journalEntries" -}} -{{ range (where .Site.RegularPages.ByTitle "Section" "entry").ByPublishDate.Reverse }} +{{ range . }} {{ partial "metadata.gmi" . -}} {{ end -}} diff --git a/layouts/home.html b/layouts/home.html index cdf2d01..3056518 100644 --- a/layouts/home.html +++ b/layouts/home.html @@ -12,9 +12,9 @@ {{ end -}} - {{ if .Site.RegularPages -}} + {{ with (where .Site.RegularPages "Section" "entry").ByPublishDate.Reverse -}}

{{ i18n "journalEntries" }}

- {{ range (where .Site.RegularPages.ByTitle "Section" "entry").ByPublishDate.Reverse -}} + {{ range . -}} {{ partial "metadata.html" . }} {{ end -}} {{ end -}} -- cgit v1.2.3