diff --git a/modules/blox-tailwind/layouts/partials/blox/cta-image-paragraph.html b/modules/blox-tailwind/layouts/partials/blox/cta-image-paragraph.html index 8bbc8bdc..fcfa7090 100644 --- a/modules/blox-tailwind/layouts/partials/blox/cta-image-paragraph.html +++ b/modules/blox-tailwind/layouts/partials/blox/cta-image-paragraph.html @@ -10,8 +10,13 @@ {{ range $idx, $item := $block.content.items }} {{ $title := .title | emojify | $page.RenderString }} {{ $text := .text | emojify | $page.RenderString }} - {{ $image := resources.GetMatch (path.Join "media" .image) }} - {{ $image = $image.Process "Resize 800x webp" }} + {{ $image_path := path.Join "media" .image }} + {{ $image := resources.GetMatch $image_path }} + {{ with $image }} + {{ $image = $image.Process "Resize 800x webp" }} + {{ else }} + {{ errorf "%s uses the `cta-image-paragraph` blox which specifies a non-existent `image` at `assets/%s`. Please add the image to this folder and try again." $page.File.Path $image_path }} + {{ end }}
{{$title | plainify}}