Blog Upgraded. Finally
Today I replaced my oldest production Rails app: this blog. For the past four years I’ve been running Mongrel 0.7.3 on Rails 1.2.3 and, while it was just what I needed in 2006, I’m delighted to spin up Nesta instead. I also replaced a more recent Rails app which ran the non-blog parts of the site.
Now I have half a megabyte of text files instead of a 142MB MySQL database; one app instead of two; the low memory usage of Sinatra under Passenger rather than 70-150 MB of Mongrel; and the colour blue (more below).
I had two questions when deciding what to use: static or dynamic? And comments or no comments?
Static versus dynamic
A blog is not complicated: you have articles, perhaps comments, a few fixed pages, and maybe some tags. Indeed DHH marketed Rails heavily with a create a blog in 15 minutes video. It’s easy to write your own blog.
Yet blogs are not interactive, apart from comments, so it’s more efficient to generate their static HTML on deployment and leave it at that. No code is faster than no code. Furthermore you can edit your articles in your favourite text editor, use proper version control, and so on.
But as Geoffrey Grosenbach said,
I find it more natural to write it in a dynamic style.
Comment or no comment?
There are good reasons for and against comments. I always like being able to comment on others' blogs and I appreciate all the comments people have left on mine, especially the last one:
You, sir, are a scholar and a gentleman.
William Jones (bottom of the page)
So I went with Nesta. I’d already customised Nesta elsewhere and I wanted to customise it differently this time. Rather than fork Nesta twice I’m maintaining long-running branches in Git. It works well.
I found the distinction between pages, articles, and categories slightly confusing. Basically an article is a page with a date, and a category page is a page for other pages and articles in the category. I didn’t like having to create a page for every category so I rewrote it. Part of Nesta’s appeal is the ease with which you can hack it to do what you want.
The only questionable part of Nesta is its inbuilt page-caching code. I’d prefer to use HTTP caching but, really, that can wait for another day.
I am inordinately pleased to introduce a highlight colour to the existing palette of greys, black and white: blue! Or maybe it’s lavender. Indigo? Anyway, the particular shade comes from Derek Powazek’s site. I toyed with the blue from Tim Lucas but it was just wrong for here.
This is exciting because I found Mephisto’s theme management system so offputting that I couldn’t ever bring myself to change the CSS. Or indeed the markup. Now I’m writing HAML, SASS, and Markdown as God intended.
Since I’m back in control of my site, I decided to try out HTML5. Mark Pilgrim’s Dive Into HTML5 is lucid and informative, and I’m enjoying HTML5 a lot. So this site is coming to you in HTML5. I haven’t yet switched to the new semantic elements but that’s next.
The hardest part of all this was setting up the rewrite rules in Apache to redirect my old URLs to the new ones. I don’t do this often enough to remember the pitfalls and I always fail to work it out on my own. If you do stoop to reading the instructions, this article sorted me out.
Anyway, let me know if I broke anything.