Stories
Slash Boxes
Comments
NOTE: use Perl; is on undef hiatus. You can read content, but you can't post it. More info will be forthcoming forthcomingly.

All the Perl that's Practical to Extract and Report

use Perl Log In

Log In

[ Create a new account ]

statico (5018)

statico
  ian.langworthNO@SPAMgmail.com
http://langworth.com/
AOL IM: eisforian (Add Buddy, Send Message)

PAUSE-ID: IAN [cpan.org]

Co-author of Perl Testing: A Developer's Notebook [oreilly.com]

Journal of statico (5018)

Wednesday May 18, 2005
08:51 AM

rapid web site development

[ #24753 ]

Let me tell you how I reworked my website over the weekend.

First, I laid out the content that I wanted: Contact information, some projects, some miscellaneous writings and notes, and files to download. Also, a handful of things I used to put on my site have been replaced with online services, such as my bookmarks, pictures I've taken, and my blog.

Originally I wanted the site to be based around XML and XSLT with XML content providers producing the reusable components I was looking for. Unfortunately, the only Perl solution for this is AxKit, which never ceases to give me hell. Even the Debian packages, which usually work out of the box, caused me to have to set the LD_LIBRARY_PATH variable if I wanted things to kind of work.

Alternatively, I started to look at the legendary Template Toolkit. While already familiar with TT's syntax and structure, I had never used it to build a heirarchy of documents. I read bits of Perl Template Toolkit, especially the chapter on Building a Complete Web Site Using the Template Toolkit, and was immediately prepared.

In a single night I set up my Template Toolkit-driven website to produce a slew of well-structured XHTML documents. I'd even written a few plugins to fetch RSS feeds with XML::RSS::TimingBot, fetch recent images from Flickr, and run the final page through HTML Tidy.

The only quirk so far is not being able to use a wrapper template since I generate the CSS document along with the HTML pages. Maybe I'll create two config files for ttree (the command to process all the pages) -- one that uyses a wrapper and one that doesn't.

(Update: This problem was solved -- I simply hadn't looked hard enough at the book. Thanks, Dave!)

The theme of the site changes every day, using an interesting feature of Perl's random number generator:

srand( int( time() / 60 / 60 / 24 ) );
return { %constants, %{ $themes[ rand @themes ] } };

There are some themes I really like (the blue Boston one, the dark magenta one with the truck), and others that need some serious work (the orange cockroach one). But now, I need to get back to real work.

The Fine Print: The following comments are owned by whoever posted them. We are not responsible for them in any way.
 Full
 Abbreviated
 Hidden
More | Login | Reply
Loading... please wait.
  • Both your note here, and on your website frontpage, contain the phrase:
    Template Toolkit had allowed to
    What? WHAT? Don't leave me hanging like that!
    --
    • Randal L. Schwartz
    • Stonehenge
  • The only quirk so far is not being able to use a wrapper template since I generate the CSS document along with the HTML pages. Maybe I'll create two config files for ttree (the command to process all the pages) -- one that uyses a wrapper and one that doesn't.

    We deal with that problem (and its solution) in chapter 11. See page 415 "CSS and Other Non-HTML Pages".