Add a class argument to the figures/image shortcode

This commit is contained in:
Eryn Wells 2023-12-31 12:17:27 -08:00
parent 5f14f1cea2
commit 9584896363

View file

@ -10,13 +10,15 @@
{{ errorf "Missing name or names parameter to figures/image" }} {{ errorf "Missing name or names parameter to figures/image" }}
{{- end -}} {{- end -}}
{{- $class := .Get "class" -}}
{{- if lt (len $imgs) 0 -}} {{- if lt (len $imgs) 0 -}}
{{ errorf "No images found for name(s) parameter" }} {{ errorf "No images found for name(s) parameter" }}
{{- end -}} {{- end -}}
{{- $shouldShowTitle := (.Get "shouldShowTitle") | default true -}} {{- $shouldShowTitle := (.Get "shouldShowTitle") | default true -}}
<figure> <figure {{with $class }}class="{{ . }}"{{ end }}>
<div class=container> <div class=container>
{{ range $img := $imgs -}} {{ range $img := $imgs -}}
{{- $resizedImg := $img.Fit "1280x1280" -}} {{- $resizedImg := $img.Fit "1280x1280" -}}