Extensionless URIs for Blosxom entries
This post introduces the Blosxom plugin
"extensionless". Ever since reading
the essay "Cool URIs don't
change" I've wanted to change
my web site to conform to some of its recommendations, including the
recommendation to omit file extensions (e.g., ".html") on
URIs. Unfortunately standard Blosxom requires that a file extension be
present in a URI for an individual entry (e.g.,
http://www.example.com/foo.html) to distinguish it from a URI for a
category (e.g., http://www.example.com/foo). How to fix this?
In my ignorance I originally thought it would be necessary to patch Blosxom itself to recognize extensionless URIs for entries. However I hadn't fully grasped the power of Blosxom plugins, nor had I had a good look at the Blosxom plugin registry, where I would have found not one but two plugins to implement a "cool URI" scheme.
Unfortunately those plugins are overkill for my own personal needs, since I'm not interested in doing date-based permalinks as implemented by those plugins. As a result I decided to implement my own plugin to provide the more limited functionality that I wanted.
(I refrained from naming the plugin "cooluri3" or something similar
since it really doesn't implement the full date-based "cool URI"
scheme recommended by the W3C and implemented by the cooluri and
cooluri2 plugins; at best it implements "semi-cool" URIs.)
See the plugin code itself for the full documentation. In most cases
you should just be able to copy the plugin into your Blosxom plugin
directory. Note that you should not have to change any other plugins;
the extensionless plugin will fix up an entry's URI internally so
that it has the proper file extension for its flavour as expected by
Blosxom and Blosxom plugins.
If you encounter problems with the plugin (or if you just use it and like it) please send me email.
UPDATE: Thanks go to Stu MacKenzie for providing a patch to allow the plugin to work for extensionless URIs where the entry name starts with a digit.
UPDATE 2: The original version of the extensionless plugin would not
work with Blosxom versions 2.0.1 and higher. I fixed the plugin to
correct this problem; current versions of the extensionless plugin
should work with all Blosxom versions.
2006-07-23
Submit a comment
Please enter comments as plain text only; no HTML tags are allowed. All comments and trackbacks are moderated, and will not be displayed until approved by the moderator.
Comments are closed for this story.