2026-01-30 15:07:14 +01:00
|
|
|
{{- $image := partial "helper/image" (dict "Resources" .Page.Resources "Image" .Destination) -}}
|
2021-08-25 12:20:15 +02:00
|
|
|
{{- $alt := .PlainText | safeHTML -}}
|
2020-12-23 21:02:35 +01:00
|
|
|
|
2021-08-25 12:20:15 +02:00
|
|
|
{{/* SVG and external images won't work with gallery layout, because their width and height attributes are unknown */}}
|
2026-01-30 15:07:14 +01:00
|
|
|
{{- $galleryImage := and $image.Height $image.Width -}}
|
2021-08-25 12:20:15 +02:00
|
|
|
|
2026-01-30 15:07:14 +01:00
|
|
|
<img src="{{ $image.Permalink }}"
|
|
|
|
|
{{ with $image.Width }}width="{{ . }}"{{ end }}
|
|
|
|
|
{{ with $image.Height }}height="{{ . }}"{{ end }}
|
2022-02-06 19:58:10 +01:00
|
|
|
loading="lazy"
|
|
|
|
|
{{ with $alt }}
|
|
|
|
|
alt="{{ . }}"
|
|
|
|
|
{{ end }}
|
2021-08-25 12:20:15 +02:00
|
|
|
{{ if $galleryImage }}
|
|
|
|
|
class="gallery-image"
|
2022-02-06 19:58:10 +01:00
|
|
|
data-flex-grow="{{ div (mul $image.Width 100) $image.Height }}"
|
|
|
|
|
data-flex-basis="{{ div (mul $image.Width 240) $image.Height }}px"
|
2021-08-25 12:20:15 +02:00
|
|
|
{{ end }}
|
2022-02-06 19:58:10 +01:00
|
|
|
>
|