From 995a64c54b08fcc289373d5c0e7b6b2d5a753e6f Mon Sep 17 00:00:00 2001 From: PCloud Date: Fri, 21 Jun 2024 07:57:41 +0100 Subject: [PATCH] fix: do not call resources.Get on remote resources (#1302) --- layouts/partials/plugin/image.html | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/layouts/partials/plugin/image.html b/layouts/partials/plugin/image.html index a9ec96941..78cc0c728 100644 --- a/layouts/partials/plugin/image.html +++ b/layouts/partials/plugin/image.html @@ -24,13 +24,16 @@ - CacheRemote: Override the site parameter to cache remote images. */}} -{{- $resource := (.Resources.Get .Src) | default (resources.Get .Src) | default nil -}} +{{- $resource := dict -}} +{{/* Do not call resources.Get on remote resources. https://github.com/HEIGE-PCloud/DoIt/issues/1300 */}} +{{- $isUrlRemote := urls.Parse .Src | partial "function/isUrlRemote.html" -}} +{{- if not $isUrlRemote -}} + {{- $resource = (.Resources.Get .Src) | default (resources.Get .Src) -}} +{{- end -}} {{- $cacheRemote := .CacheRemote | default site.Params.image.cacheRemote | default false -}} {{- $optimise := .Optimise | default site.Params.image.optimise | default false -}} -{{- $isUrlRemote := urls.Parse .Src | partial "function/isUrlRemote.html" -}} - {{- if not $resource | and $isUrlRemote | and $cacheRemote -}} {{- with $remoteResource := resources.GetRemote .Src -}} {{- with .Err -}}