aboutsummaryrefslogtreecommitdiff
path: root/layouts/home.gemini_atom.xml
diff options
context:
space:
mode:
authorNicholas Johnson <>2026-09-18 00:00:00 +0000
committerNicholas Johnson <>2026-09-19 16:06:40 -0400
commit0dc2dc8ad469797ce87fdeceae6af63a11ba996718dd335ecb0633a50577d627 (patch)
tree787639c2e521ea34818a58b25f206493c7ec037de938d085d371a38191626557 /layouts/home.gemini_atom.xml
parent7a51b9a97b2d618e6b006f1a3b6a0ebd4acd51888af95e670662cf5655fffb3a (diff)
downloadhugo-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/home.gemini_atom.xml')
-rw-r--r--layouts/home.gemini_atom.xml10
1 files changed, 6 insertions, 4 deletions
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 @@
<updated>{{ .Date.Format "2006-01-02T15:04:05-0700" | safeHTML }}</updated>
<link href="{{ .Permalink | replaceRE `index.gmi$` "atom.xml" | safeURL }}" rel="self" />
<link href="{{ .Permalink | strings.TrimSuffix "index.gmi" | safeURL }}" 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 }}