Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion sections/cart.liquid
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
{% for item in cart.items %}
<tr>
<td>
{% render 'image', image: item.image, url: item.url %}
{% render 'image', image: item.image, url: item.url, alt: item.image.alt %}
</td>
<td>
<p>{{ item.product.title }}</p>
Expand Down
3 changes: 2 additions & 1 deletion sections/collection.liquid
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,8 @@
url: product.url,
width: 400,
height: 400,
crop: 'center'
crop: 'center',
alt: product.featured_image.alt
%}
{% endif %}
<div class="collection-product__content">
Expand Down
3 changes: 2 additions & 1 deletion sections/collections.liquid
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,8 @@
image: collection.featured_image,
width: 600,
height: 600,
crop: 'center'
crop: 'center',
alt: ''
%}
{% endif %}

Expand Down
2 changes: 1 addition & 1 deletion sections/hello-world.liquid
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
</p>
</div>
<div class="icon">
<img src="{{ 'shoppy-x-ray.svg' | asset_url }}" width="300" height="300">
<img src="{{ 'shoppy-x-ray.svg' | asset_url }}" width="300" height="300" alt="">
</div>
</div>
</div>
Expand Down
2 changes: 1 addition & 1 deletion sections/product.liquid
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

<div class="product-images">
{% for image in product.images %}
{% render 'image', class: 'product-image', image: image %}
{% render 'image', class: 'product-image', image: image, alt: image.alt %}
{% endfor %}
</div>

Expand Down
8 changes: 7 additions & 1 deletion sections/search.liquid
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,13 @@
<div class="search-result">
{% 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 %}
<div class="search-result__content">
<p>
Expand Down
4 changes: 3 additions & 1 deletion snippets/image.liquid
Original file line number Diff line number Diff line change
Expand Up @@ -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 %}
Expand All @@ -24,6 +25,7 @@
width: 1200,
height: 800,
crop: 'center',
alt: product.featured_image.alt
%}
{% enddoc %}

Expand All @@ -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 }}
</{{ wrapper }}>

{% stylesheet %}
Expand Down
Loading