refactor(image): centralize page image params and warn on bad shape

Route all .Params.image access through a single normalizer partial that
returns the params as a map and emits a warnf with the expected shape
when frontmatter is set but not an object.
This commit is contained in:
George Cushen committed 2026-05-27 03:53:21 +01:00
1 parent a93892fc61
commit 64cdb4a81a
5 files changed
+18 -18

No files matched your search

+1 -5
View File
@@ -147,11 +147,7 @@
{{ $featured := partial "functions/get_featured_image.html" . }}
{{/* Safely extract image parameters - handle case where image is not a map */}}
{{ $image_params := dict }}
{{ if and .Params.image (reflect.IsMap .Params.image) }}
{{ $image_params = .Params.image }}
{{ end }}
{{ $image_params := partial "functions/get_page_image_params.html" . }}
{{/* Featured image layout */}}
{{ if and $featured (not $image_params.preview_only) }}
{{/* Fit image within max size. */}}