Export Static HTML

This describes how to set up your publication so that each time you publish a page a static html file is created (typically to be served directly by a web server). This is an expansion of the FAQ question "Can a local Lenya instance generate a site that is deployed on a remote hosting service?" at http://lenya.apache.org/1_2_x/how-to/faq.html:

In the file located at \pubs
*YOUR PUBLICATION*\config\tasks\tasks.xconf look for the commented out lines and uncomment.

<!--
<task id="export" class="org.apache.lenya.cms.publishing.StaticHTMLExporter">
    <parameter name="export-path" value="work/export/pending"/>
    <parameter name="substitute-regexp" value="/lenya/default/live/"/>
    <parameter name="substitute-replacement" value="/"/>
    <parameter name="my-server-port" value="1313"/>
</task>
-->

To change the directory as to where the files are stored alter the line

<parameter name="export-path" value="work/export/pending"/>

change the value to the physical path that you want your static html to be value=”c:\somefolder\someotherfolder\etc” the folders do not have to be created before you export your html, they will be dynamically generated.

You can also specify multiple places to store the static html:

In the file tasks.xconf

<task id="publish">
		:
		:
		:
<task id="export" class="org.apache.lenya.cms.publishing.StaticHTMLExporter">
    <parameter name="export-path" value="c:/somedirectory"/>
    <parameter name="substitute-regexp" value="/lenya/default/live/"/>  - what does this do?
    <parameter name="substitute-replacement" value="/"/>                - what does this do?
    <parameter name="my-server-port" value="1313"/>                     - what does this do?
</task>

<task id="export-backup" class="org.apache.lenya.cms.publishing.StaticHTMLExporter">
    <parameter name="export-path" value="c:/somedirectory-backup"/>
    <parameter name="substitute-regexp" value="/lenya/default/live/"/>  - what does this do?
    <parameter name="substitute-replacement" value="/"/>                - what does this do?
    <parameter name="my-server-port" value="1313"/>                     - what does this do?
</task>

  • No labels