Using Slate Deployment issue with Overwrites

We’re building a custom theme using Shopify Slate. The deployment is real time, but removes the Algolia App Add on files. Is there a repo somewhere that I can get the full set of files to add to my source control?

Thanks,
Devin

To answer your question : those assets are not available in a public form today. Indeed, they’re hosted on the same repo than our integration webserver, which we keep private for security reasons.

Algolia installs assets to your theme directly, which indeed makes the situation not ideal when you work with a theme management system (be it Slate or custom scripts with a git repo).

You will need to ignore at least one file, which is algolia_config.js.liquid.
This file contains settings that you set from the Algolia application which is why we don’t need to reinstall everything in your theme on every single setting change.
For instance, when you disable the autocomplete, the config will be updated with autocomplete_enabled = false, and algolia_autocomplete.js checks algolia.config.autocomplete_enabled to know if it needs to run or not.

To ignore this file with Slate, I believe you can simply add to your config.yml file an ignore_files entry.
Here are the docs: https://shopify.github.io/themekit/ignores/ (slate is based on top of themekit).

So you should be able to simply specify:

development: # or whichever environment is yours
  ... # other content
  ignore_files:
  - algolia_config.js.liquid

Then there are two other things to think about.

  1. The other files that we install
    For those, you can either:
    • Copy them to your local theme
    • Ignore them as for the algolia_config.js.liquid file
      All of our files are starting with algolia. So you could use a pattern like this one: /\/algolia/
  2. When we install Algolia in your theme, we also add a small block of code to the layouts you’ve selected in the installation process (by default, we select layout/theme.liquid).
    For those files, you’ll need to copy this snippet in your local version too.

If you’re using themekit, I believe you can simply call theme download which will copy all of our files and the layout files, effectively solving those two.
Otherwise, the copy operations will unfortunately need to be done manually.
You can download a zip of your theme, and copy them from there though.