On 2003-10-28, Darin McBride <suppressed> wrote:
>
> But of course, no CGI. So all pages must exist on the server as static
> HTML. How does one create static HTML from dynamic content?
>
> I now use CGI::Application::StaticGenerator. Which I would look
> forward to comments on from other users of C::A. You cannot find it on
> CPAN - I would like comments first ;-). You can, however, find it on
> my ISP's webserver:
>
> http://members.shaw.ca/darin.mcbride/CGI-Application-StaticGenerator-0.01.tar.gz
>
> If things go well with this, I will put it on CPAN later.
Darin,
This is an interesting idea. Here's some feedback:
- The "static_filename" needs some more documentation. What is passed
into the subroutine that I can use to construct a dynamic file name?
- I think the "dynamic" case may be used rather frequently. For
example, in "Cascade", It's designed to work in both "dynamic" and
"static" modes. In the static mode, it's possible to generate a lot of
static pages. Hundreds of pages are generated from just a few distinct
templates.
To accomodate this, I would design your module to accomodate any
possible CGI::App input as something that could influence the output.
This would include all the parameters passed into an instance script, as
well as the "query" object.
I would also expect that "fancy" page names will want to be used
frequently. For example, in Cascade all the category pages are using the
same template. The page name for a category might be:
"/Top_Level/Mid_Level/Category_Name/Index.html"
The file name generation is complex. It involves putting together
several category names and encoding them in a particular scheme.
You may enjoy looking at Cascade::Admin::write_static_pages to see how I
tackled this. I now want to refactor this code to not use the global
%FORM for CGI param data and make some other stylistic changes, but you
get the idea.
Cascade home page: http://summersault.com/software/cascade/
Overall, it seems like your module is targeted at a CGI::Application
project that was designed to be rendered as a bunch of static pages. For
complex projects that may be rendered as dynamic or static content, I
think I would still be inclined to cook up a custom solution.
It may also be worth nothing one of the standard website mirroring tools
may play a role here. I don't use these frequently, but I believe tools
like "w3mir" are good at creating a copy of a dynamic website and
storing it as static pages.
Mark
--
http://mark.stosberg.com/
---------------------------------------------------------------------
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.