diff options
author | Tuomas Siipola | 2024-09-02 21:33:21 +0300 |
---|---|---|
committer | Tuomas Siipola | 2024-09-02 21:33:21 +0300 |
commit | 7507243eb84eb53dd2e807edab8f4659c2be0a37 (patch) | |
tree | 78561763c052e6ac495925a2c73c4df9fd79807d | |
parent | 6d995169de606c5036fccef6716439c991a8ab0d (diff) |
-rw-r--r-- | templates/shortcodes/responsive_image.html | 4 |
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 %}"> |