Slater than Slate. Minimaler than minimal.
Clone the repo to your local environment
git clone [email protected]:the-couch/slater-theme.git theme
cd theme
npm install
or yarn install
We need to upload our initial build of the theme, we can do this by running npm run build
to compile the theme one time, from there we can zip the src
archive and upload it to our Shopify environment.
Duplicate the config-sample.yml
and grab the creds from your shopify theme.
In two separate windows run the watch command (this is to allow us to use our own build process on top of Shopify Slate).
npm run watch:assets
- watches js and css
npm run start
- manages theme refresh/upload
We're using operator to extend pjax style routing throughout the theme. This can be used to fetch/cache/handle transitions between routes. This can also help us init/code split specific javascript to specific routes (for example a flickity slideshow).
The code for handling this is found in lib/router
We use the afterRender
and beforeRender
methods for handling page transitions
To block a custom route add the no-ajax
class to the url element.
I think slate is awesome, but I don't like that it's a closed box, I love the flexibility of things like react-create-app because it let's you actually eject the project and extend it. So this is a bit of a hack but I think y'all enjoy it. If you don't like it though, you don't have to use it ;)
Slate is a really big step forward to Shopify theme development. However, we generally prefer Webpack to Gulp, vanilla js to jQuery, CSS to SCSS, functional to object-oriented, etc. We've removed the boilerplate in favor of nothing, and will be releasing packages to replace the functionality of Slate in the near future.