Switched to Jekyll
Posted on Wednesday, October 07, 2009
A few weeks back, when the latest WordPress Attack was underway, I posted to twitter, “This WordPress attack has me itching to switch to Jekyll. Nice, simple flat files.” I was halfway joking at the time.
Jekyll is a “blog-aware, static site generator”. It’s kind of an old-fashioned idea as far as blogging is concerned. In fact, the very first blogging platform I ever used was called iBlog. It was an OS X application that generated an HTML site on your local Mac and then synced with .mac (now called MobileMe). One of the biggest perceived positives when I switched to WordPress was that it cut out this syncing process: pages were generated dynamically on the web server. This was so cool!
It still is cool, actually. I like WordPress. My paycheck comes from managing a WordPress site. But for my personal blog, I’ve been growing tired of WordPress. Here’s why.
Two kinds of blogging
For the past few years, I’ve been trying to make my blog the archive of everything I do online. I joined Twitter, so I started importing my tweets as blog posts. I use Delicious and Google Reader, so I’ve imported my Shared items from each into my blog as well. The basic idea, really, is that I wanted to do what Tumblr was doing on my blog: make it really easy to post all kinds of content, and display them in a content-appropriate format. It was fun building my own theme and learning how WordPress worked as I went.
There are really two kinds of blogging I’ve been doing: writing and sharing stuff (links, quotes, videos, etc.).
For writing, WordPress has always sucked. So has every other web-based blogging platform though. Writing in a <textarea> just sucks. People put up with it for all the other niceties a dynamic, browser-based interface gets you: comments, access anywhere, plugins, etc. But it sucks. As a workaround, I usually just wrote in a text editor and then pasted the text into WordPress when I was ready. I toyed with blogging clients like MarsEdit but never really enjoyed using them.
This has been made worse by the fact that I’ve been trying to write more lately. I’ve found that when I write more for my blog, I have a much easier time writing for other things. Like the dissertation I desperately need to write. So I decided I needed to write more. Even if it was about obscure guitar hacks, or silly dreams. I just needed to write more.
For the sharing stuff type of post, well, WordPress works just fine, I guess. But because I’d always appreciated Tumblr from the outside, I decided to give it a try, and I really like it. The bookmarklet is smart & works well. The iPhone app is really nice. And I don’t have to use weird custom fields and categories to indicate that a post is a video, or a link, etc.
Plus I actually read through some old posts on my blog. Oh my. On the one hand, it’s nice to have access to this old stuff myself. It’s nice to be able to go back and see progress: I’m a much better writer now. I’m a much clearer thinker now, too. I think. But on the other hand, is this something I really want the entire world to be able to witness as well? Does this really need to be out there?
It is fascinating to subject yourself to this kind of review. For many posts I wrote in 2003 and 2004, I remembered the title and thought, “Oh, I liked this post.” Three paragraphs in: it was like it was written by someone else. Someone else who is stupid and inarticulate. Around 2006-2007, the author of these posts starts to look more like the self I know today. But I have to wonder: in a few more years, will these posts be as bad?
I don’t want to go on about this too much, but I do have a theory for why my writing has improved in recent years: I’ve gotten into audiobooks. Until the last few years, I almost never read something that wasn’t for school. And sociologists aren’t exactly known for being good writers. Now, I’m a total audiobook junky, and I’m pretty much always working through one (and often two at the same time). Now I don’t listen to classical literature or anything that will impress my old English instructors. But it’s still better writing than I can muster, and I really think listening to good writing has helped me become a better writer myself.
So, getting back on track, over the last few months, three things came together for me:
- I decided I needed to write more. I didn’t like writing in WordPress.
- I decided I wanted a blog for writing and to just use Tumblr for micro-blogging.
- I decided I needed to clean out my blog’s archives.
I also realized one other thing: I just wasn’t excited about updating my WordPress theme. Again. If I was going to redo my site again, I wanted to learn something new. Sometime last summer, in a fit of productive procrastination on a lazy Saturday afternoon, I started learning the basics of Ruby. I really liked it, but just had no reason to use it: everything I worked on then was in PHP. So I spent a few hours with it and then moved on. When I looked into Ruby-based blogging software a few months back, I found Jekyll.
jekyll
I’m writing this post in my text editor of choice (vim), marked up in markdown and stored in a git repository I keep in my Dropbox. When I’m ready to publish, I’ll just run git commit and via a post-commit hook, the new post will be uploaded to my web server.
There are several wonderful things about this:
- My entire blog is available on all my computers. I can write and edit posts using just plain files and a text editor. If I’m on a computer that is not my own, I can just ssh into my computer at home and write in vim within a terminal window.
- When writing (or editing my templates), I can run jekyll on my local machine and view my blog by pointing a browser to
localhost:4000. This works no matter where I am, how flaky my network connection is (or how slow my web host is at the moment). - To search my blog, I can just grep through my
_postsdirectory. How cool is that?
If you aren’t following this so far, Jekyll probably isn’t for you. Go use Tumblr. Or posterous. Or wordpress.com. Seriously, the world is not short on good blogging software.
Jekyll is “blogging like a hacker”. This doesn’t mean it’s necessarily hard to use though. The templating is lightweight, but powerful & flexible enough to do most of what you need with a blog. It’s definitely easier than writing a WordPress theme! Writing in Markdown is much easier than writing in HTML or, IMO, than fighting with a stupid WYSIWYG editor (I’ve never had luck getting any of the WordPress Markdown plugins to work).
Also, the culture and community around Jekyll is great. Github supports Jekyll sites, so there are many Jekyll sites hosted on github, with full source for all to see. Putting together this site was as simple as browsing through those sites, finding things I like and then borrowing profusely. I intend to put this blog on github as well soon, but I need to clean some stuff up first. The source for this site is here on github. (I just put the configuration and templating files up, skipping the _posts, _drafts and files directories. You can actually host your Jekyll blog on github, which I may or may not do someday. I still use my web host for other things, though I do like the idea. In the meantime, I don’t want to push everything I do to github.)
There are downsides. No comments, for example. I could use something like Disqus, but I don’t really mind not having comments. (It’s not like I had a ton before anyway.) If you want to respond, just write a blog post yourself & link back. Or email me if you want to reply to me directly. We’re really not hurting for avenues of communication these days.
moving from wp
So returning to my tweet at the beginning of this post, I decided to actually try Jekyll on my MacBook, just to see if I’d like it. (The security issue really wasn’t a factor: it just inspired the tweet, which inspired another look at Jekyll.) Within 20 minutes, I had a basic test site running on my MacBook. Next I tried the Wordpress importer and, well, then I had all my posts imported. Well, I might as well switch at that point, right?
(Though, to be complete in case would-be switchers find this post: 1) The MySQL and Sequel gems required for the converter wouldn’t play well together for me on my Mac, but worked just fine in an Ubuntu VM. 2) The WordPress converter doesn’t import categories and tags.)
Really, that’s pretty much how it happened. An unintentional side effect of importing all my posts into Jekyll is that I now had nice plain text files of all my posts, which made reading through them and removing the ones I didn’t want to keep much easier than it actually would have been in WordPress. Plus, I now still have them all in a separate directory, in a completely readable format instead of in a SQL file. After I’d done that, then all of the sudden my Jekyll blog was more up-to-date than my WordPress blog, so I’d sort of already switched without realizing it.
Cleaning out the old posts took awhile, and then, of course, I spent a lot of time tweaking the site in my spare time over the last week or two. But I’m happy with this so far. When I feel up to tweaking the site a bit, there’s a lot of stuff to learn. Stuff that doesn’t start with wp-, and that’s exciting. But when I feel like just writing without distractions, this should work well then too.