While working on our website(WyeWorks website), we wanted to serve some dynamic content but it just didn’t justify having some “big” dynamic technology behind to achieve this. Also as programmers, we like our code (even our static website content) to be nicely separated so we can keep things in order, better maintenance, blah blah blah. Seriously, we really like those things :)
So that’s when we came across the Apache Server Side Includes (Apache SSI) (a much more interesting topic than the addressed here). So, then we divided our static pages to separate the header, menu, content, footer, and we placed a bunch of page includes.
One drawback: checking the content and styles as a whole is now a little bit difficult if you don’t have your Apache SSI capable on handy to reassemble all back together. So this tiny dumb script library (plus some bunch of code not shown here) did that for us.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31
It behaves pretty much like any standard copy command, adding the replacement of the included files for their real content. Note there is no error checking whatsoever.
Hopefully it will save a minute or two to someone somewhere.