Skip to content

Instantly share code, notes, and snippets.

@IliasHad
Created November 27, 2019 08:02
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save IliasHad/2c7fc223c4ae27414f4810674ce35ed6 to your computer and use it in GitHub Desktop.
Save IliasHad/2c7fc223c4ae27414f4810674ce35ed6 to your computer and use it in GitHub Desktop.
Accepts:
- max_width: {Number} Max width of the image container
- max_height: {Number} Max height of the image container
- image: {Object} Image object
- image_class: {String} class name of the <img />
- image_attributes: {String} additional HTML attributes of the <img />
- wrapper_class: {String} class name of the <div> wrapper
- wrapper_attributes: {String} additional HTML attributes of the <div> wrapper
Usage:
In your liquid template file, copy the following line
- {% include 'responsive-image' with image: featured_image, image_class: "css-class", wrapper_class: "wrapper-css-class", max_width: 700, max_height: 800 %}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment