diff --git a/sections/cart.liquid b/sections/cart.liquid index 6d7e49841..f9e5f90bf 100644 --- a/sections/cart.liquid +++ b/sections/cart.liquid @@ -12,7 +12,7 @@ {% for item in cart.items %} - {% render 'image', image: item.image, url: item.url %} + {% render 'image', image: item.image, url: item.url, alt: item.image.alt %}

{{ item.product.title }}

diff --git a/sections/collection.liquid b/sections/collection.liquid index e5a786805..8ebf0a9b4 100644 --- a/sections/collection.liquid +++ b/sections/collection.liquid @@ -18,7 +18,8 @@ url: product.url, width: 400, height: 400, - crop: 'center' + crop: 'center', + alt: product.featured_image.alt %} {% endif %}
diff --git a/sections/collections.liquid b/sections/collections.liquid index db897a3dd..b84a8e7aa 100644 --- a/sections/collections.liquid +++ b/sections/collections.liquid @@ -19,7 +19,8 @@ image: collection.featured_image, width: 600, height: 600, - crop: 'center' + crop: 'center', + alt: '' %} {% endif %} diff --git a/sections/hello-world.liquid b/sections/hello-world.liquid index 839823ac0..733e08db6 100644 --- a/sections/hello-world.liquid +++ b/sections/hello-world.liquid @@ -18,7 +18,7 @@

- +
diff --git a/sections/product.liquid b/sections/product.liquid index 9664dfda5..50c7a0c7b 100644 --- a/sections/product.liquid +++ b/sections/product.liquid @@ -7,7 +7,7 @@
{% for image in product.images %} - {% render 'image', class: 'product-image', image: image %} + {% render 'image', class: 'product-image', image: image, alt: image.alt %} {% endfor %}
diff --git a/sections/search.liquid b/sections/search.liquid index 7177c1818..d547c2f5b 100644 --- a/sections/search.liquid +++ b/sections/search.liquid @@ -31,7 +31,13 @@
{% assign featured_image = result.featured_image | default: result.image %} {% if featured_image %} - {% render 'image', class: 'search-result__image', image: featured_image, url: result.url, width: 400 %} + {% render 'image', + class: 'search-result__image', + image: featured_image, + url: result.url, + width: 400, + alt: featured_image.alt + %} {% endif %}

diff --git a/snippets/image.liquid b/snippets/image.liquid index 9ea580a80..d5c1d7380 100644 --- a/snippets/image.liquid +++ b/snippets/image.liquid @@ -13,6 +13,7 @@ @param {number} [width] - The highest resolution width of the image to be rendered @param {number} [height] - The highest resolution height of the image to be rendered @param {string} [crop] - The crop position of the image + @param {string} [alt] - The image description @example {% render 'image', image: product.featured_image %} @@ -24,6 +25,7 @@ width: 1200, height: 800, crop: 'center', + alt: product.featured_image.alt %} {% enddoc %} @@ -45,7 +47,7 @@ href="{{ url }}" {% endif %} > - {{ image | image_url: width: width, height: height, crop: crop | image_tag }} + {{ image | image_url: width: width, height: height, crop: crop | image_tag: alt: alt }} {% stylesheet %}