Hosting a blog on Github Pages with Jekyll
I found myself wanting to create a blog to record the steps along the way as I set up more self hosted services. There are various options with the most common being wordpress. Being at my parents home for Thanksgiving this week I wanted to get started with something I could start with hosting on the cloud as I don’t have access to my home server setup. Also I’m cheap so I didn’t want to pay for hosting. Github pages seemed like a great option combined with the static site generator Jekyll. It works quite well once you get it set up, the development/deploy process goes something like this:
- update one of the markdown files defining a post or homepage
- run
bundle exec jekyll serve --livereloadto build and serve the site atlocalhost:4000 - commit and push changes to github
and thats its.
I’ll link the setup guides I used here for those who would like to try the setup themselves. There were a few small snags in setup around getting the ruby to install properly (locking the right openssl version for example). But after googling through a few issues it was up and running within 1 hr.
One issue I ran into that had a quick fix:
Upon running
bundle exec jekyll serve --livereload I got the error:
bundler: failed to load command: jekyll (/Users/USERNAME/.gem/ruby/3.1.3/bin/jekyll)
This is fixed by running
bundle add webrick
before trying to build the site again.