fix: improve warning messages for remote image retrieval failures

You can suppress the warning by adding the following to your site configuration:
ignoreLogs = ['warning-remote-image']
This commit is contained in:
Cell
2025-12-22 16:38:39 +08:00
parent fdcc20af26
commit 1bb21fcbd1
2 changed files with 3 additions and 3 deletions
@@ -5,14 +5,14 @@
{{- if $isRemote -}}
{{- with try (resources.GetRemote .Src) -}}
{{- with .Err -}}
{{- warnf "%s" . -}}
{{- warnidf "warning-remote-image" "%s" . -}}
{{- else with .Value -}}
{{- if .ResourceType | eq "image" -}}
{{- /* placed remote image in public/images/remote/ */ -}}
{{- $resource = . | resources.Copy (add "/images/remote/" .Name) -}}
{{- end -}}
{{- else -}}
{{- warnf "Unable to get remote image %q" $.Src -}}
{{- warnidf "warning-remote-image" "Failed to get remote image %q" $.Src -}}
{{- end -}}
{{- end -}}
{{- end -}}