I like Cheetah since it's syntax is very similar to Python and I can use my existing Python objects with it.
I have one master template that set the site general site look and feel (with the master CSS of course).
#from time import ctime$head and $body are place holders that the specific pages will fill.
#attr NAME = "???"
OOOPS, head will roll...
<link rel="stylesheet" type="text/css" href="style.css" />
<div class="header">My Wonderful Site - $NAME</div>
Pages also define $NAME which will be shown in the header.
The an specific page (index.tmpl) can be:
And the CGI script:
#attr NAME = "INDEX"
This is my site index page, see also <a href="other.cgi">other page</a>. <br />
Oh, and also random = $random;
Note that I pass locals() as the search list. This frees me from creating a mapping dictionary (exporting random to the template).
from Cheetah.Template import Template
from random import randint
random = randint(0, 100)
print "Content-Type: text/html"
page = Template(file="index.tmpl", searchList=[locals()])
if __name__ == "__main__":
That's about it, you can use the master template and the site main CSS to have a uniform looking site and let each page implement just the $body and $head if it needs to.