Blogging with Jekyll

RSS is dead, which as far as I can tell also means that blogging is dead. Now all the cool kids are hanging out in the twitterspace. So why start a blog now, you might ask. Hasn’t that ship sailed? Answer: it’s easier to be popular when there’s no competition. Or at least that’s what I hear. Crazy? Crazy like a fox, maybe.

There are hundreds of ways to get yourself online these days, and a really astounding array of ways to configure each of them. But if you enjoy twiddling and care about portability of content, the options shrink a bit. There’s still many dozens of choices, though. For reasons that are much better explained by the creator, I chose to build this site using Jekyll. It was quite a bit more fun than I expected, and in the interest of both supporting a cool product, and leaving myself notes for when I blow it up and have to recreate it, here’s how mine came together.

Components

First things first - get an amazon S3 account. Amazon’s Web Services offerings are going to run the world pretty soon, so you might as well get in early. S3 is an unlimited cloud storage folder that has a unique property: you can host a static website from it, no web server anything required. As with anything amazon, there’s a bit of a learning curve, but curl up with it for half an hour and you’re good.

Next, Jekyll. It’s a ruby tool that takes a folder on your machine standard website raw content and turns it into a functioning site, and it’s what makes this whole setup work. A testement to how cool this thing is: Werner Vogels, the Amazon CTO, uses it to run his own blog out of S3. Mr. Vogels runs his blog out of his dropbox folder so that he can get to it from any device, which is a brilliant use of dropbox.

That’s the extent of the infrastructure; the rest of it is just building an actual site. As you can probably tell, I’m not a web designer by any strech, so starting with a template of some kind was critical for me. The twitter bootstrap was way overkill for my needs, but a great way to dig into css3 without really knowing what I was doing. There are tons of bootstrap and template systems out there, for every need and temperment; you’ll find one that fits if you look.

Buildout

There are a couple crux moves to get the whole thing together. Both are things that are explained clearly in the documentation once I understood what I was reading, but it took some stumbling around first before I could understand the enlightenment of those who went before.

  • First, the way jekyll builds pages is different than a standard dynamic site generator (obvious, I know, but like I said, it took a bit). In Jekyll, you have a default layout that takes care of your header, footer, general layout stuff, etc - anything that stays the same page to page. And each one of your content pages gets shoved into that structure and then gets saved as a stand-alone page. So your post pages, your index page, your sidebar pages, and anything else yo’re runnin should all be text or jekyll text generation code only; if you’re putting structure into anything but your default.html page in the _layouts folder , you’re probably doing it wrong.

  • Second, Amazon is very touchy about how you name your buckets when you serve a website out of them. AT first I thought that the bucket just had to be named the same thing as your jekyll config file, and then you could point any arbitrary URL at it. Save yourself a few hours of headache: The name of the bucket must exactly match your URL to be served properly. So for this site, the URL is www.joepeyton.net; the name of the bucket is www.joepeyton.net. Yes, it would be nice if you could have an arbitrary bucket name. You can’t.

There’s a lot of reasons that you might want to have a dynamic site built on wordpress or blogger or tumblr or any of the other options out there. But before you commit, take a look at jekyll. You might find it’s exactly what you need.