The idea
I want to have all pages with the same look and feel, and this is obtained combining two things. First, I make use of Cascading Style Sheets (CSS) to define the page layout and the style of titles, paragraphs, lists, and so on.
Because I want to be able to focus on the content of each page independently of auxiliary things like the menu, I wrote a PERL program which puts all things together in one run.
Note that there are varios ways to do a similar (well, a much better) job in a dynamic way, many of which are using the PERL programming language. A search on the enormous PERL public archive CPAN will show you how many tools one may choose.
My approach is quite simple: instead of dynamically generating web pages when the user asks for them, I generate them only once. In this way, I obtain a set of static pages which are then copied on my web server (at CERN).
The implementation
The "skeleton" is an incredibly simple HTML file containing few keywords, like "REVISION", "Main.Title" and "Comp.Menu". For each keyword like "Where.XYZ" I create one HTML file named "XYZ" in the subdirectory "where", where "where" is "main" or "comp". Inside subdirectory main I collect the HTML files which constitute the bodies of the final web pages, whereas inside comp I collect very small HTML files which represent auxiliary components of the web pages, like the menu.
I wrote a PERL program which creates a mirror file structure of main into the subdirectory htmldoc and, for each file with suffix .main in the former directory, creates a HTML file in the latter one. To create this file, the program takes the HTML "skeleton" and replaces the keywords "Main.Title" and "Main.Body" with the title and content of the corresponding .main file. Uppercase keywords are automatically generated (for example "REVISION" will contain the modification date of the .main file), whereas "Comp.XYZ" are replaced with the content of file comp/XYZ.