{{- $image := .resource -}} {{- $isSVG := strings.Contains $image.MediaType.SubType "svg" -}} {{- $linksToFullSizeImage := and .linksToFullSizeImage (not $isSVG) -}} {{- $resizedImages := dict "full" $image -}} {{- if not $isSVG -}} {{- $resizedImages := dict "full" ($image.Fit "2560x2560") "half" ($image.Fit "1280x1280") "quarter" ($image.Fit "640x640") -}} {{ end }} {{- $classes := slice "figure" "figure--image" -}} {{- if eq .size "main" -}} {{ $classes = $classes | append "figure--main-column" }} {{- end -}} {{- with .class -}} {{ $classes = $classes | append . }} {{- end -}}
{{ if $linksToFullSizeImage -}} {{- end -}} {{ . }} {{ if .linksToFullSizeImage -}} {{- end -}} {{ if .shouldShowTitle }} {{ partial "page/figures/caption.html" . }} {{ end }}