From b82719b135e6817c83e305e2259ec0861b62d988 Mon Sep 17 00:00:00 2001 From: Ben Goldsworthy Date: Wed, 9 Jul 2025 21:22:38 +0200 Subject: [PATCH] feat: add `hint` support --- layouts/_partials/images/get-image.html | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/layouts/_partials/images/get-image.html b/layouts/_partials/images/get-image.html index 4b4a00c..6cb94d9 100644 --- a/layouts/_partials/images/get-image.html +++ b/layouts/_partials/images/get-image.html @@ -37,6 +37,15 @@ {{- end -}} {{- end -}} +{{- if ( and $hint ( not $isResizable ) ) -}} + {{- warnidf "pointless-hint" "Hint '%s' provided for an image that is not convertible to .webm, ignoring… (%q)" $hint $img.File.Path }} +{{- end -}} + +{{- $valid_hint_values := ( slice "drawing" "icon" "photo" "picture" "text" ) -}} +{{- if ( and $hint ( not ( in $valid_hint_values $hint ) ) ) -}} + {{- errorf "Hint '%s' is not valid, use one of %q instead. (%q)" $hint $img.File.Path -}} +{{- end -}} + {{- if $isResizable -}}