Dan Harper

Binaries and Hexadecimals

A New Year, A New Site

January 01, 2011

It’s been a whole year since I last had what I could think of as a “proper site”, and not just a landing page with links to my profiles elsewhere on the web. It’s always such a challenge to create something for yourself and be 100% pleased with it. I must have gone through over 20 new designs which I get part-way through, decide I don’t like it any more and abandon it.

This time it’ll be different. I’m going into this new design knowing that I’ll probably be making slight changes to it every few weeks, constantly improving, constantly changing.

I’ve also never really blogged before as I’ve never been happy with the tools available. Previous versions of my site have been built on the WordPress blogging platform which I’ve also hacked a portfolio section in to, so it’s not that I don’t understand WordPress, but that writing a blog post in the WordPress dashboard is actually a horrible experiece.

There’s text boxes, checkboxes, sliders and buttons for a huge amount of settings cluttering up the ‘Write’ page from what’s most important: your content!

I was about ready to start work on my own little CMS/blogging script which would do content creation the right way when I discovered nanoc, a surprisingly flexible “static-site” generator which allows you to write your site using Ruby which will then be compiled into normal, static HTML pages which you can upload to your site. nanoc offered me:

  1. Freedom from a database – accessing it for every page request is slow and stupid, and a caching system is creating static HTML pages anyway…
  2. The ability to write my content into whatever format I please, using whatever text editor I choose. I’m formatting this post in Textile using MacVim and nanoc will filter this content through RedCloth to parse it into valid HTML.
  3. Version control with Git over not just my site’s files, but over my blog posts, too!
  4. No security holes! As no server-side code is being run, there’s not a chance of someone exploiting yet another hole in WordPress’ defenses.
  5. SEO-friendly URLs without any complex .htaccess rules or behind-the-scenes trickery – just normal files and directories!

And just to show off the simpilicity: this is how I’ll be backing up this post, publishing it to the site and pushing it to GitHub:

nanoc compile
        git commit -a
        git push origin master
        rake deploy:rsync

But I’m going to write a simple Rake task to make the whole process as easy as:

rake publish

I’m going to publish another post in a few days time detailing the process I took in both designing & developing this site.

I’ve also decided to open-source this site and I’ve released it on my GitHub profile along with my previous landing page design.

Post image courtesty of tetraconz – Flickr.