Utility to publish a TWiki web to static HTML pages. Useful to maintain a static website collaboratively in an access restricted TWiki.
One web (defined in the PUBLISHWEBNAME setting) serves as the master for the static HTML pages. The Plugin generates an HTML page every time a user saves a topic in the Publish web. The static HTML files are based on a TWiki skin of choice. All referred attachments (images etc) are copied to a publish directory.
Index
[[Topic]]
or [[Topic][label]]
(do not use WikiWord links)
%STARTPUBLISH%
- place in topic text where to start publishing %STOPPUBLISH%
- place in topic text where to stop publishing %PUBLISHWEB{"nicetopic"}%
- nice topic name Customer_Support
turns into Customer Support
%PUBLISHWEB{"breadcrumb"}%
- nice breadcrumb %PUBLISHWEB{"nicetopic"}%
to get the complete breadcrumb
%PUBLISHWEB{"breadcrumb"}%
variable to show the breadcrumb
You are here: Home > Customer Support >
%PUBLISHWEB{"publish" topic="Name"}%
- re-publish topic(s) without edit/save cycle topic="all"
publishes all topics in the Publish web except for the excluded ones
topic="Any_Topic"
publishes a specific topics
Plugin settings are stored as preferences variables. To reference a plugin setting write %<plugin>_<setting>%
, i.e. %PUBLISHWEBPLUGIN_SHORTDESCRIPTION%
data/debug.txt
)
%PUBLISHBREADCRUMB%
:
Note: You do not need to install anything on the browser to use this plugin. The following instructions are for the administrator who installs the plugin on the TWiki server.
PublishWebPlugin.zip
in your twiki installation directory. Content: File: | Description:![]() |
---|---|
data/TWiki/PublishWebPlugin.txt,v | Plugin topic repository |
data/Publish/WebPublish.txt,v | Plugin topic repository |
data/TWiki/PublishWebPlugin.txt | Plugin topic |
data/Publish/WebPublish.txt | Plugin topic |
lib/TWiki/Plugins/PublishWebPlugin.pm | Plugin Perl module |
PUBLISHSKIN = print
setting)
lib/TWiki/Plugins/PublishWebPlugin.pm
: For security, the output directories are defined in the PublishWebPlugin.pm
library. Change the hardcoded settings if needed: $publishPath
defines the output directory of the static HTML files, relative to the twiki/pub
directory; defaults to the parent directory of the twiki/pub
directory; should point to the htdocs root directory
$attachPath
defaults _publish
; is relative to $publishPath
$attachPath
setting
$publishPath
and $attachPath
to be writable by the cgi user (typically user nobody
)
Publish
web (name indicated by the PUBLISHWEBNAME
Plugin setting)
NOAUTOLINK
setting to on
*Publishing*
[[Index][Home page topic]]
[[http://%HTTP_HOST%/index.html][/index.html]]
[[http://%HTTP_HOST%%PUBLISHWEB{topicurl}%][%PUBLISHWEB{topicurl}%]]
[[%SCRIPTURL%/view%SCRIPTSUFFIX%/%WEB%/WebPublish?\
action=publish;ptopic=%BASETOPIC%][Re-publish this topic]]
[[%TWIKIWEB%.PublishWebPlugin][PublishWebPlugin]]
Test
topic in that web
test.html
page on topic save
Index
topic and other topics
twiki/templates/view.*.tmpl
skin file
%PUBLISHWEB{"breadcrumb"}%
and %PUBLISHWEB{"nicetopic"}%
%PUBLISH_SITE%
, %PUBLISH_LOGO%
, etc.
PUBLISHSKIN
setting
Plugin Author: | TWiki:Main.PeterThoeny![]() |
Copyright: | © 2006, Peter@Thoeny.org |
License: | GPL (GNU General Public License![]() |
Plugin Version: | 15 Feb 2006 (V1.022) |
Change History: | |
15 Feb 2006: | Added %PUBLISHWEB{"publish" topic="Name"}% |
13 Feb 2006: | Initial version |
TWiki Dependency: | $TWiki::Plugins::VERSION 1.024 |
CPAN Dependencies: | none |
Other Dependencies: | none |
Perl Version: | 5.005 |
Benchmarks![]() |
GoodStyle 100%, FormattedSearch 100%, PublishWebPlugin 99% |
Plugin Home: | http://TWiki.org/cgi-bin/view/Plugins/PublishWebPlugin![]() |
Feedback: | http://TWiki.org/cgi-bin/view/Plugins/PublishWebPluginDev![]() |
Appraisal: | http://TWiki.org/cgi-bin/view/Plugins/PublishWebPluginAppraisal![]() |
Related Topics: TWikiPlugins, DeveloperDocumentationCategory, AdminDocumentationCategory, TWikiPreferences
-- TWiki:Main.PeterThoeny - 15 Feb 2006