From 0dc2dc8ad469797ce87fdeceae6af63a11ba996718dd335ecb0633a50577d627 Mon Sep 17 00:00:00 2001 From: Nicholas Johnson <> Date: Fri, 18 Sep 2026 00:00:00 +0000 Subject: 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 --- layouts/home.atom.xml | 10 ++++++---- layouts/home.gemini_atom.xml | 10 ++++++---- layouts/taxonomy.atom.xml | 10 ++++++---- layouts/taxonomy.gemini_atom.xml | 10 ++++++---- layouts/term.atom.xml | 10 ++++++---- layouts/term.gemini_atom.xml | 10 ++++++---- 6 files changed, 36 insertions(+), 24 deletions(-) (limited to 'layouts') diff --git a/layouts/home.atom.xml b/layouts/home.atom.xml index 47b4233..e036404 100644 --- a/layouts/home.atom.xml +++ b/layouts/home.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 @@ {{ .Date.Format "2006-01-02T15:04:05-0700" | safeHTML }} - {{- with $authorName }} - {{ . }} + {{ $authorName }} {{- with $authorEmail }} {{ . }}{{ end }} - {{ end }} + Hugo -- gohugo.io {{ replace .Site.Copyright "{currentYear}" (now.Format "2006") }} {{ .Site.Params.Description }}{{ range $pages }} diff --git a/layouts/home.gemini_atom.xml b/layouts/home.gemini_atom.xml index ac8f412..491b9c2 100644 --- a/layouts/home.gemini_atom.xml +++ b/layouts/home.gemini_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 @@ {{ .Date.Format "2006-01-02T15:04:05-0700" | safeHTML }} - {{- with $authorName }} - {{ . }} + {{ $authorName }} {{- with $authorEmail }} {{ . }}{{ end }} - {{ end }} + Hugo -- gohugo.io {{ replace .Site.Copyright "{currentYear}" (now.Format "2006") }} {{ .Site.Params.Description }}{{ range $pages }} 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 @@ {{ .Date.Format "2006-01-02T15:04:05-0700" | safeHTML }} - {{- with $authorName }} - {{ . }} + {{ $authorName }} {{- with $authorEmail }} {{ . }}{{ end }} - {{ end }} + Hugo -- gohugo.io {{ replace .Site.Copyright "{currentYear}" (now.Format "2006") }} {{ .Site.Params.Description }}{{ range $pages }} diff --git a/layouts/taxonomy.gemini_atom.xml b/layouts/taxonomy.gemini_atom.xml index 5341d32..0dbf41d 100644 --- a/layouts/taxonomy.gemini_atom.xml +++ b/layouts/taxonomy.gemini_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 @@ {{ .Date.Format "2006-01-02T15:04:05-0700" | safeHTML }} - {{- with $authorName }} - {{ . }} + {{ $authorName }} {{- with $authorEmail }} {{ . }}{{ end }} - {{ end }} + Hugo -- gohugo.io {{ replace .Site.Copyright "{currentYear}" (now.Format "2006") }} {{ .Site.Params.Description }}{{ range $pages }} diff --git a/layouts/term.atom.xml b/layouts/term.atom.xml index 3b5a1ca..88f56ef 100644 --- a/layouts/term.atom.xml +++ b/layouts/term.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 @@ {{ .Date.Format "2006-01-02T15:04:05-0700" | safeHTML }} - {{- with $authorName }} - {{ . }} + {{ $authorName }} {{- with $authorEmail }} {{ . }}{{ end }} - {{ end }} + Hugo -- gohugo.io {{ replace .Site.Copyright "{currentYear}" (now.Format "2006") }} {{ .Site.Params.Description }}{{ range $pages }} diff --git a/layouts/term.gemini_atom.xml b/layouts/term.gemini_atom.xml index 5341d32..0dbf41d 100644 --- a/layouts/term.gemini_atom.xml +++ b/layouts/term.gemini_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 @@ {{ .Date.Format "2006-01-02T15:04:05-0700" | safeHTML }} - {{- with $authorName }} - {{ . }} + {{ $authorName }} {{- with $authorEmail }} {{ . }}{{ end }} - {{ end }} + Hugo -- gohugo.io {{ replace .Site.Copyright "{currentYear}" (now.Format "2006") }} {{ .Site.Params.Description }}{{ range $pages }} -- cgit v1.2.3