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 -}}
+1 -1
View File
@@ -1,4 +1,4 @@
{{- hugo.Store.Set "version" "v0.4.0-alpha.3-20251222083729-9bcdbe33" -}}
{{- hugo.Store.Set "version" "v0.4.0-alpha.3-20251222083840-fdcc20af" -}}
{{- .Store.Set "this" dict -}}
{{- partial "init/detection-env.html" . -}}