Work is progressing on my blog-rewrite in Clojure. It's been lots of fun and I keep adding features. Hopefully not too many features; the whole point of ditching Wordpress is that it's far too bloated. But my new blog already has categories and tags and pages with parent pages and so on and so forth. One of these days I'll actually start using it publicly, maybe.
One issue with migrating away from Wordpress is not to break all existing links that point to my Wordpress blog. Most people with Wordpress blogs (including myself) seem to use some date-based permalink structure, which I'd like to avoid.
I thought I'd have to set up some horrid mod_rewrite thing after the switch, to avoid breaking links, but actually Compojure's routes are powerful enough. Any request that looks like a Wordpress permalink, I pass to a redirect function which spits out some redirect headers to the new location. Simple enough, just a few lines of code of this sort:
(defn old-blog-redirect [name] (redirect-to (str "/blog/" name))) (defservlet blog-servlet (GET "/2009/:m/:d/:name/" (old-blog-redirect (route :name))))
This redirects e.g.
Focusing so much on dates is kind of silly. A lot of blogs have a sidebar with a little calendar, or have a list of links to archives of all their posts by month. How useful is this really? Never once have I read someone's blog and thought "Wow, nice post. I wonder what this guy said in November of 2007. Good thing there's a link right there on the front page!"
Does anyone really care enough about the date something was posted, that the date needs to be encoded in the URL? The way I see it, the only thing people are going to use a date in a URL for is to say "That's too old, so I'm not reading that". How many people are going to be persuaded to read your blog by noticing (based on the URL) that a post is brand new, where otherwise they wouldn't have clicked the link? I have to think not many.