aboutsummaryrefslogtreecommitdiff
path: root/layouts/term
diff options
context:
space:
mode:
authorNicholas Johnson <mail@nicholasjohnson.ch>2024-08-16 00:00:00 +0000
committerNicholas Johnson <mail@nicholasjohnson.ch>2024-08-16 00:00:00 +0000
commit5922472635a618dc24ee98c990037ad34ba98b5b60077aa246fbb52ecbc58c49 (patch)
tree2dab4352b841a72cde95751ca88c8647ead65b2272186e67e76fbef10ac7c981 /layouts/term
parent40bcd08bc6edd2cb9137eef47946242e925d8193336ec08c2bad1559afce04ef (diff)
downloadhugo-theme-journal-5922472635a618dc24ee98c990037ad34ba98b5b60077aa246fbb52ecbc58c49.tar.gz
hugo-theme-journal-5922472635a618dc24ee98c990037ad34ba98b5b60077aa246fbb52ecbc58c49.zip
Make author element optional in Atom feeds
Diffstat (limited to 'layouts/term')
-rw-r--r--layouts/term/term.atom.xml5
-rw-r--r--layouts/term/term.gemini_atom.xml5
2 files changed, 6 insertions, 4 deletions
diff --git a/layouts/term/term.atom.xml b/layouts/term/term.atom.xml
index 50d72fa..9ceeb79 100644
--- a/layouts/term/term.atom.xml
+++ b/layouts/term/term.atom.xml
@@ -37,11 +37,12 @@
<updated>{{ .Date.UTC.Format "2006-01-02T15:04:05Z" | safeHTML }}</updated>
<link href="{{ .Permalink }}atom.xml" rel="self" />
<link href="{{ .Permalink }}" rel="alternate" />
+ {{- with $authorName }}
<author>
- <name>{{ $authorName }}</name>
+ <name>{{ . }}</name>
{{- with $authorEmail }}
<email>{{ . }}</email>{{ end }}
- </author>
+ </author>{{ end }}
<generator>Hugo -- gohugo.io</generator>
<rights type="html">{{ replace .Site.Copyright "{currentYear}" (now.UTC.Format "2006") }}</rights>
<subtitle>{{ .Site.Params.Description }}</subtitle>{{ range first .Site.Config.Services.RSS.Limit .Data.Pages }}
diff --git a/layouts/term/term.gemini_atom.xml b/layouts/term/term.gemini_atom.xml
index a4826bc..1323308 100644
--- a/layouts/term/term.gemini_atom.xml
+++ b/layouts/term/term.gemini_atom.xml
@@ -37,11 +37,12 @@
<updated>{{ .Date.UTC.Format "2006-01-02T15:04:05Z" | safeHTML }}</updated>
<link href="{{ replace .Permalink "https://" "gemini://" | replaceRE `(?m)index.gmi$` "atom.xml" | safeURL }}" rel="self" />
<link href="{{ replace .Permalink "https://" "gemini://" | replaceRE `(?m)index.gmi$` "" | safeURL }}" rel="alternate" />
+ {{- with $authorName }}
<author>
- <name>{{ $authorName }}</name>
+ <name>{{ . }}</name>
{{- with $authorEmail }}
<email>{{ . }}</email>{{ end }}
- </author>
+ </author>{{ end }}
<generator>Hugo -- gohugo.io</generator>
<rights type="html">{{ replace .Site.Copyright "{currentYear}" (now.UTC.Format "2006") }}</rights>
<subtitle>{{ .Site.Params.Description }}</subtitle>{{ range first .Site.Config.Services.RSS.Limit .Data.Pages }}