SPUG: Template Toolkit problems

Tim Maher tim at consultix-inc.com
Wed Nov 12 19:52:08 CST 2003


I thought I'd whip up a couple of quick websites using the
Template Toolkit, along with the "skeleton" templates this
afternoon, rather than doing it all the hard way (as I
usually do).

But although I spent a lot of time trying to make it work, all in all
it was a very frustrating experience -- which I'd like to achieve some
closure on by making it work once and for all! 8-}

After a few hours of banging my head against it,
I finally come to the conclusion that the "build" program
(which just calls ttree) doesn't properly compare timestamps to see
what templates are newer than their corresponding *.html pages,
nor does it properly check dependencies in the tree of web pages
to detect when html/index.html, e.g., needs to be rebuilt even if
src/index.html isn't any newer, because other "configuration"
files have changed.

I may be wrong, or doing something wrong, of course, but these
conclusions explain my experiences thus far.

For example, after changing templates/lib/site/logo, which
determines part of what goes into html/index.html, build won't
usually recreate index.html. But if I use touch to back-date it
by 9 months, or remove the file altogether, then it *will*
rebuild it.

Another problem is that I can't figure out how to customize the
navigation menu I get by default on the left side of every page; it
definitely comes from templates/lib/config/map, which I've edited
to define some changes, but my changes never show up in
html/index.html, even when I make sure that file gets rebuilt.

I'd be grateful if somebody could clue me in on how to make this
work! Feel free to give me a call (at the number below) tonight
if you're willing to help me out.

| Tim Maher (206) 781-UNIX  (866) DOC-PERL  (866) DOC-UNIX   |
| tim(AT)Consultix-Inc.Com  TeachMeUnix.Com  TeachMePerl.Com |
| CLASSES: Min. Perl: 12/1; Perl: 12/2-4; Perl Modules: 12/5 |
|   Watch for my Book: "Minimal Perl for Shell Programmers"  |

More information about the spug-list mailing list