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)
To run the code, simply run:
node download_assets.js mainstore.myshopify.com
to download all the assets in your theme that are store on mainstore.myshopify.com
This is awesome, but I'm not sure what to enter for line 3 (path to settings file)... is this looking for an absolute path? relative? And how does one go about locating the full absolute path to the settings_data.json file? Thanks for your help...