Setup Jekyll for Github Pages
One of the great features of GitHub is that it allows you to host static content. This post looks at how this blog is published to GitHub.
Basically what we will do is commit the source code into a
source branch and have the compiled code on the master branch:
- Commit your new content to the source branch!!!
- Build your site from the
/web(your output folder). I’m using
gruntto do this step.
- Checkout the
- Remove the existing content files from
- Copy the new site content into the root project directory
- Add the new site content to git & push to origin
Here’s a script to do Step 3 onwards, which I call from
grunt after doing step 1: