otherHtml.rst (cheetah3-3.1.0) | : | otherHtml.rst (cheetah3-3.2.0) | ||
---|---|---|---|---|
non-Webware HTML output | non-Webware HTML output | |||
======================= | ======================= | |||
(otherHTML) | ||||
Cheetah can be used with all types of HTML output, not just with | Cheetah can be used with all types of HTML output, not just with | |||
Webware. | Webware. | |||
Static HTML Pages | Static HTML Pages | |||
----------------- | ----------------- | |||
(otherHTML.static) | ||||
Some sites like Linux Gazette (http://www.linuxgazette.com/) | Some sites like Linux Gazette (http://www.linuxgazette.com/) | |||
require completely static pages because they are mirrored on | require completely static pages because they are mirrored on | |||
servers running completely different software from the main site. | servers running completely different software from the main site. | |||
Even dynamic sites may have one or two pages that are static for | Even dynamic sites may have one or two pages that are static for | |||
whatever reason, and the site administrator may wish to generate | whatever reason, and the site administrator may wish to generate | |||
those pages from Cheetah templates. | those pages from Cheetah templates. | |||
There's nothing special here. Just create your templates as usual. | There's nothing special here. Just create your templates as usual. | |||
Then compile and fill them whenever the template definition | Then compile and fill them whenever the template definition | |||
changes, and fill them again whenever the placeholder values | changes, and fill them again whenever the placeholder values | |||
change. You may need an extra step to copy the .html files to their | change. You may need an extra step to copy the .html files to their | |||
final location. A Makefile (chapter tips.Makefile) can help | final location. A Makefile (chapter tips.Makefile) can help | |||
encapsulate these steps. | encapsulate these steps. | |||
CGI scripts | CGI scripts | |||
----------- | ----------- | |||
(otherHTML) | ||||
Unlike Webware servlets, which don't have to worry about the HTTP | Unlike Webware servlets, which don't have to worry about the HTTP | |||
headers, CGI scripts must emit their own headers. To make a | headers, CGI scripts must emit their own headers. To make a | |||
template CGI aware, add this at the top: | template CGI aware, add this at the top: | |||
:: | :: | |||
#extends Cheetah.Tools.CGITemplate | #extends Cheetah.Tools.CGITemplate | |||
#implements respond | #implements respond | |||
$cgiHeaders#slurp | $cgiHeaders#slurp | |||
End of changes. 3 change blocks. | ||||
6 lines changed or deleted | 0 lines changed or added |