We are on the home stretch now! In this post, we are going to get a theme in a separate Github repo being pulled into our website.
Setup your Theme Repository
Make it a Submodule
Git submodules aren’t trivial if you’re not familiar with them. Check out this tutorial to learn the full scoop.
Here’s my short version for our case:
- Use the `git submodule add` command to clone and add your theme repository. Something like `git submodule add https://github.com/repo content/themes`
- Check the `.gitmodules` folder and make sure you’re using HTTPS and not SSH
- Commit your Ghost project with the submodule and you’re good to go!
Note on Submodules
I have been told that git submodules aren’t the best solution for having separate repositories. There are others like git subtrees, but submodules worked for me so I used them.
Test Locally Then Publish
Once you have the theme setup in your Ghost project, run it again and check to make sure you can use select it in the admin section.
Once you’re done publishing, as part of the deployment process Azure will pull the submodule theme, which is why we needed it to be https.
And now you’re done and you have your own theme.
Ghost is pretty cool. Easily the best blog engine I’ve enjoyed for myself over the past many years of trying to maintain a blog.
Anyway, hope this helps you as much as it did for me to understand Azure and NodeJS.