Add an error return from the figures/image shortcode if the images list contains a nil

This commit is contained in:
Eryn Wells 2024-10-07 21:33:30 -07:00
parent 8d7b2364db
commit f0d0d5a136

View file

@ -21,6 +21,9 @@
<div class=container>
{{ range $img := $imgs }}
{{- $linkedImg := $img -}}
{{ if not $img }}
{{ errorf "Found nil in images list for %s" $.Page.Permalink }}
{{ end }}
{{- if $shouldResize -}}
{{ $linkedImg = $img.Fit "1280x1280" }}
{{- end -}}