Archive for November, 2003

Uselib

Monday, November 24th, 2003

Occasionally a blosxom plugin needs a perl module that isn’t installed on the server, such as MIME::Types or File::Cat. For users who don’t have administrative access on their server, there has been no official place to install such modules. Additionally, users then needed to modify blosxom.cgi or the plugin to have it search the correct location.

This plugin attempts to help the situation by telling Perl to look for modules in $blosxom::plugin_dir/lib. This gives a standard place to install to (for example, File::Cat comes with one file, Cat.pm, which would go in $blosxom::plugin_dir/lib/File) and also means that users don’t have to modify anything to get perl to find the new module.

Note: uselib needs to be loaded before plugins requiring extra perl modules. You can do this by renaming it to something like 01uselib.

Download uselib 0.0.1

Update:Documentation is now available here.

Pictures

Tuesday, November 18th, 2003

So, I wanted to be able to post pictures. Seemed like a simple enough idea but I ran into a lot of problems. I tried 3 different plugins:

autoimg replaces simple tags in the story with html img tags. It was the easiest of the 3 to use, but didn’t do a good job on the layout. On short stories, images would interfere with the next story. Also, autoimg wanted images to come out of my website’s directory, not the directory where I keep blosxom stories. While this might normally be a Good Thing (separation of content and presentation), in my case the pictures are the content.

binary intercepts URLs passed to blosxom and checks to see if the file exists. If it does, it gets served up. Otherwise, blosxom.cgi gets to deal with the URL normally. This lets me store my images in the blosxom story folder, right next to my text files. It had several bugs, however, and I gave up on it.

static_file is a rewrite of binary. It works much better for me. Combined with interpolate_conditional, it is very close to what I wanted.

Here is an example. In my story, I have this:

<a href="poppies.png">  <img src="poppies.thumb.png" alt=[poppies]“/> </a>

The .png images are sitting in the same directory as the .txt file for this story. interpolate_conditional generates the proper URLs, and static_file catches the requests and serves up the right images:

[poppies]

I would like an easier way to add images than entering raw html source, but for now I am happy. Oh, and in case you are wondering I modified interpolate_conditional so it would pass those $’s through when it sees two in a row. Here is the patch

Update: I also made a patch for static file to make the default MIME type configurable.

Timezone

Monday, November 17th, 2003

I want the timestamps on postings to use the PST/PDT timezone, but my server is set to to EST/EDT. I grabbed Raffi Krikorian’s timezone plugin but couldn’t get it to work. Turns out I had to rename it from “timezone.plugin” to “timezone”, after which it works perfectly. I still want the timezone appended on the timestamps (so it would say “posted at: 22:25 PST”, for example).

Update: I’ve updated the timezone plugin so it now exports the timezone for use by flavours.

Hello World

Monday, November 17th, 2003

Just got this site up today. This is, surprisingly, the first time I’ve had my own web page. TR from genetikayos.com was the one who finally motivated me to make this page, and he is also kindly providing hosting. I’ve settled on using bloxsom to run the site. It meets my 2 requirements of being free and simple. I was able to get it up and running in about 30 minutes. So far, so good.

Update: I’ve run into a few problems with blosxom. Basically, the further I go with blosxom, the more uncharted the territory feels. It turns out I’m not alone either. Blosxom has a very strong community though, so I haven’t given up hope yet.