diff options
| author | Serghei Iakovlev <egrep@protonmail.ch> | 2024-09-29 15:54:01 +0200 |
|---|---|---|
| committer | Serghei Iakovlev <git@serghei.pl> | 2024-09-29 18:15:42 +0200 |
| commit | 0882a21997b0830f43643cac9f0de4beaa698988 (patch) | |
| tree | 581a1dea498805ef5b9259fbf095b5546d705a78 /layouts/_default/list.atom.xml | |
| parent | ec19cd59b5fc2ee4dc12b65647099c595984c075 (diff) | |
| download | gohugo-theme-ed-0882a21997b0830f43643cac9f0de4beaa698988.tar.gz | |
Rework author configuration
Diffstat (limited to 'layouts/_default/list.atom.xml')
| -rw-r--r-- | layouts/_default/list.atom.xml | 22 |
1 files changed, 18 insertions, 4 deletions
diff --git a/layouts/_default/list.atom.xml b/layouts/_default/list.atom.xml index 6ef45ab..c51bebd 100644 --- a/layouts/_default/list.atom.xml +++ b/layouts/_default/list.atom.xml @@ -15,7 +15,21 @@ {{- $pages = $pages | first $limit -}} {{- $siteLastMod := partial "site-last-mod.html" . -}} -{{- $siteAuthor := partial "site-author.html" . -}} + +{{- $authorEmail := "" }} +{{- $authorName := "" }} +{{- with site.Params.author }} + {{- if reflect.IsMap . }} + {{- with .email }} + {{- $authorEmail = . }} + {{- end -}} + {{- with .name }} + {{- $authorName = . }} + {{- end }} + {{- else }} + {{- $authorName = . }} + {{- end }} +{{- end }} {{- safeHTML "<?xml version=\"1.0\" encoding=\"utf-8\" standalone=\"yes\" ?>" }} <feed xmlns="http://www.w3.org/2005/Atom" xmlns:media="http://search.yahoo.com/mrss/" xml:lang="{{ site.LanguageCode }}" xml:base="{{ site.BaseURL }}"> @@ -29,10 +43,10 @@ {{- end -}} {{- end }} {{ $logo := resources.Get (site.Params.assets.logo | default "/img/open-graph-logo.png") }}{{ $logo = $logo.Resize "96x96" }}<icon>{{ $logo.Permalink | absURL }}</icon> - <logo>{{ $logo.Permalink | absURL }}</logo>{{ with $siteAuthor.name }} + <logo>{{ $logo.Permalink | absURL }}</logo>{{ if or (not (eq $authorEmail "")) (not (eq $authorName "")) }} <author> - <name>{{ . }}</name> - {{ with $siteAuthor.email }}<email>{{ . | html }}</email>{{ end }} + {{ with $authorName }}<name>{{ . }}</name>{{ end }} + {{ with $authorEmail }}<email>{{ . | html }}</email>{{ end }} </author>{{ end }}{{ with site.Params.Copyright }} <rights>{{ . | plainify }}</rights>{{ end }} <generator uri="https://gohugo.io" version="{{ hugo.Version }}">Hugo</generator>{{ if ne $siteLastMod "" }} |
