Projects

Static Serving this Blog with Hyde

Last week, I converted my blog from WordPress to Hyde.

Blogs are fairly straight-forward bits of software. Because of this, and the fact that everyone and their mother has a blog, building a blogging platform has become a sort of Hello World for showing off new programming languages or frameworks. Static site generators are starting to become more popular, too, because Amazon has made serving static content stupid-cheap with S3. The first big time static blog generator was Jekyll (at least that I’m aware of), which is built using Ruby on Rails. Not to be outdone, someone in the Python community made Hyde.

I chose Hyde, because I’ve been writing exclusively in Python for over a year, so I decided to use a Python based framework, so that I could patch it as I saw fit. This seemed like a bonus at the time I was making the decision, because I’ve never used a static site generator before, and I wasn’t sure how developed they are.

It turns out that wasn’t really necessary. Hyde is very well thought out. It supports everything I was looking for:

  • RSS
  • Markdown
  • Tags

I am very happy with this new setup. WordPress is great, but it’s total over kill for a single-site, single-user blog. But my favorite thing about using a static site generator is this: git.

I’ve hosted blogs on Blogger, Tumblr, WordPress, and probably a bunch of other platforms, and they all support exporting data. But it’s always in an ugly format; typically a giant XML file. Since a blog is just a bunch of straight HTML files in most, if not all, cases, there’s no reason to do that.

Git is perfect for this. Clone the repo and pull from time to time and you have a full backup, push on your laptop & pull on your server and you’ve made a new post, and of course any changes you make to posts will be tracked – git is a version control system after all.

I love how minimal this setup is; in terms of overhead & storage, maintenance, updating, and of course in actual appearance. Hyde comes with a functional CSS layout, but it’s not really what I wanted. I ripped those CSS files out, and used Twitter’s Bootstrap instead, and I think it looks great.

Hyde is also capable of serving what it generates. This is another massive advantage. When I want to preview a post in the making, I can run Hyde locally to see the changes as they happen without pushing to the server every time. Sure, most blogging platforms have a preview function, but I can do this no matter where I am – even without an internet connection.

I made some other tweaks to the generic layout, too – moving the tags and prev / next links to the bottom. Dealing with YAML is a bit of a pain. All in all, though, Hyde is great. But even if I decide to move to another platform, I won’t have to deal with nasty XML exports – it’s all in a bunch of plain text files, in a git repo. At most, I’ll have to rip 5 to 10 lines of meta text out of the top of each post’s file.

This is awesome.

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s