I’m wondering how best to set up a local development environment to work on customizing a theme. I’ve read numerous posts on here, and followed not the author of this posts suggestion, but the followup comment suggestions: Developing Themes Across Machines w/ Git
That is:
- I already have my custom theme in a git repo
- Installed ghost locally:
ghost install local
cd content/themes
git clone https://github.com/mycustomtheme/
If this worked, I’d be able to make changes in the content/themes/mycustomtheme/ folder, see those changes locally, and commit them to my repo.
This does not work though, the theme does not show up in the admin panel Design → Installed Themes section, I assume because there are some ghost database items that get set when you upload a theme via the admin console?
So, is the best practice for developing custom themes the following? If we clarify here maybe this will help others in the future:
- Install ghost locally. You only need to do this one time:
ghost install local
- Once you have the beginnings of a theme, .zip it up, as described in the Ghost docs for creating custom themes. Upload this .zip in the admin console. This will generate a new folder in /content/themes/ Lets say we’ve named our theme “awesometheme”. This will generate a folder /content/themes/awesometheme/
- Make the entire /awesometheme folder a git repository
- Now you can make changes to your theme in /content/themes/awesometheme/ and see the changes locally.