From 1bb21fcbd1106b24ce1f28ce34d5a8b2caad1b8c Mon Sep 17 00:00:00 2001 From: Cell <1024@lruihao.cn> Date: Mon, 22 Dec 2025 16:38:39 +0800 Subject: [PATCH] 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'] --- layouts/_partials/function/get-remote-image.html | 4 ++-- layouts/_partials/init/index.html | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/layouts/_partials/function/get-remote-image.html b/layouts/_partials/function/get-remote-image.html index 99435942..e93c9978 100644 --- a/layouts/_partials/function/get-remote-image.html +++ b/layouts/_partials/function/get-remote-image.html @@ -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 -}} diff --git a/layouts/_partials/init/index.html b/layouts/_partials/init/index.html index 27973d4f..54e87ca9 100644 --- a/layouts/_partials/init/index.html +++ b/layouts/_partials/init/index.html @@ -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" . -}}