I spent a lot of time last night adding pretty URL functionality to this site. What used to be a most hideous construction:
http://www.mattryall.net/article.cgi?id=322
is now a beautiful meaningful URL:
http://www.mattryall.net/blog/2008/07/coding-idioms
The most obvious effect for most readers is that probably all the items in my feed will have refreshed. This happens because I’ve updated the URLs of the items in the feed. It should not happen again.
All the old URLs should continue to work indefinitely. However, you will get redirected with a permanent redirect to the correct URL should you stumble across an old link.
What hasn’t been done yet is to make the URLs hackable. So you can’t yet visit /blog/2008/07/ and get all the articles for this month. That will be done sometime soon.
At the backend, it took a significant amount of work to implement this from scratch:
/blog/* to /article.cgi?url=* on the serverfetch_by_slug_and_date method to retrieve articles based on the URLurl() method to the article object so it ‘knows’ its own canonical URLarticle.url() method instead of constructing a URL from the article IDPhew!
Perhaps what is most useful to other people is my short snippet of JavaScript which automatically generates a starting slug from a page title. I sometimes change it, but the script gives me a good starting point.
var slug = title.toLowerCase().replace(/[^a-z0-9 -]/ig, '').replace(/ /g, '-');
> added a new column, slug, to the articles database table
So, did you code this site or it’s running on a market-available CMS?
yc
I wrote it. It’s been a work-in-progress for over six years now. There’s some more info about the technologies I use here:
http://www.mattryall.net/blog/2008/06/markdown
http://www.mattryall.net/aboutme/
A while ago I thought about releasing it, but so much of the functionality still sucks (comments, for example) that I won’t be doing this any time soon.
Comments on this article have been closed.