fix(render-image): warn with source position on unresolved local images

BREAKING CHANGE:

Requires Hugo v0.160
This commit is contained in:
George Cushen committed 2026-04-16 02:18:38 +01:00
1 parent ca9888609e
commit fe1f4d6a23
2 files changed
+4 -1

No files matched your search

+1 -1
View File
@@ -103,7 +103,7 @@ params:
address_format: en-us
module:
hugoVersion:
min: "0.158.0"
min: "0.160.0"
extended: true
imports:
- path: github.com/HugoBlox/kit/modules/analytics
@@ -58,6 +58,9 @@
{{- with $img_class }} class="{{.}}"{{end}} />
{{- end }}
{{- else -}}
{{- if not $is_remote -}}
{{- warnf "render-image: could not resolve local image %q — %s" $destination .Position -}}
{{- end -}}
<img src="{{ $destination | safeURL }}" alt="{{ $alt }}" loading="lazy" {{ if $zoom }}data-zoomable{{end}}
{{- with $width }} width="{{.}}"{{end}} {{- with $height }} height="{{.}}"{{end}}
{{- with $img_class }} class="{{.}}"{{end}} />