I like the idea of pre-generation of static html pages for the clarity, the server load.

You might consider Template caching (see "Caching and Compiling Options") as a easy solution for that issue.

To my mind, this seems a little backwards, since a large template-driven site is rarely going to be the first case, and much more commonly going to be the second case. No?

If you're converting to TT from a HTML-only design, yes, it's backwards. And that's not something TT was designed for; it's mostly built for ground-up design with TT in mind.

So, first off, you can indicate that TT "scoop up" .html files, or any other content. The INCLUDE_PATH option will contain a list of directories to look in, and you can write a quickie "generator" for it to recurse through your directory structure if you'd like, or manually list the directories; it's your choice. Make a "base" template, use the WRAPPER option, and then the "sub-templates" with the content get slugged in via the [% content %] tag. I strongly recommend skimming the various parts of the Template Manual; there is a LOT of power to the Template Toolkit that's not obvious, and it not "typical usage", as you've surmised.

Does that help?

----Asim, known to some as Woodrow.


In reply to Re^2: Learning Template::Toolkit - have I understood? by Asim
in thread Learning Template::Toolkit - have I understood? by punch_card_don

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.