diff options
author | tdro <tdro@noreply.example.com> | 2022-07-18 12:27:23 -0400 |
---|---|---|
committer | tdro <tdro@noreply.example.com> | 2022-07-18 12:27:23 -0400 |
commit | e5b102711f9afb5ed7eea28d9ef191cbe1b8db05 (patch) | |
tree | 4fecaa2f42abc4e21c3ffb5322c58988d5fc55f6 /themes/default/layouts/partials/generate-feeds.html | |
parent | 004dfef5eb2e81e39cbb11a766b0a22975e48194 (diff) | |
download | canory-e5b102711f9afb5ed7eea28d9ef191cbe1b8db05.tar.gz canory-e5b102711f9afb5ed7eea28d9ef191cbe1b8db05.tar.bz2 canory-e5b102711f9afb5ed7eea28d9ef191cbe1b8db05.zip |
themes/default/layouts/partials/function: Do not fetch saved favicons again
Separate fetch function. Use permalink in write to file pattern.
Diffstat (limited to 'themes/default/layouts/partials/generate-feeds.html')
-rw-r--r-- | themes/default/layouts/partials/generate-feeds.html | 23 |
1 files changed, 8 insertions, 15 deletions
diff --git a/themes/default/layouts/partials/generate-feeds.html b/themes/default/layouts/partials/generate-feeds.html index 67c9556..4421ee8 100644 --- a/themes/default/layouts/partials/generate-feeds.html +++ b/themes/default/layouts/partials/generate-feeds.html @@ -172,7 +172,7 @@ {{- range $feeds -}} - {{- $imageCanonicalURL := + {{- $faviconDomain := (print "https://t1.gstatic.com/faviconV2?client=SOCIAL&type=FAVICON&fallback_opts=TYPE,SIZE,URL&url=" "http://" @@ -181,19 +181,12 @@ ) -}} - {{- $404image := resources.Get "data/media/404.png" -}} - {{- $imageSource := $404image.RelPermalink -}} - {{- $imageTitle := "No image found" -}} - - {{- with $image := resources.GetRemote $imageCanonicalURL -}} - {{- with .Err -}} - {{- warnf "%s" . -}} - {{- else -}} - {{- $imageContent := $image.Content | resources.FromString (print (partial "function-paths.html" "media") "/" ($image | urlize)) -}} - {{- $imageSource = $imageContent.RelPermalink -}} - {{- $imageTitle = $imageCanonicalURL -}} - {{- end -}} - {{- end -}} + {{- $imageSource := partial "function-feeds-favicons.html" + (dict + "Domain" .FeedSourceDomain + "Search" $faviconDomain + ) + -}} {{- $template := resources.Get "templates/markdown-feed.yaml" -}} {{- $name := print (delimit (first 8 (split (.FeedTitle | urlize) "-")) "-" | humanize | urlize) "-" (.FeedLink | sha256 | truncate 8 "") | humanize | urlize -}} @@ -227,7 +220,7 @@ ) $template -}} - {{- $writeToFile := $markdown.RelPermalink -}} + {{- $writeToFile := $markdown.Permalink -}} {{ end }} <web-ring> |