mirror of
https://github.com/tiennm99/HugoBlox-kit.git
synced 2026-10-17 22:14:03 +00:00
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:
1 parent
a93892fc61
commit
64cdb4a81a
5 files changed
+18
-18
No files matched your search
@@ -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. */}}
|
||||
|
||||
Reference in new issue
Block a user