Yeoman Generators & the Static Love

So the other night I was laying awake thinking about my blog. I haven't done much with it for a while, and it's starting to weigh on my mind how awkward it's become to maintain and I was wondering whether it was worth a switch to another platform.

While I really like Wordpress and Silverstripe, one thing that I've been really getting into of late is Node.js and the software ecosystem that brings. In particular NPM is a really fantastic dependency/package manager that does everything right.

So over the course of the next two to three insomnia-driven hours I exported my Wordpress database and rendered out a new, static version of this site using Node and various other packages.

Gotta love a static site…

The speed increase alone is awesome, but the thing that impresses me most is that all the functionality available in various packages out of the box makes it crazy easy to implement stuff really quickly.

Some of the packages I used include:

  • Handlebars for rendering out templates (this is way cleaner and easier than making Wordpress templates).
  • Moment.js for date handling.
  • marked for rendering Wordpress' semi-HTML out into proper HTML. The benefit of this is that I can also use Markdown from now on if I like.
  • typogr for typography related functions. This is inspired by django-typogrify which also inspired wp-Typography which is a must-have WordPress plugin.
  • Yeoman for easily creating new posts on the command line. I wrote a custom generator because I'm a bit of a cowboy and didn't really like any of the existing solutions.
  • Where to now?

    One of the things I really want to do now is implement a template system so I can create pages as well as regular posts. This was one thing that was really lacking in WordPress, the ability to create powerful metadata-driven content that looks good on the frontend.

    I'm not saying WordPress is bad at this, rather it takes a lot of time to set up well and it's annoying to test in a staging environment. On the flip side, this static site setup means I can render out content on my local system, tweak the templates and get the exact look I'm after without having to "cowboy it" on live code, which is what I'd inevitably end up doing on my old Wordpress blog.

    I've also got non-concrete plans to integrate Google+ and Twitter into my site more, since those are the places I'm creating most of my content these days.