Site overhaul... finally
Posted: 4 August 2002 at 16:52:09
It's a brand new website, folks, and it's completely mod_perl. It's nice to finally have it done, up, and running.
For a couple months I've been experimenting with ways to rework my site with mod_perl. Prior to this, I was using a kludgey set of CGI scripts to make things work and I felt very limited and restricted by that. But, now, whoa ho ho! It's gonna be cool.
Of course, it would be much more cool if anyone actually read this damn thing. So (for now, anyway) it's cool... to me.
The look and feel
The look and feel isn't a whole lot different. I experimented with some layouts which were kind of Star Trek-y and had curvy banners across the top and bottom and wrapped down the left side. They were nice in that I composed the HTML so that the browser window could scale to any size and everything would look consistent. But, in the end, I decided I didn't like it.
The graphics you see now on the top and bottom were generated using The Gimp and applying filters/effects such as “bump map”, “painted rock”, and “make seamless”. The fozzilinymoo.org banner at the top was created using the same background, but lightening it a bit and applying a beveled edge.
For the most part, I kept the same CSS style sheet and added a few rules.
Templates
Previous to this overhaul, I wasn't using templates at all. That may be a surprise to some who noticed the consistent layout of all the pages on the site. That was only achieved by adding the appropriate HTML to all the pages. Yes, it was a pain. Even more painful was having to go through all those pages and remove the extraneous HTML tags preparatory for this overhaul.
The templating is done with help from the CGI::FastTemplate Perl module. This was actually the first templating system I've used that I didn't write myself. I like it because it is extremely fast (It merely uses regular expressions to substitute template variables with content. No logic is involved.) and simple to use. The template files look like this:
<html> <head> <title>$TITLE</title> <link rel="stylesheet" type="text/css" href="/css/main.css"> </head>
The parser routine simply replaces the variables (i.e. $TITLE) with whatever you want there.
Context sensitivity
The context-sensitive sidebar sitemenu and the template assignment is determined by a simple text file database which has pipe-delimited fields on each line describing each document or resource available on the site:
/biograph/|Biograph|History/Background|Biograph|biograph.tpl
The mod_perl handler for all the pages creates a tree in memory of this data and uses it to generate the sitemenu and decide which template to use for each page requested.
I've used systems like this on several sites including the Sorenson Vision site when I was working there as their webmaster and my original personal home page over at XMission. Usually, I use a relational database backend such as PostgreSQL to store the information about all the pages. Storing the information in PostgreSQL makes it easier to develop applications for content management. Sorenson Vision had a web-based facility for maintaining every page on the site without knowing po-diddly about SQL, Linux, Perl or Apache.
Since this is my site and I'm quite adept at running the Vim editor and manipulating the site information data by hand, I don't see an advantage (currently) of storing the data in a relational database.
If the site grows and there is a performance issue related to reading this data from a text file, then I'll reconsider my decision.
Malverbiage
This is one of the funnest aspects of the site. I've placed a new “malverbiage” box in the right sidebar on the home page which contains random quotes, headlines, etc. representing misleading, poor or incorrect uses of the English language. I've been including these humorous tidbits in my e-mail signatures for a couple years now and I love it.
I'm also thinking about putting my entire collection of malverbiagisms (malverbosities?) online as well.
The future
I'm looking forward to playing around with more dynamic applications for the website. A few things I've thought about adding:
- Threaded comment facility with user login so visitors can leave comments about things they read.
- Fozzomat - a photo gallery application.
- A code library where I can make a lot of my source code available to people who want to use it.