tags:

views:

56

answers:

3

If you use dynamic pages like JSP or asp.net, you can have your page template included, and then content added. But what if you have no server-side component and all pages are just HTML/JS? You can of course create a template then copy it for each page, but then if you want to change something you risk having to modify every page, even if you put most styling in CSS properly.

Are there any non-awful ways to do this? I could see that an iframe could be used to load the content into the central page but that sounds nasty. Does HTML provide any way to include a base file and add to it?

+1  A: 

You can use Server Side Includes to include other files on the server. It's similar to scripting languages like ASP or php, but SSI is usually supported by the server directly, so it's available on many servers, even if there is scripting language available.

poke
This seems the best approach. I don't have time/inclination to do a proper Java/ASP.net site and my host doesn't support them. The other option is PHP but I don't know it or want to learn it. SSI seem to be included on every host and require virtually no knowledge to stitch a file together.
John
+1  A: 

The answer is still templates. Just process them offline instead of on the server. I like to use ttree for this.

David Dorward
A: 

You can create the pages offline and render into HTML, and deploy those to the site.

One option might be: http://thewml.org/ but it does feel ... "too much". I also saw asciidoc for creating sites ( http://www.methods.co.nz/asciidoc/ ) and I also used several times doxygen for that ( http://www.stack.nl/~dimitri/doxygen/ ).

I also saw CMS that create static HTML files, but hey are no longer maintained.

elcuco
Got any more specifics?
John
makefiles + cat? Updated answer
elcuco