God is in the Details

So I wasn’t content with just a few minor tweaks to the site. Over the last few days I’ve done some interesting things with TXP (oo-er, missus!), so I thought I’d share a little.

One thing that I wanted to have was different URL schemes appropriate to the different sections of the site. The about section would have ”/about/article/”, projects would have “projects/project/” and the blog would have ”/blog/yyyy/mm/dd/post-title/”. The first two are simple enough to do, and all sections in the site have followed a similar scheme since launch. My desired blog URL format can’t be done in a base TXP install. I was too lazy to spend the time needed to put the neccessary hacks in place. Then I was inspired by a concept mentioned on another site. I wanted to implement this idea somehow, but it would need the dated URL’s to work. Time to get off my arse and get to work.

Implementing the dated URL’s was surprisingly easy enough. I’ll write up the hacks in detail later. The main time consumer was coding the plugins to ensure that the blog section outputted permalinks/comment invites and paging links in the correct format. Another bit that held me up was working out the mod_rewrite rules.

The implementation will (hopefully) let me do some interesting things with the archives. I think that the default handling of archives is a bit sloppy in TXP, so it should let me improve on things. For example, /blog/yyyy/ returns all posts in a year, while /blog/yyyy/mm/ returns all the posts in a certain month of a certain year, and so on.

%d bloggers like this: