When I can't use a templating system (e.g. IkiWiki or CherryPy + Jinja2), I tend to use server side includes to handle all the boilerplate header and footer information that is constant across a website.

Content-carrying .shtml files look something like

<!--#include virtual="/~wking/shared/header.shtml"-->

<h1>Some title</h1>
<p>Bla bla bla.</p>

<!--#include virtual="/~wking/shared/footer.shtml"-->

The boilerplate files (e.g. header.shtml and footer.shtml) are included by the server whenever it serves a page. This is probably wildly inefficient from the server's point of view, but it's very convenient for me :p. It is more efficient if your publishing tool (e.g. IkiWiki) can include this boilerplate once at publish-time, rather than having Apache include it again for every page request.