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.
Unfortunately our client cannot (and will not) host any server side code (and before you ask, this will not change and hosting the files ourselves is not an option), so any files deployed to them must be HTML, Javascript, CSS, images and Flash only.
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 guess it would be similar to spidering the site, but I'd like something a bit more reliable because some page assets are loaded dynamically with javascript.
Thanks
Best Solution
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
ttree
command 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,
tpl/defaults
isAnd
tpl/wrapper
isThis will process the real template; put the results in the
content
variable and then process thestyle
template (set withpage.style
intpl/defaults
; defaults todefaults.html
).the
lib/style/default.html
style file just needs to havesomewhere 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.