diff options
| author | Nicholas Johnson <> | 2026-09-20 00:00:00 +0000 |
|---|---|---|
| committer | Nicholas Johnson <> | 2026-09-20 00:00:00 +0000 |
| commit | b2e2ebef4f5f304884cbf86e73a000d6ee2d0a32a421e5aa55662a2255f7e364 (patch) | |
| tree | d729ba0baebcfd9f1ea0969285586cc6f2ffebd45650512c61a9a4e8a81d0587 | |
| parent | 9f3a9875caaded223901896f5302731d825cc0e77b54b45c2eab670f6e226b40 (diff) | |
| download | hugo-theme-journal-b2e2ebef4f5f304884cbf86e73a000d6ee2d0a32a421e5aa55662a2255f7e364.tar.gz hugo-theme-journal-b2e2ebef4f5f304884cbf86e73a000d6ee2d0a32a421e5aa55662a2255f7e364.zip | |
Link the homepage feed from the homepage
The homepage was the one listing page with a feed but no link to it, so
a reader could only find it through the autodiscovery element in the
document head, which the capsule has no equivalent of. Sites worked
around this by adding the feed to the navigation links by hand.
Add a feeds section to both homepage templates, modelled on the one the
taxonomy, term and section templates carry, and place it below the
navigation links and above the entry list. As on those pages, it is
rendered only when the home kind lists the Atom output format, so a
site that omits the format gains nothing to link.
The example site's homepage gains the section in both output formats
and is otherwise byte-identical, as are the pages of every other kind.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
| -rw-r--r-- | CHANGELOG.md | 1 | ||||
| -rw-r--r-- | layouts/home.gmi | 9 | ||||
| -rw-r--r-- | layouts/home.html | 4 |
3 files changed, 14 insertions, 0 deletions
diff --git a/CHANGELOG.md b/CHANGELOG.md index 551d2b3..2fe319c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -18,6 +18,7 @@ - Add example site with annotated configuration for website and capsule - Add section templates, which no output format previously had - Add Atom feeds for sections, in both output formats +- Add a feed link to the homepage, as the other listing pages have - Add Atom feed autodiscovery links to document head - Support more than one audio version per entry diff --git a/layouts/home.gmi b/layouts/home.gmi index 0a056f7..619a5f8 100644 --- a/layouts/home.gmi +++ b/layouts/home.gmi @@ -13,6 +13,15 @@ {{ end -}} +{{ with .OutputFormats.Get "Gemini_Atom" }} + + +## {{ i18n "feeds" }} + +=> {{ .RelPermalink }} {{ emojify ":link:" }} {{ i18n "atomFeed" -}} + +{{ end -}} + {{ with (where .Site.RegularPages "Section" "entry").ByPublishDate.Reverse }} diff --git a/layouts/home.html b/layouts/home.html index b3dcdd0..5a8368b 100644 --- a/layouts/home.html +++ b/layouts/home.html @@ -12,6 +12,10 @@ </ul> </nav> {{ end }} + {{ with .OutputFormats.Get "Atom" }} + <h2>{{ i18n "feeds" }}</h2> + <p>{{ emojify ":link:" }} <a class="link link--internal" href="{{ .RelPermalink }}" rel="noreferrer">{{ i18n "atomFeed" }}</a></p> + {{ end }} {{ with (where .Site.RegularPages "Section" "entry").ByPublishDate.Reverse }} <h2>{{ i18n "journalEntries" }}</h2> {{ range . }} |
