We have a client for whom we build a lot of template based sites. Ideally we would use something like kohana (http://www.kohanaphp.com/) to handle the templating and make doing site wide changes a breeze.
Is there a good way to develop in a framework environment like kohana to make the site manageable, but be able to deploy or export a HTML only version of the site (there is no dynamic aspect to the site such as searching that requires server side languages, and no database use)?
I use Template Toolkit (Perl) and have a simple script that generates static files from the templates. This is great for the situation you are in (common navigation etc etc).
It comes with a
ttreecommand that'll process a directory tree and put the results in another.
Here's the tt.rc file I use:
A couple of special files,
This will process the real template; put the results in the
contentvariable and then process the
styletemplate (set with
tpl/defaults; defaults to
lib/style/default.htmlstyle file just needs to have
somewhere to include the real template; before and after that you can have the standard footer and headers.
You can read more about Template Toolkit at tt2.org.
Another option would be to use
wget(or similar) in recursive mode to "mirror" pages generated by PHP on the development server; but I wouldn't recommend that.