diff options
| author | Nicholas Johnson <> | 2026-09-18 00:00:00 +0000 |
|---|---|---|
| committer | Nicholas Johnson <> | 2026-09-19 16:06:44 -0400 |
| commit | e1bcf44b88116494b3f720570d2bf822c5f4c82ecef13954df9645abed963bcc (patch) | |
| tree | 722e3cdeab0bab36eb2c45548bd1bcb79f02084121f6e9855f85c71356b9caca /layouts/taxonomy.atom.xml | |
| parent | 17c300ebd76f9f849fcde61cbdf2049a0a52d75b1139d7ad8d8666a6a0b00f17 (diff) | |
| download | hugo-theme-journal-e1bcf44b88116494b3f720570d2bf822c5f4c82ecef13954df9645abed963bcc.tar.gz hugo-theme-journal-e1bcf44b88116494b3f720570d2bf822c5f4c82ecef13954df9645abed963bcc.zip | |
Order feeds by publish date rather than date
Every listing in the theme is built from .PublishDate, but the feeds
timestamped entries with .Date and left them in Hugo's default order.
An entry that set both front matter keys was therefore advertised to
readers with a different date, and potentially in a different order,
than it appeared in on the site.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Diffstat (limited to 'layouts/taxonomy.atom.xml')
| -rw-r--r-- | layouts/taxonomy.atom.xml | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/layouts/taxonomy.atom.xml b/layouts/taxonomy.atom.xml index 88f56ef..601888f 100644 --- a/layouts/taxonomy.atom.xml +++ b/layouts/taxonomy.atom.xml @@ -21,7 +21,7 @@ {{- end }} {{- end -}} -{{- $pages := .Data.Pages }} +{{- $pages := .Data.Pages.ByPublishDate.Reverse }} {{- $limit := .Site.Config.Services.RSS.Limit }} {{- if ge $limit 1 }} {{- $pages = first $limit $pages }} @@ -30,7 +30,7 @@ <feed xmlns="http://www.w3.org/2005/Atom"> <id>{{ .Permalink }}</id> <title>{{ .Site.Title }}</title> - <updated>{{ .Date.Format "2006-01-02T15:04:05-0700" | safeHTML }}</updated> + <updated>{{ .PublishDate.Format "2006-01-02T15:04:05-0700" | safeHTML }}</updated> <link href="{{ .Permalink }}atom.xml" rel="self" /> <link href="{{ .Permalink }}" rel="alternate" /> <author> @@ -44,7 +44,7 @@ <entry> <id>{{ .Permalink }}</id> <title type="html">{{ .Title }}</title> - <updated>{{ .Date.Format "2006-01-02T15:04:05-0700" | safeHTML }}</updated> + <updated>{{ .PublishDate.Format "2006-01-02T15:04:05-0700" | safeHTML }}</updated> <link href="{{ .Permalink }}" /> <content type="html">{{ .Content | html }}</content> </entry>{{ end }} |
