diff options
| author | Nicholas Johnson <> | 2026-09-18 00:00:00 +0000 |
|---|---|---|
| committer | Nicholas Johnson <> | 2026-09-19 16:06:40 -0400 |
| commit | 0dc2dc8ad469797ce87fdeceae6af63a11ba996718dd335ecb0633a50577d627 (patch) | |
| tree | 787639c2e521ea34818a58b25f206493c7ec037de938d085d371a38191626557 /layouts/taxonomy.atom.xml | |
| parent | 7a51b9a97b2d618e6b006f1a3b6a0ebd4acd51888af95e670662cf5655fffb3a (diff) | |
| download | hugo-theme-journal-0dc2dc8ad469797ce87fdeceae6af63a11ba996718dd335ecb0633a50577d627.tar.gz hugo-theme-journal-0dc2dc8ad469797ce87fdeceae6af63a11ba996718dd335ecb0633a50577d627.zip | |
Error on generating Atom feeds without an author
RFC 4287 requires every feed to carry an atom:author unless all of its
entries carry one. Entries here never do, and the feed-level author was
emitted only when params.author was set, so any site that did not set it
published feeds that no conforming validator accepts.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Diffstat (limited to 'layouts/taxonomy.atom.xml')
| -rw-r--r-- | layouts/taxonomy.atom.xml | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/layouts/taxonomy.atom.xml b/layouts/taxonomy.atom.xml index 3b5a1ca..88f56ef 100644 --- a/layouts/taxonomy.atom.xml +++ b/layouts/taxonomy.atom.xml @@ -5,9 +5,12 @@ {{- $authorName = . }} {{- end }} {{- else }} - {{- $authorName = . }} + {{- $authorName = . }} {{- end }} {{- end }} +{{- if not $authorName }} + {{- errorf "Missing author" }} +{{- end }} {{- $authorEmail := "" }} {{- with site.Params.author }} @@ -30,12 +33,11 @@ <updated>{{ .Date.Format "2006-01-02T15:04:05-0700" | safeHTML }}</updated> <link href="{{ .Permalink }}atom.xml" rel="self" /> <link href="{{ .Permalink }}" rel="alternate" /> - {{- with $authorName }} <author> - <name>{{ . }}</name> + <name>{{ $authorName }}</name> {{- with $authorEmail }} <email>{{ . }}</email>{{ end }} - </author>{{ end }} + </author> <generator>Hugo -- gohugo.io</generator> <rights type="html">{{ replace .Site.Copyright "{currentYear}" (now.Format "2006") }}</rights> <subtitle>{{ .Site.Params.Description }}</subtitle>{{ range $pages }} |
