From 0882a21997b0830f43643cac9f0de4beaa698988 Mon Sep 17 00:00:00 2001 From: Serghei Iakovlev Date: Sun, 29 Sep 2024 15:54:01 +0200 Subject: Rework author configuration --- layouts/_default/list.atom.xml | 22 ++++++++++++++++++---- 1 file changed, 18 insertions(+), 4 deletions(-) (limited to 'layouts/_default/list.atom.xml') 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 "" }} @@ -29,10 +43,10 @@ {{- end -}} {{- end }} {{ $logo := resources.Get (site.Params.assets.logo | default "/img/open-graph-logo.png") }}{{ $logo = $logo.Resize "96x96" }}{{ $logo.Permalink | absURL }} - {{ $logo.Permalink | absURL }}{{ with $siteAuthor.name }} + {{ $logo.Permalink | absURL }}{{ if or (not (eq $authorEmail "")) (not (eq $authorName "")) }} - {{ . }} - {{ with $siteAuthor.email }}{{ . | html }}{{ end }} + {{ with $authorName }}{{ . }}{{ end }} + {{ with $authorEmail }}{{ . | html }}{{ end }} {{ end }}{{ with site.Params.Copyright }} {{ . | plainify }}{{ end }} Hugo{{ if ne $siteLastMod "" }} -- cgit v1.2.3