diff --git a/layouts/shortcodes/figures/image.html b/layouts/shortcodes/figures/image.html index ecf42c9..9372b06 100644 --- a/layouts/shortcodes/figures/image.html +++ b/layouts/shortcodes/figures/image.html @@ -17,31 +17,35 @@ {{ errorf "No images found for name(s) parameter" }} {{- end -}} -
-
- {{ range $img := $imgs }} - {{- $linkedImg := $img -}} - {{- if not $img }} - {{ errorf "Found nil in images list for %s" $.Page.Permalink }} - {{ end -}} +{{ with $item := index $imgs 0 }} +
+
+ {{ if eq $item.ResourceType "image" }} + {{- $processedImage := $item -}} + {{- if $shouldResize -}} + {{ $processedImage = $item.Fit "1280x1280" }} + {{- end -}} - {{- if $shouldResize -}} - {{ $linkedImg = $img.Fit "1280x1280" }} + {{- $altText := $item.Params.alt | default $item.Title -}} + + {{ . }} + + {{ else if eq $item.ResourceType "video" }} + + {{- end }} +
+ {{ if $shouldShowTitle -}} + {{- with $item -}} + {{- if gt (len .Title) 0 -}} +
{{ .Title | markdownify }}
+ {{- end -}} {{- end -}} - - {{- $altText := $img.Params.alt | default $img.Title -}} - - {{ . }} - {{- end }} -
- {{ if $shouldShowTitle -}} - {{- range $imgs -}} - {{- if gt (len .Title) 0 -}} -
{{ .Title }}
- {{- end -}} - {{- end -}} - {{- end }} -
+ +{{ else }} + {{ errorf "Found nil in items list for %s" $.Page.Permalink }} +{{ end }}