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.
Using this article as a guide and this one:
Setup
Basically what we will do is commit the source code into a source
branch and have the compiled code on the master branch:
1 | # rename current master to something else |
Publishing Steps
- Commit your new content to the source branch!!!
- Build your site from the
source
branch into/web
(your output folder). I’m usinggrunt
to do this step. - Checkout the
master
branch - Remove the existing content files from
master
- 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:
1 | git status |