Evan Rose

Home | About | Blog Archive | Contact | RSS | Work | Facebook | G+ | Instagram | Linkedin | Tumblr | Twitter

Blog Archive



Monday, November 4th, 2013

Giving the Site a Haircut

Recently I refactored almost all of the code that powers the backend of this site, a lot of which has been around for however long it's been since I built the content management system that powers it (and perhaps before - I had another blog that I ran on my Mac out of my apartment when I lived in Oakland whose code made its way into this site). Tired of being the cobbler whose kids have no shoes.

First, permalinks. They have always been something like evanrose.com/?entry=100 which I thought was cool back in the day (hey, I know PHP!) but long past their sell by date. I built a system that turns the blog post's title into a slug and am using those for permalinks (and being a good web citizen, should someone come into the site via a link to a post with an entry id, they will get seamlessly redirected). Secondly, I changed an .htaccess redirect that would, for example, redirect evanrose.com/work to evanrose.com/?section=work. This has been changed so that all requests end up on index.php and the non-query-stringed URL is split and used. Even the HTML templates I used before I entered blog posts in to a database work with this new scheme (for the most part, at least they're used in the virtual blog directory) for instance, my first month of blogging on evanrose.com (and not on my previous sites) in July of 2001 and without touching that templated file, it validates as HTML 5!

Finally, back in the day, I didn't know about how to deal with dates and math and whatnot coming from a database so my noob self saved date oriented data like so: insert "Tuesday" into `day name`, etc., which is just NASTY. I was young and I needed the money. Fixed all that garbage (and should have years ago). I also fixed a bunch of hacky crap to deal with page titles and whatnot which was also trivial. It was pleasant work cleaning this business up and by god it might last me another ten years.

Please don't make me be blogging in ten years.

evanrose.com permalink