Skip to content

Instantly share code, notes, and snippets.

Building for Shopify

Jonathan Moore jonathanmoore

Building for Shopify
View GitHub Profile
jonathanmoore / seo-hacks.liquid
Last active Jul 19, 2019 — forked from willbroderick/seo-hacks.liquid
Shopify SEO - attempt to avoid duplicate meta descriptions
View seo-hacks.liquid
Change to make in theme.liquid
It adds a canonical tag for tag-filtered pages, back to the base collection/blog page.
*** Find this is the standard canonical tag code: ***
<link rel="canonical" href="{{ canonical_url }}" />
*** Completely replace it with this: ***
jonathanmoore / gist:c0e0e503aa732bf1c05b7a7be4230c61
Last active Aug 20, 2021 — forked from carolineschnapp/gist:1083007
Linked options helper methods for Shopify. See this: - Updated to work with sectioned themes (tested with District)
View gist:c0e0e503aa732bf1c05b7a7be4230c61
// (c) Copyright 2016 Caroline Schnapp. All Rights Reserved. Contact:
// See
// Modified by Jonathan Moore (Style Hatch)
Updated to work with sectioned themes
- Added required methods from the deprecated options_selection.js
- Triggers an initial variant change
- Hides sold out variants with only one option
jonathanmoore / make-image-change-javascript.js
Last active May 29, 2018 — forked from drabbytux/make-image-change-javascript.js
Make Image Change javascript (for theme.js file)
View make-image-change-javascript.js
$(document).ready(function() {
thumbnails = $('img[src*="/products/"]').not(':first');
if (thumbnails.length) {
thumbnails.bind('click', function() {
var arrImage = $(this).attr('src').split('?')[0].split('.');
var strExtention = arrImage.pop();
var strRemaining = arrImage.pop().replace(/_[a-zA-Z0-9@]+$/,'');
var strNewImage = arrImage.join('.')+"."+strRemaining+"."+strExtention;
if (typeof variantImages[strNewImage] !== 'undefined') {
productOptions.forEach(function (value, i) {
jonathanmoore / page.list-collections.liquid
Last active Jun 7, 2021 — forked from carolineschnapp/page.list-collections.liquid
Use entire file for the contents of page.list-collections.liquid. This specific version of the file was created to work with the premium Shopify theme District. Follow the guide at
View page.list-collections.liquid
<!-- /templates/page.liquid -->
<section class="page page-top">
<div class="wrapper">
<header class="content-util">
{% include 'breadcrumb' %}
{% include 'social-icons' %}
<header class="page-header">
<h1>{{ page.title }}</h1>
jonathanmoore / size-chart.liquid
Last active Apr 6, 2016 — forked from carolineschnapp/size-chart.liquid
size-chart.liquid snippet
View size-chart.liquid
{% if template contains 'product' %}
{% assign size_options = 'size,taille' | split: ',' %}
{% assign size_chart_text_link = 'Size chart' %}
{% assign has_size = false %}
{% assign size_index = 0 %}
{% for option in product.options %}
{% assign downcased_option = option | downcase %}
{% if has_size == false and size_options contains downcased_option %}
{% assign has_size = true %}
{% assign size_index = forloop.index0 %}

Make it real

Ideas are cheap. Make a prototype, sketch a CLI session, draw a wireframe. Discussions around concrete examples, not handy-waving abstractions. Don't say you did something, provide a URL that proves it.

Ship it

Nothing is real until it's being used by a real user. This doesn't mean you make a prototype in the morning and blog about it in the evening. It means you find one person you believe your product will help and try to get them to use it.

Do it with style

jonathanmoore / README.mkd
Created Nov 8, 2012 — forked from christophermanning/
Voronoi Diagram with Force Directed Nodes and Delaunay Links
View README.mkd

Created by Christopher Manning


Nodes are linked to nodes in neighboring cells. The cell's color is a function of its area.


  • Drag the nodes to interact with the diagram.
  • Use the mousewheel to add/remove nodes.
jonathanmoore / pinterest.js
Created Mar 26, 2012 — forked from 65/pinterest.js
pinterest buttons on every image in a blog post using jquery
View pinterest.js
$().ready(function() {
$('.entry-body img').each(function(){
var $permalink = $(this).parents('.entry').find('.permalink').attr('href');
$(this).wrap('<div class="pinme" style="' + $(this).attr('style') + '" />').after('<a href="' + $permalink + '&media=' + $(this).attr('src') + '&description=' + $(this).attr('alt') + '" class="pin-it-button" count-layout="vertical">Pin It</a>');
$('.pinme').hover(function() {
}, function() {