views:

83

answers:

2

Does anyone know of a utility for **ahem** stringing together static pages.

For instance:
Say I wrote a header and a footer of a page, and I only wanted to change the content without **sigh** dynamically generating the content of the page. (I.E. the page is dynamically generated, but the end result is just a static page to be dumped into an FTP directory.)

I don't normally endorse doing this sort of thing without something like Tiles or serverside includes on a webserver, but unfortunately my employer __does...__they have use static pages and there's nothing I can do to change their minds. (C++ Programmers)

The closest thing to what I am describing here that I have found would be a utility called cook that's used to build tiddlywiki.

Right, so a utility that can take a directory of:

  • Static Page Parts
    • Header.htm
    • Footer.htm
  • Parts that Change
    • about.htm
    • info.htm
    • products.htm
    • etc.htm

And change it into:

  • Site Build
    • about.htm (with header and footer as well as content of /Parts that Change/about.htm) in between
    • info.htm (same bit...)
    • products.htm (same bit...)
    • etc.htm (same bit...)
A: 

Sounds like what you want the end result is something that will take N files and stitch the content into a static HTML page that gets uploaded to what I'm assuming is a webserver. Does that sound about right?

I think Dreamweaver has that functionality, but if you want something a little more low level, use this algorithm:

load config file that you use for build parameters
open stream to output file
for each file in source folder 
    load to stream
    write to output stream
close output stream
post file to remote site

Once your pages have been edited, just have your client run this processor. Please let me know if I've totally mis-interpreted what your trying to accomplish.

EDIT: You can also try putting some kind of token in your "dynamic" pages (%HEADER%, %FOOTER%, etc..) and when ever your processor encounters that token replace it with the actual static content.

Ian Jacobs
Granted this isn't a pre-built utility, but it seems like an interesting little project
Ian Jacobs
+1  A: 

Sounds like a job for Webby.

Chuck
Thanks man, I'm going to go check this out. (And incidentally thank you for not voting my question down due to the shear stupidity of what I'm being told to do by my superiors...)
leeand00
I've been reading about it, and it looks like it works with Sass which is some how tied to the CSS Framework Compass (which I also planned on using). Thanks! I'll let ya know if I get it to work. And if it works I'll check this off as the answer later.
leeand00
@Chuck This did the trick! Thanks Chuck!
leeand00