Add an error return from the figures/image shortcode if the images list contains a nil
This commit is contained in:
parent
8d7b2364db
commit
f0d0d5a136
1 changed files with 3 additions and 0 deletions
|
@ -21,6 +21,9 @@
|
||||||
<div class=container>
|
<div class=container>
|
||||||
{{ range $img := $imgs }}
|
{{ range $img := $imgs }}
|
||||||
{{- $linkedImg := $img -}}
|
{{- $linkedImg := $img -}}
|
||||||
|
{{ if not $img }}
|
||||||
|
{{ errorf "Found nil in images list for %s" $.Page.Permalink }}
|
||||||
|
{{ end }}
|
||||||
{{- if $shouldResize -}}
|
{{- if $shouldResize -}}
|
||||||
{{ $linkedImg = $img.Fit "1280x1280" }}
|
{{ $linkedImg = $img.Fit "1280x1280" }}
|
||||||
{{- end -}}
|
{{- end -}}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue