Migrating from WordPress to Github Pages – Blog by Ben Clark-Robinson

This blog was recently running on a self-hosted WordPress site and found myself dispirited by the user experience of WordPress. For all its flexibilty and functionality I would find myself shying away from blogging for the following reasons:

  • The tools for writing and editing posts – although always improving – compare poorly to my favourite text editor(s),
  • Maintaining security updates and plugins is such a constant frustration,
  • All those posts aren’t in any form of source control but instead a MySQL database that needs a backup strategy,
  • WordPress was missing the fun factor.

After looking around at several options I decided on using Github Pages with Jekyll. This option was going to help on all of these points. I can use my favourite text editor(s) with Markdown, no more reminders for security updates, git replaces the DB, and the fun factor is back. Yay 🙂

Here’s my notes to getting started with Jekyll and Github pages.

Setting up Jekyll on OS X Yosemite

First up let’s setup OS X Yosemite so that we can get Jekyll running. To do this we’ll need to install a few components so that we can compile the dependancies. Open a terminal window and execute:

xcode-select -install

Note: I’m using the verion of Ruby that ships with Yosemite and won’t cover using Homebrew or RVM etc.

Install Jekyll by using a terminal window again to execute the command:

sudo gem install jekyll

Recommended reading

Setup a Github Page

  1. Follow the guide from Github, it’s really easy to follow along.
  2. Don’t forget to add a .gitignore like this otherwise you’ll accidently commit the _site directory.

Pick a theme

Start posting

  1. Create a _posts directory in the repo,
  2. Adding a file like YYYY-MM-DD-this-is-my-post-title.md into _posts,
  3. Ensure that the Front Matter header is at the top of the post http://jekyllrb.com/docs/frontmatter/,
  4. For more info read along with the Jekyll docs.

Setting the DNS for GitHub Pages on Namecheap

To complete the migration I followed these articles to configure github with a custom URL:

Good luck and have fun. 🙂

Til next time,
Ben at 15:41

Back to top