I have shared your interest in producing what I call "dynamically-generated static pages". I've started (who hasn't! :-) ) a couple of projects (first in Perl, then in C) which I guess are essentially template-processing systems (command line based), but the long term goal was to produce a GUI-based application.
I could try and dig up the backend code & post it somewhere if you'd like, although I wouldn't suggest that it was necessarily a good example of coding... :-/