It's not actually too terribly hard. I've set this up at my church; the
server that was running was rather slow, which made runing every page
view through a CGI script painful. (Plus, I felt guilty about setting
up a site that would use so much CPU just to serve pages, on a server
that other sites were sharing.)
The first key is to install the PublishAddOn:
http://twiki.org/cgi-bin/view/Plugins/PublishAddOn
Do what it says. That gets you most of the way there. By default,
though, that script is run to publish the pages of an entire web. What
I wanted was to publish just the page for the single topic that got
edited, and right after it got edited. (I.e. so that the static HTML
and what you get from the view script always were in sync.) I hacked
the "save" script to do this. At the very end of that script, there's a
call to TWiki::redirect which runs "view" on the topic being edited. I
replaced this one line with something like:
# RKNOP HACK -- force it to publish
my $publishurl=&TWiki::getViewUrl( "", $topic );
$publishurl=~s/view\.cgi/publish\.cgi/;
$publishurl.="?inclusions=$topic\&goAhead=1";
TWiki::redirect( $query, $publishurl );
(Not that I renamed all the scripts ".cgi" in my installation; you want
to be careful wit the .cgi extensions elsewhere.) (I also put in
another hack you don't see here to use a specific skin for the front
page, which has a different layout than all the other pages.)
Now, it seems that things are mostly working as expected.
(The site that this was done for is http://www.brookmeade.org -- which
isn't obviously a TWiki site any more. If you want to look under the
hood, not advertised but present are things like
http://www.brookmeade.org/cgi-bin/twiki/view.cgi/Main/WebHome
Going there, you can also see why I thought this server was too slow to
serve every page view through CGI.)
-Rob
-- --------------------------------------------------------------
Game(s):
Listowner tools are found at http://www.phoenyx.net/listowners/