Recent weblog improvements, plus some intentions for 2004
By Oli
At 4:15 PM · Friday, 9 January · 2004
To Coding · HTML · Weblogging
So Far…
It seems like I haven’t done any big improvements around here for a while, but a few things have changed:
- Automatic acronym tagging
I’ve implemented Mark Pilgrim’s Perl-based macros for adding acronym tags with titles automatically. If you’d like to find out more about acronyms and abbreviations, plus when and how to add them, check out Friday Feast #64: Abbreviations, Acronyms, and Shortened Words by Shirley Kaiser. I was planning to write a guide to this, but she’s beaten me to it ;-)
I used to code each acronym by hand, which as Mark says gets tedious fast. I was also marking up abbreviations as acronyms, because PC IE doesn’t support
<abbr>(Internet Explorer 6; the new Netscape Navigator 4
). Mark’s script adds an<acronym>tag to the first instance of an abbreviation or acronym on the fly from the definitions in the macro, but ignores subsequent instances. Only the<acronym>tag is used due to the IE issue, although because the HTML is never saved in the story it’s a simple change to make this script generate the correct<abbr>tags for abbreviations in the future. I’d personally prefer it tagged the first instance with the tag and title attribute, and following instances with just the tag, as Lars Holst suggests in Abbreviations, Acronyms and Initialisms. However, when copying code I don’t understand I can’t be picky ;-)Thanks to Shirley for helping me get this going! Her slightly shorter version of Mark’s script removes the non-acronym bits.
- More HTML allowed in comments
I’ve increased the number of tags not ‘sanitized’ by MT, and also discovered a peculiarity in the way Sanitize works. Previously I’d listed the tags I wanted to allow (
em,strong,a href…) followed by attributes allowed for any tag (* title,* lang,* xml:lang…). My understanding was that an attribute preceded by “* ” was allowed for any approved tag. However Sanitize only seemed to allow one attribute per tag, even if there were several. So a nice semantic link to a Japanese webpage (<a href="url" hreflang="ja" charset="shift_jis" title="description">) got cut down to one attribute (<a href="url">). The extra code I entered is still saved in the comment, but not displayed.I re-read the Sanitize manual and discovered:
If you wish to allow a certain attribute for any HTML tag in which it might appear, use a *as the tag name, followed by the list of attributes
(my emphasis). This means multiple attributes can be listed per tag (or globally using *) by space-separating them. So I should have been writing
* title lang xml:lang. I guess I made the mistake because there are no attributes in the default approved list, and none of the manual examples deal with more than one attribute per tag.Instead of declaring attributes globally, I’ve decided to be anally semantic and approve the correct ones per tag ;-)
- Other changes
- I’ve finally started using images (!) That took a while ;-)
- The weblog should now be sent as XML to compliant web browsers (hopefully I’ll notice any major mistakes before you — using the XHTML 1 strict doctype means no graceful recovery, eek!). Mark Pilgrim has written a great article on how to send the correct mime type via PHP, Python, or
mod_rewrite. It’s surprisingly easy. - Many small tweaks to the stylesheet to make things a little less ugly
To Go…
I am presently investigating and thinking about these potential changes:
- Implementing Smarty
- This removes the need in MT to rebuild to see changes, by changing MT’s static text files into PHP-driven ones. It works by passing MT data to PHP variables, and using PHP to rebuild the page dynamically when something changes. Brad Choate has written a guide to using Smarty with MT, and no rebuilds seems nice. On the down side, it appears non-trivial to do category and date archives unless you know PHP. I need to work out how to do this before attempting it, but no rebuilds is a major attraction for anyone thinking about a redesign.
- Integrating an online bookmarking service
- It has recently become popular to offer a ‘links sidebar’ containing witty one-liners on links that don’t quite warrant an article. I’m also interested in compiling some kind online reference of the links I frequently refer to for web design. I’m thinking about using del.icio.us to add bookmarks under many categories, then create a links page that builds link hierarchies from these categories. This sounds way too complex for me though ;-)
- A redesign?
- This site has been my first attempt at both a Movable Type weblog, and a quality CSS-driven design. While it’s passable, it certainly needs improvement. I personally find the site quite unusable, and want to re-do the way archives and intra-site links work. I haven’t even touched many of the default templates yet, and the site is desperately in need of some graphic identity. I’m holding off on this because of both Smarty and my lack of a PC testing rig. I hope that once we buy a new computer (que “Someday over the rainbow”) my workflow will improve massively. Several major errors in PC IE (even when the code validates and displays perfectly on Mac browsers) have dented my confidence. Once I can test locally I’m looking forward to making some more noticeable improvements around here.
In general I hope to post more frequently, write more about Japan and living here, and make this a more visually interesting weblog. The new digital camera should help! I’m hoping to get to the stage someone compares my meagre efforts to Jeremy Hedley’s mighty Antipixel ;-) Maybe one day! I’m also thinking of making my “Guide to…” posts into a MovableType tutorial to complement Nadine Zukoski’s excellent Beginner’s Guide to Movable Type. Maybe I should wait for MT 3 though…