diff --git a/layouts/partials/plugin/image.html b/layouts/partials/plugin/image.html index 78cc0c728..155676907 100644 --- a/layouts/partials/plugin/image.html +++ b/layouts/partials/plugin/image.html @@ -24,10 +24,14 @@ - CacheRemote: Override the site parameter to cache remote images. */}} +{{- $isInlineImage := strings.HasPrefix .Src "data:image" -}} + {{- $resource := dict -}} -{{/* Do not call resources.Get on remote resources. https://github.com/HEIGE-PCloud/DoIt/issues/1300 */}} +{{/* Do not call resources.Get on remote resources. https://github.com/HEIGE-PCloud/DoIt/issues/1300 + Do not call try to get a resource if the image is inline. https://github.com/HEIGE-PCloud/DoIt/issues/1345 +*/}} {{- $isUrlRemote := urls.Parse .Src | partial "function/isUrlRemote.html" -}} -{{- if not $isUrlRemote -}} +{{- if not $isUrlRemote | and (not $isInlineImage) -}} {{- $resource = (.Resources.Get .Src) | default (resources.Get .Src) -}} {{- end -}} @@ -67,7 +71,7 @@ {{- if .Linked -}} {{- end -}} - + {{- if .Linked -}} {{- end -}}