For quite a while, best practice has been to avoid editing themes installed from a remote Git repository locally on Discourse. Any changes to theme code or uploads get wiped out when updating the theme from the remote repo.
In this commit, we’ve removed the ability to locally edit a remote theme and are now enforcing this best practice in Discourse.
What happens if I have a remote theme with local changes?
Nothing at this point. Your theme stays as is until you remove it or update it from remote.
How do I keep my local edits?
If your changes are CSS only:
You can copy your CSS-only changes to a brand new local theme component. To do so:
- Click Install
- Click Create new
- Click the Edit button in the right pane.
- Copy your CSS changes into the proper file (common/mobile/desktop).
- Save and enable the theme component.
- Update your remote theme to overwrite the local changes and avoid duplicate CSS.
If you’ve changed more than CSS (JS/Templates):
We recommend if you wish to keep your local edits to transition the theme to a local theme. To do this:
- Open the theme under Admin > Customize
- Click Export to download the theme with your local changes.
- Click Install under the theme list, then
From your device
- Upload the exported theme, install and enable as previously.
The other option for those interested is to fork the remote theme on GitHub, commit your changes to the forked repository, and install that fork on your Discourse instance. This enables the option of rebasing your changes on top of any future updates to the main repository, which converting to a local theme does not offer.
Lastly, be sure to remove the remote theme to avoid duplication of changes and confusion in the future.