24 May 2015
Migrating from Wordpress to Github Pages
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:
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
Setup a Github Page
- Follow the guide from Github, it’s really easy to follow along.
- Don’t forget to add a .gitignore like this otherwise you’ll accidently commit the _site directory.
Pick a theme
- Search around for Jekyll themes. For this blog I settled on https://github.com/muan/scribble,
- Fork or add it to your Github page repo.
- Create a _posts directory in the repo,
- Adding a file like YYYY-MM-DD-this-is-my-post-title.md into _posts,
- Ensure that the Front Matter header is at the top of the post http://jekyllrb.com/docs/frontmatter/,
- 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:
- http://davidensinger.com/2013/03/setting-the-dns-for-github-pages-on-namecheap/ and
Good luck and have fun. :)
Til next time,
Ben at 15:41