[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [cgiapp] directory structure and static pages


On September 4, 2003 08:27 pm, Darin McBride wrote:

> Not that I'm an expert, but I was considering writing a script that
> would take the name of a module, load it, look at its runmodes, and
> invoke each runmode one after another.  By setting a global variable,
> say $::STATIC_MODE, any mode that should not run statically could just
> return undef immediately rather than reading databases, etc.  The
> wrapper would detect the undef return, and simply not write that one
> out.  It would generate <runmode>.html files in the specified output
> directory.
>

[deletia]

>
> These are just my ideas.  :-)
>

I've put together my idea, and am now actively using it.  The whole
C::A architecture is good not only for pages that you need to use CGI,
but even for sites where you want common look&feel.

I have a C::A application where I cannot use CGI scripts.  However,
some pages are built from a CSV table (using DBD::CSV, of course)
simply because it's easier to maintain than HTML.  All pages have the
same sidebar idea, so a minor amount of perl is used to create the
sidebar uniquely to each page.  When I add a new entry to the sidebar,
all pages will get it "automatically".

The sidebar is thus in header.html, while the footer is in, well,
footer.html.  All pages get these as part of a common method they all
use to display the template.

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.



---------------------------------------------------------------------
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.