summaryrefslogtreecommitdiff
path: root/templates/blocks/gallery-image.html
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--templates/blocks/gallery-image.html18
1 files changed, 12 insertions, 6 deletions
diff --git a/templates/blocks/gallery-image.html b/templates/blocks/gallery-image.html
index 44a8e93..b786bbc 100644
--- a/templates/blocks/gallery-image.html
+++ b/templates/blocks/gallery-image.html
@@ -1,9 +1,15 @@
{% set image = record.attachments.get(this["image"]) %}
{% if image %}
- <img src="{{ image | url }}"
- width="{{ image.width }}"
- height="{{ image.height }}"
- alt="{{ this["alt"] }}"
- loading="lazy"
- decoding="async">
+ {% 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 %}