diff --git a/layouts/partials/page/figures/fullwidth-image.html b/layouts/partials/page/figures/fullwidth-image.html index ed39f0e..74b29e3 100644 --- a/layouts/partials/page/figures/fullwidth-image.html +++ b/layouts/partials/page/figures/fullwidth-image.html @@ -1,28 +1,39 @@ {{- $image := .resource -}} -{{- - $resizedImages := dict - "full" ($image.Fit "2560x2560") - "half" ($image.Fit "1280x1280") - "quarter" ($image.Fit "640x640") --}} +{{- $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 -}} + {{ if $linksToFullSizeImage -}} {{- end -}} {{ . }} {{ if .linksToFullSizeImage -}}