Joel’s Improved Personal Website

Site Errata

· 03 Aug 2010 14:19 ·

I’ve begun implementing a feature we’ve been thinking about for years (and never seen anywhere else), a book-style index of all posts. One of the difficulties of the site’s layout has been making older writings accessible and and enjoyable to browse through, and hopefully this will provide a new angle for people to peruse through past posts.

We’ve been faithfully typing in keywords for every post for years, mainly for use in meta tags to help out the search engines. All we needed was some code to access the complete list of all keywords ever used. I found this in the tru_tags plugin for Textpattern. Since tru_tags cannot use custom fields (where I had been storing my keywords) I copied them into the keywords field proper with a SQL command:

UPDATE `textpattern` SET `Keywords`=concat(`Keywords`, ',', `custom_1`)

I then set up my “tag archive page” according to the tru_tag usage instructions, altering the format to achieve a book-like effect (textpattern article IDs work nicely as page numbers). I was able to break out the keywords by first letter, just as in book indices, by adding a custom function to the tru_tags plugin to return only the first letter of the current keyword.

The index page would ordinarily be dynamically generated every time the page is accessed, but as this was found to present a noticeable performance penalty, I set up full-site caching using the asy_jpcache plugin, version 0.9.8, which worked flawlessly out of the box on our Textpattern 4.2.0 installation. The page is now served as a static, cached version (very snappy) which is updated once every 12 hours (a plenty small-enough window for this site).

Many of our posts’ keywords still need cleaning up and updating; this being the first time they have really seen the light of day on the website, numerous errors and ommissions have inevitably popped up.

Typographically, two limitations remain. First, the problem of preserving title case in keywords (i.e., in proper names and book titles) – tru_tags prefers to fold everything into lowercase. Second, the problem of the added space before as well as after each comma – a byproblem of the way Textpattern evaluates conditional code in forms.

[ View all notices ]