Tuesday, July 9, 2002

Blosxom patched to support icons

I modified blosxom (version 0+4i) to support icons associated with
each entry.

My first thought was to key off of the file name
(announcement:blosxom-with-icons.txt,
linux:linux-in-20-websites-or-less.txt, etc) but went with adding an
HTML fragment to the end of the first line.

So the first line of this entry is:


Blosxom to support icons <img src="/marc/blog/marc/data/topicannouncements.g
if" alt="Announcement: ">



Here is the href="/marc/blog/marc/data/blosxom-0+4i.patch">patch or the href="/marc/blog/marc/data/blosxom-patched-for-icons">patched version itsel
f.

The one strange perl thing is I wanted to collapse the following two lines:



my ($icon) = ($title =~ /(<img.*>)/);
$title =~ s/(<img.*>)//;



into



$title =~ s/(<img.*>)//;
my ($icon) = $1;



but $icon is always set to the day of the week put in $1 from
the line:


my($dw,$mo,$da,$ti,$yr) = ( $mtime =~ /(\w{3}) +(\w{3}) +(\d{1,2}) +(\d
{2}:\d{2}):\d{2} +(\d{4})$/ );



Anyone know why it doesn't work?