I need a script that searches files for SSI and replaces the include with the actual HTML
On your dev machine, use your browser to display the web page, and then save the 'result' with an appropriate file name/in an output directory.
Thus, if you had mainfile.html which executed various time/last-mod directives and which included fileA.inc and fileB.inc at appropriate places, the resulting display (and save-able HTML file) will comprise all four/five components.
=dn
I am developing the front end code of a website which I will be handing over to some developers for them to integrate it with the backend. The site will be written in .NET but I'm developing the front end code with static HTML files (and a bit of javascript).
Because the header, footer and a few other elements are the same across all pages I am using Server Side Includes in my development environment. However, every time I hand the code to the developers I need to manually replace each SSI with the actual HTML by copying and pasting. This is starting to get tedious.
I have tried writing a bash script to do this but my bash knowledge is extremely limited so I have failed miserably (I'm not really sure where to start).
What I tried to achieve was:

Loop through all the HTML files in my project
Look for an include ( <!--#include file="myfile.html"--> )
If one is found, replace the include with the HTML from the file specified in the include
Keep doing this until there are no more includes and move on to the next file

Does anyone know of a script that can do this, or can point me in the right direction for achieving this myself? I'm happy for it to be in any language as long as I can run it on my Mac.
Thanks.
EDIT
It is safe to assume that all instances of <!--#include file="myfile.html"--> are on their own line.