On Thursday, September 4, 2003, at 09:16 PM, Thilo Planz wrote:
2. for a large project, not all of the pages have to be dynamic obviously. How do people deal with static pages that you want to still share the look of your dynamic pages that you are using HTML::Template for? I was considering creating a commandline tool to generate the static pages from the HTML::Templates or creating a module just for serving static pages (not that they would be static anymore) and wrapping the header and footer, setting the title, etc. but each of these have downsides. How do the experts do it?
Now that is a good question.I have spent some time looking for just such a command line tool that renders a whole tree of HTML::Templates into static HTML files, but could not find anything.The closest thing I found was WebMake (http://webmake.taint.org/)., but it uses its own templating syntax.Anyone know a nice static HTML renderer for HTML::Template ?
This might not be exactly what you're thinking about, but if you're talking about caching the output of a dynamic page rather than hitting the DB multiple times for a live site, you could write an script that utilizes LWP::UserAgent and HTTP::Request to query according to your run_mode/database ID. Then, write the output to a file in a web tree and build your index based on the static files. If you didn't need to do it Perl style, wget or curl could be shell scripted... These might not be the most elegant solutions, but they were probably going to be what I was going to do down the road for myself.
As far as includes go, what I've done is have a shared include directory for my static and H::T files. The other piece tends to be using common CSS classes for everything.
I've also done something like below: create an H::T with both static include and H::T include formats...
<!-- TMPL_INCLUDE name="inc_meta.html" --> <!--#include virtual="inc_meta.html" -->Under H::T and Apache 1.3.x, when called as a static file, the include virtual directive will parse. When called from a handler/CGI, H::T parses its line and the include virtual is ignored. Note: if mod_perl is enabled to handle server side includes, this may not give the desired results.
Otherwise, Apache 2 does chained handlers, so, after mod_cgi or mod_perl handle something, it can be handed off to mod_ssi for further processing. (not new info, but worth pointing out)
This might not be ideal, but I have seen it work.
Regards,
Nathan
---------------------------------------------------------------------
Web Archive: http://www.mail-archive.com/suppressed/
http://marc.theaimsgroup.com/?l=cgiapp&r=1&w=2
To unsubscribe, e-mail: suppressed
For additional commands, e-mail: suppressed
Mail converted by mhonarc 2.6.15
This archive provided courtesy of JSW4.NET, Internet Hosting Services for Small Business.