From f21c9f431e71cd379f8d31bd008a6d8544613bce Mon Sep 17 00:00:00 2001 From: tdro Date: Sun, 28 Aug 2022 02:00:48 -0400 Subject: themes/default/layouts/_default/rss.xml: Use optimized image cache --- themes/default/layouts/_default/rss.xml | 21 ++++++++++++++++++++- 1 file changed, 20 insertions(+), 1 deletion(-) diff --git a/themes/default/layouts/_default/rss.xml b/themes/default/layouts/_default/rss.xml index e6eca24..bda0455 100644 --- a/themes/default/layouts/_default/rss.xml +++ b/themes/default/layouts/_default/rss.xml @@ -5,6 +5,25 @@ {{- if ge $limit 1 -}} {{- $pages = $pages | first $limit -}} {{- end -}} + +{{- $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)) + "OptimizedCopy" (print (partial "function-paths.html" "media") "/" $author.user "/" (path.BaseName $profile) ".webp") + ) +-}} + {{- print "" | safeHTML }} {{ print "" | safeHTML }} @@ -17,7 +36,7 @@ {{ partial "author-user" . }} {{ partial "base-title" . }} - {{ .Site.BaseURL }}/{{ partial "author-media-path.html" . }}/profile/picture.png + {{ $image.Permalink }} {{ .Permalink }} {{ if not .Date.IsZero -}} -- cgit v1.2.3