From 2f9b9f3cca0f963d5c1a13063ab1557c9b0ef043 Mon Sep 17 00:00:00 2001 From: Ludo Date: Mon, 21 Nov 2022 15:44:24 -0500 Subject: [PATCH] Remove alt attribute in image_tag filter where unnecessary (#2117) * Add fallback to alt attribute where image_tag filter is used * remove unnecessary use of alt attribute in image_tag filter --- sections/collage.liquid | 1 - sections/image-banner.liquid | 6 ++---- snippets/product-thumbnail.liquid | 12 ++++-------- 3 files changed, 6 insertions(+), 13 deletions(-) diff --git a/sections/collage.liquid b/sections/collage.liquid index 972b4e69f6e..abda584ea7e 100644 --- a/sections/collage.liquid +++ b/sections/collage.liquid @@ -31,7 +31,6 @@
{%- if block.settings.image != blank -%} {%- capture sizes -%}(min-width: {{ settings.page_width }}px) {% if section.blocks.size == 1 %}calc({{ settings.page_width }}px - 100px){% else %}{{ settings.page_width | minus: 100 | times: 0.67 | round }}px{% endif %}, (min-width: 750px){% if section.blocks.size == 1 %} calc(100vw - 100px){% else %} 500px{% endif %}, calc(100vw - 30px)}{%- endcapture -%} - {{ block.settings.image | image_url: width: 3000 | image_tag: loading: 'lazy', sizes: sizes, diff --git a/sections/image-banner.liquid b/sections/image-banner.liquid index ace4f8b8b93..77a81480351 100644 --- a/sections/image-banner.liquid +++ b/sections/image-banner.liquid @@ -51,8 +51,7 @@ height: image_height, class: image_class, sizes: sizes, - widths: '375, 550, 750, 1100, 1500, 1780, 2000, 3000, 3840', - alt: section.settings.image.alt | escape + widths: '375, 550, 750, 1100, 1500, 1780, 2000, 3000, 3840' }}
{%- elsif section.settings.image_2 == blank -%} @@ -81,8 +80,7 @@ height: image_height_2, class: image_class_2, sizes: sizes, - widths: '375, 550, 750, 1100, 1500, 1780, 2000, 3000, 3840', - alt: section.settings.image_2.alt | escape + widths: '375, 550, 750, 1100, 1500, 1780, 2000, 3000, 3840' }} {%- endif -%} diff --git a/snippets/product-thumbnail.liquid b/snippets/product-thumbnail.liquid index e8e30c789f6..337a50b7898 100644 --- a/snippets/product-thumbnail.liquid +++ b/snippets/product-thumbnail.liquid @@ -60,8 +60,7 @@ {{ media.preview_image | image_url: width: 1946 | image_tag: loading: lazy, sizes: sizes, - widths: '246, 493, 600, 713, 823, 990, 1100, 1206, 1346, 1426, 1646, 1946', - alt: media.preview_image.alt | escape + widths: '246, 493, 600, 713, 823, 990, 1100, 1206, 1346, 1426, 1646, 1946' }} @@ -72,8 +71,7 @@ {{ media.preview_image | image_url: width: 1946 | image_tag: loading: lazy, sizes: sizes, - widths: '246, 493, 600, 713, 823, 990, 1100, 1206, 1346, 1426, 1646, 1946', - alt: media.preview_image.alt | escape + widths: '246, 493, 600, 713, 823, 990, 1100, 1206, 1346, 1426, 1646, 1946' }} {%- endif -%} @@ -97,8 +95,7 @@ class: image_class, loading: lazy, sizes: sizes, - widths: '246, 493, 600, 713, 823, 990, 1100, 1206, 1346, 1426, 1646, 1946', - alt: media.preview_image.alt | escape + widths: '246, 493, 600, 713, 823, 990, 1100, 1206, 1346, 1426, 1646, 1946' }}