summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--templates/shortcodes/responsive_image.html4
1 files changed, 2 insertions, 2 deletions
diff --git a/templates/shortcodes/responsive_image.html b/templates/shortcodes/responsive_image.html
index 5c0c1e4..ed54376 100644
--- a/templates/shortcodes/responsive_image.html
+++ b/templates/shortcodes/responsive_image.html
@@ -6,5 +6,5 @@
style="{% if display_width %}width: {{ display_width }};height: auto;{% endif %}{% if background_color %}background-color: {{ background_color }};{% endif %}"
loading="lazy"
alt="{{ alt }}"
- src="{{ resize_image(path=full_path, width=width, op="fit_width", quality=100) }}"
- srcset="{% for size in [1, 1.5, 2, 3, 4] %}{% set resize_width = size * width | int %}{% if resize_width <= meta.width %}{{ resize_image(path=full_path, width=resize_width, op="fit_width", quality=100) }} {{ size }}x,{% endif %}{% endfor %}">
+ src="{% set image = resize_image(path=full_path, width=width, op="fit_width", quality=100) %}{{ image.url }}"
+ srcset="{% for size in [1, 1.5, 2, 3, 4] %}{% set resize_width = size * width | int %}{% if resize_width <= meta.width %}{% set image = resize_image(path=full_path, width=resize_width, op="fit_width", quality=100) %}{{ image.url }} {{ size }}x{% if not loop.last %},{% endif %}{% endif %}{% endfor %}">