At Wed, 07 Apr 2010 11:05:01 +0100, Mark Rogers wrote:
I'm (fairly) sure someone here was talking about a templating system for generating static HTML (ie you write the templates, run a script, and get a set of HTML that you upload to the website). I can't find it by searching my ALUG archive for phrases like static, HTML or template, though.
Does anyone recall what it was? If not (or regardless), does anyone have any recommendations?
I'm building a website for someone who will need to maintain the static HTML themselves when finished. Since all the pages have common elements it's a pain not templating it for my own benefit, however.
I could just work in PHP/Smarty as I normally would, then "wget --mirror" the site to generate the static HTML, but if there are better solutions I'm always happy to learn something new!
It's pretty likely than *any* templating system could be used to generate output offline. (A templating engine that was irrecoverably coupled to an HTTP server would be arguably quite badly designed and should probably be treated with quite some suspicion.)
I use XSLT quite a lot which requires an XSLT processor (such as libxslt's xsltproc, sablotron, Saxon, Xalan, etc.) but is usually considered quite hard to learn.
I've also used Genshi http://genshi.edgewall.org/ which is implemented in Python and could easily be integrated into a small script.
However, Genshi (to and extent) and certainly XSLT assume that you're starting with XML encoded content.