From 330425875f7814ec5b3070b1520102eb46aeefd0 Mon Sep 17 00:00:00 2001 From: heyitsbryanm Date: Wed, 22 Mar 2023 18:12:56 -0500 Subject: [PATCH] Liquid template fix - Deprecates `includes` - Fixes `?` detection to not add a `?` or a `&` if `?` if detected. --- README.md | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/README.md b/README.md index 2dfbf3d..522d098 100644 --- a/README.md +++ b/README.md @@ -116,7 +116,7 @@ The second file adds a new Liquid tag that helps users generate imgix URLs. This {% assign imgWithQuerystring = "?" %} {% if src contains '?' %} - {% assign imgWithQuerystring = '&' %} + {% assign imgWithQuerystring = '' %} {% endif %} {% for _filter in filters %} @@ -157,7 +157,7 @@ After: ```liquid {% assign feat_img_url = product.featured_image | img_url:'master' %} -{% include 'imgix' src:feat_img_url w:600 auto:'format' flip:'v' %} +{% render 'imgix', src:feat_img_url w:600 auto:'format' flip:'v' %} ``` It's a good idea to always use the `master` variant of Shopify's images, and let imgix handle the resizing. That way, you'll always get the best quality image possible. Jason Bowman has created a [great demo page](https://freakdesign.com.au/pages/imgix-and-shopify-optimisation-demo) showcasing more potential uses of this tag. @@ -168,13 +168,13 @@ Here's another example of using imgix to easily build a responsive image using ` {% assign feat_img_url = product.featured_image | img_url:'master' %} My awesome product - {{ image.alt | escape }} + {{ image.alt | escape }} {% endfor %}