Skip to content

Instantly share code, notes, and snippets.

@neckerson
neckerson / article.liquid
Last active October 11, 2019 14:12
Parse Shopify blog articles with Liquid
{% comment %}
Here the article content is split by iframe and img tags, responsive Bootstrap
classes are added in, and then output to the page.
The Split filter removes the delimiter from the string. This functionality is
exploited to join the array elements back together with new HTML tags added
in.
Blog post: http://nateeckerson.com/2019/10/09/wrap-shopify-blog-article-images-with-css-classes-in-liquid.html
{% endcomment %}
@neckerson
neckerson / theme.js
Last active June 10, 2019 03:47
Expose jQuery $ in the window so it can be accessed by jQuery plugins
// In the root directory of the theme, install your plugin:
//
// > yarn add jquery-zoom
//
// Add the line below to the top of scripts/layout/theme.js
import $ from 'jquery';
// Below your imports, set up jQuery so that it can be accessed
// from the HTML