Ghost 0.5.x from Source to Azure Web Sites–Part 3

This is part 3 of 3 of a blog series where David Wesst takes you through getting Ghost 0.5.x working from source control on Azure Websites. Read part 1 here and part 2 here.

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

Create a repository for your Ghost theme. You can start one from scratch or fork the Casper theme or fork one of the free themes on the marketplace that are open source, like Stay Puft.

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:

  1. Use the `git submodule add` command to clone and add your theme repository. Something like `git submodule add https://github.com/repo content/themes`
  2. Check the `.gitmodules` folder and make sure you're using HTTPS and not SSH
  3. 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.

image

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.

image

And now you're done and you have your own theme.

The Point

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.