From f174703fafd064be06552fd73c992b0b87fd92b3 Mon Sep 17 00:00:00 2001 From: tdro Date: Thu, 1 Dec 2022 23:35:55 -0500 Subject: themes/default/layouts/_default/rss.xml: Add atom:author to entry To show name and image. Add feed generator signature to channel --- themes/default/layouts/_default/home.xslt.xsl | 8 ++--- themes/default/layouts/_default/rss.xml | 42 ++++++++++++++++++++++++--- 2 files changed, 42 insertions(+), 8 deletions(-) diff --git a/themes/default/layouts/_default/home.xslt.xsl b/themes/default/layouts/_default/home.xslt.xsl index e271d67..c242f70 100644 --- a/themes/default/layouts/_default/home.xslt.xsl +++ b/themes/default/layouts/_default/home.xslt.xsl @@ -81,12 +81,12 @@
- + - - - + + + diff --git a/themes/default/layouts/_default/rss.xml b/themes/default/layouts/_default/rss.xml index d6a8f46..562da9e 100644 --- a/themes/default/layouts/_default/rss.xml +++ b/themes/default/layouts/_default/rss.xml @@ -10,9 +10,9 @@ {{- $lastBuildDate = .Date.Format "Mon, 02 Jan 2006 15:04:05 -0700" | safeHTML -}} {{- end -}} -{{- $author := partial "function-authors-data.html" . -}} {{- $title := partial "base-title.html" . -}} {{- $description := partial "base-title.html" . -}} +{{- $author := partial "function-authors-data.html" . -}} {{- if (eq .Page.Kind "section") -}} {{- $title = $author.name -}} @@ -55,7 +55,10 @@ {{- printf `` | safeHTML }} {{ printf `` | safeHTML }} - + {{ $title }} {{ .Permalink }} @@ -67,13 +70,40 @@ {{ $image.Permalink }} {{ .Permalink }} + Hugo {{ hugo.Version }} {{ $lastBuildDate }} {{ $atomSelf }} {{ $atomPrevious }} {{ $atomNext }} - {{- range first $limit .Paginator.Pages }} + {{ range first $limit .Paginator.Pages }} + + {{- $author = partial "function-authors-data.html" . -}} + {{- $profile = $author.picture.profile -}} + {{- $file = not (urls.Parse $profile).Host -}} + + {{- if $file -}} + {{- $profile = print $author.user "/" $profile -}} + {{- end -}} + + {{- $image = partial "function-caches-images.html" + (dict + "Source" $profile + "Fit" "160x160" + "Target" (print (partial "function-paths.html" "media") "/" $author.user "/") + "Copy" (print (partial "function-paths.html" "media") "/" $author.user "/" (path.Base $profile)) + "AlternateCopy" (print (partial "function-paths.html" "media") "/" $author.user "/" (path.BaseName $profile) ".webp") + ) + -}} + + {{- $atomAuthorUri := $image.Permalink -}} + {{- $atomAuthorName := or .Params.Feed.name $author.name -}} + + {{- if .Params.Feed.favicon -}} + {{- $atomAuthorUri = .Params.Feed.favicon | absURL -}} + {{- end -}} + {{ if and (not .Params.Unlisted) (not .ExpiryDate) }} {{ .Summary | htmlUnescape }} @@ -85,8 +115,12 @@ {{- print "
" | html -}} {{- partial "rss-tags.html" . | html -}} + + {{ $atomAuthorName }} + {{ $atomAuthorUri }} +
- {{- end -}} + {{ end -}} {{ end }}
-- cgit v1.2.3