This weblog is no longer being maintained. All information here has been ported to EclecticEchoes.com. This site (heupel.com/eclectic) remains only for archival purposes.
I’ve made two small changes to this site. Primarily from being able to play extensively on the development server without fear of screwing something up horribly. The changes really are quite small, but important none the less. The first change was to patch the MT source code to allow it to write out directory index files with any extension designated in the configuration preferences. Prior to finding Dave Dribin’s wonderfully simple and understandable patch, I was forcing the same behavior primarily through mod_rewrite. I set the default file extension in MT’s preferences to “” (that’s null) and then had the archives preferences writing out the archives as index e.g.:
<$MTArchiveDate format="%Y/%m/%d"$><$MTEntryTitle dirifyplus="sld"$>/index
Why did I do this in the first place? Well the short version of it is future-proofing the URL’s as well as providing a cruft free and heirarchal URL that are “hackable” by the user to climb back up—one level at a time any number of levels—to the root. It was Mark’s article (cruft free) that I originally followed as my blueprint. Unfortunately there are some downsides, although very minor, to the way it was done. First off the web reporting software chokes on the fact that there is no extension on the file. In reality this is the fault of the reporting software, but it is something I have no control over either. Minor nuisance, but there. The larger issue for me is that mod_gzip is not consistently delivering the html documents as compressed to clients, even modern browsers. Again a minor nuisance, and this could easily be something that I could find a solution to but it seems that the answer is just to put the .html back on the files—or .php or .shtml or…
That’s the nice thing about Dave’s solution, since it puts each archive entry as a directory index, you still get URL’s without the extension. In fact the only visible difference in the URL and the site, is the trailing “/” behind them—which is added by the server automatically. The same URL that used to point to an html file (albeit masquerading as a directory) now points to a directory of the same name. The server technology is not being broadcast, and the .html is saved from being transmitted with every request. If I change technology next month the URL will remain the same, while the file extension change and I make one change (possibly) to the apache directives to add the new index.xyz as a directory index format. Yet I now get reliable mod_gzip compression across the board and the statistics packages don’t choke on the the extensionless files. Of course it took a little work to actually make the transition.
Since the existing entries were without any extension, I couldn’t just make the change in one rebuild. Instead I used MT’s template feature to create an “archive” page that had only the links to each page–one link per line. The template (which I named “exporter” and set to save to a file of the same file name) consisted of 4 tags:
<MTArchiveList>
<$MTArchiveLink$><br />
</mtarchivelist>
Rebuilding this template will give you a list of all the URL’s to your articles:
http://heupel.com/eclectic/2003/12/29/black-on-black-field-of-beans<br />
http://heupel.com/eclectic/2003/12/28/bh-video-catalog-porn/<br />
http://heupel.com/eclectic/2003/12/27/the-trick-is-to-keep-moving/<br />
http://heupel.com/eclectic/2003/12/27/riaa-silly-dvd-jon-and-privacy/<br />
http://heupel.com/eclectic/2003/12/24/smile-daddy/<br />
http://heupel.com/eclectic/2003/12/24/sco-gets-another-ahole-for-christmas/<br />
...
A couple of quick substitutions in vim, regex or whatever and you have a shell script ready to remove the old entries and create empty directories in the proper location with the same name. At this point rebuilding the site will put the new “index.html” files for each individual entry in the proper place, along with rebuilding the category and other archives. Nothing should have broken even though all the links are now for directories with the trailing “/” since the original setup was so well thought out—by Mark that is. Of course it remains that way too, ready for the next change of servers.
I also added Dave’s other MT plugin, Short Titles. This plug-in essentially does what Mark uses Brad Choate’s MT-If-Empty plugin to do. While Mark’s solution is infinitely more flexible, Dave’s plugin fits my needs perfectly. Just as with Mark’s solution if there is a key word, or keywords for an entry they can be selectively used to create a “slug” title. If there are no keywords, or none set off by using brackets then the MT Entry Title gets run through dirify before being written out as the file (well directory in this case). I decided it was time to start using slugs because some of the titles I like to use can get a bit too long for a useful URL. However I want the URL’s to be human readable and understandable. Some folks use the entry ID, or the first X characters or words of the entry title. Unfortunately that still puts some constraints on titling an entry, Using either Mark’s method or Daves plugin—unfortunately both require a plugin—you have far greater latitude in both titling and the length and decipherability of the slug title.