Moving to Jekyll and Github Pages

I recently redesigned my site and in the process moved from Wordpress to Jekyll. I also moved to Github Pages for hosting, because 1) it’s free and fast, and 2) there’s just something appealing to the programmer in me about publishing by committing changes to git.

Jekyll

Jekyll is a static site generator. In other words it creates a site of static html pages from your files and templates. That’s different from a CMS (content management system) like Wordpress which dynamically assembles web pages “on the fly” every time they are requested. A statically generated site is great for performance. For a small, personal site it doesn’t make much sense to dynamically build every page every time it’s requested—especially when the pages aren’t updated that frequently.

Jekyll is also “blog aware”, so it handles things like post, permalinks, tags, categories and pages all out-of-the-box. You write your posts in markdown—which has always appealed to me because of it’s simplicity—and put a little yaml front matter at the top. Run Jekyll with the following command and, voila, you’re site is built.

$ jekyll build

Jekyll uses the Liquid templating language. Liquid uses simple markup for basic template logic like loops and includes. It also has filters to manipulate output—like formatting currency and dates.

All in all Jekyll is simple to use and has excellent documentation. If you love markdown and blazing fast sites, you should give Jekyll a whirl. …And if you have an existing site currently in another CMS, there’s a good chance you can migrate it to Jekyll with one of their importers. They have site importers for most of the major CMS’s out there.

Github Pages

Once I rebuild my site in Jekyll, I decided to move it to Github Pages. Github Pages is Github’s free web hosting platform. In a nutshell you just create a Github repo for your site, commit your Jekyll-based site to the repo and it automatically gets built. You get one site for your Github account and an additional site for each project you have.

Workflow

This post is actually my first post since migrating the site, so I’m still trying to find a workflow that suits me. I’m writing this in Writer Pro, which I really want to like, but I’m just not sure if it’s the right tool for the job. For one thing it automatically converts three dashes to an em dash. That’s normally a nice feature, but yaml front matter is delimited by three dashes, so that causes a problem when Writer changes those to a single em dash. I’m also not totally sold on Writer’s “Workflow” feature. We’ll see. I may just write in Sublime Text.

I’m also thinking about creating an auto-build process—some sort of one-click publish to make posting easier from my phone or iPad. I’ll write a follow-up post if I create something I like.

So in summary… if you have a personal site, and you’re comfortable with Github (even marginally so), give Jekyll and Github Pages a try. Worst-case scenario, you learn something new. :)

comments powered by Disqus