Utilitiy dynamic creation of static pages…(I'm not asking this because I want to, rather becasue I have to…)

StackOverflow https://stackoverflow.com/questions/518168

  •  21-08-2019
  •  | 
  •  

Question

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...)
Was it helpful?

Solution

Sounds like a job for Webby.

OTHER TIPS

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.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top