- Install
liquid-validator
:sudo gem install liquid-validator
- Put the contents of the liquid file you want to try in a file called
liquid_to_test.liquid
. - Put the
test_liquid.rb
file in the same folder. - From that folder, run
ruby test_liquid.rb
in the terminal
require "json" | |
require "net/http" | |
require "uri" | |
require 'yaml' | |
uri = URI.parse("http://restcountries.eu/rest/v1/all") | |
http = Net::HTTP.new(uri.host, uri.port) | |
request = Net::HTTP::Get.new(uri.request_uri) | |
response = http.request(request) | |
// If the script doesn't work, uncomment lines 5 and 32-33 below, and login to shopify. After one whole successful script run, you can comment back these lines. | |
// This is made to be hooked to a deploy script | |
var nightmare = require('nightmare')({ | |
// show: true, | |
waitTimeout: 50000, | |
webPreferences: { | |
partition: 'persist: shopify' | |
} | |
}); |
var obj = []; | |
var translations = $(".translation-form-container textarea") | |
$('[id="asset-translation-area"]').each(function(object) { | |
obj.push({ | |
key: $(this)[0].previousElementSibling.textContent, | |
original: $(this)[0].textContent, | |
translation: translations[object].value | |
}) | |
}); | |
var downloader = $("<a id='download-file' href='' download='langify-sections-translation.json'></a>") |
Given yarn build
being your regular build script,
netlify.toml:
[build]
# Our default build command
command = "./install-latex.sh 'yarn build'"
Any script run by yarn build
will have the regular LaTeX executables available in PATH (pdflatex, etc.)
Go to https://{{your_shopify_domain}}/admin/themes/{{your_theme_code}}/language?category=checkout+%26+system
Open your browser console and paste this code:
var obj = {};
$(".translation__target").each(function() {
var value = this.children[0].value ? this.children[0].value : this.children[0].placeholder
It's hard to migrate section themes that rely heavily on images. This bit of code helps you download all the CDN assets of your theme.
- Create a
cdn_assets
folder - Create the
download_assets.js
file at the root of your project - Edit the
download_assets.js
file to match the path to your settings_data.json (line 3) - Edit the
download_assets.js
file to set the "CDN code" of your store. Each file that you upload from/admin/settings/files
gets uploaded with the following format:https://cdn.shopify.com/s/files/1/YOUR_CDN_CODE/files/YOURFILE
. The format of the code is/\d{4}\/\d{4}/
(four digits, a forward slash, and four digits)
- Go to your Shopify
admin/settings/files
page - Open your browser Dev tools, go to the console
Then, depending on the option you choose:
- Make sure your browser is set to download files automatically and doesn't ask for the download location every time
Sendy woudln't be the Mailchimp killer without a proper Shopify integration. There we go, thanks to the Shopify gem and some ActiveRecord awesomeness.
NB: The script always keep in sync Shopify's accepts_marketing field with Sendy's unsubscribed field. I added custom fields like country and order count as an example of what we can do with it.
First make sure that you have the right ruby install (with rbenv for instance), with the right gems installed
(like activerecord
, shopify_api
, etc) and the right mysql packages for the activerecord adapter;