summaryrefslogtreecommitdiff
path: root/templates/blocks/gallery-image.html
blob: b786bbcb82e1b59c0b89e81986ebb5441adf8051 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
{% set image = record.attachments.get(this["image"]) %}
{% if image %}
  {% set responsive = responsive_image(image).attrs %}
  <a href="{{ image | url }}" data-original-image>
    <img src="{{ responsive.src }}"
         {% if responsive.srcset %}srcset="{{ responsive.srcset }}"{% endif %}
         sizes="(max-width: 500px) 100vw, (max-width: 1100px) 60vw, 50vw"
         width="{{ image.width }}"
         height="{{ image.height }}"
         data-fullsize="{{ image | url }}"
         alt="{{ this["alt"] }}"
         loading="lazy"
         decoding="async">
  </a>
{% endif %}