Skip to content

Commit

Permalink
fix: do not call resources.Get on remote resources (#1302)
Browse files Browse the repository at this point in the history
  • Loading branch information
HEIGE-PCloud authored Jun 21, 2024
1 parent 9ec272f commit 995a64c
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions layouts/partials/plugin/image.html
Original file line number Diff line number Diff line change
Expand Up @@ -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 -}}
Expand Down

0 comments on commit 995a64c

Please sign in to comment.