From b4b3a746e5b53c4a6df2e4b5fb700de75bd1d3c0 Mon Sep 17 00:00:00 2001 From: Max Mehl Date: Thu, 12 Feb 2026 23:59:54 +0100 Subject: [PATCH] feat: handle missing header images --- themes/hugo-sustain/layouts/partials/blog/headerimage.html | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/themes/hugo-sustain/layouts/partials/blog/headerimage.html b/themes/hugo-sustain/layouts/partials/blog/headerimage.html index 45f44a2..92ffeca 100644 --- a/themes/hugo-sustain/layouts/partials/blog/headerimage.html +++ b/themes/hugo-sustain/layouts/partials/blog/headerimage.html @@ -12,8 +12,12 @@ {{- end }} {{- end }} {{- $processes := .processes | default (slice "fill 1000x440 webp" )}} - {{- $image = partial "image-processing" (dict "image" $image "processes" $processes "filter" .filter) -}} + {{- $filter := .filter }} + {{- if not $image }} + {{- warnf "Header image '%s' not found for page %s" .src $page.RelPermalink }} + {{- end }} {{- with $image }} + {{- $image = partial "image-processing" (dict "image" $image "processes" $processes "filter" $filter) -}} {{- end }} {{- with .text }}

{{ . | markdownify }}

{{ end }}