Automated Production of Web Pages

Polytropon freebsd at
Thu Jun 18 16:20:32 UTC 2009

On Thu, 18 Jun 2009 06:55:41 -0500, Martin McCormick <martin at> wrote:
> 	This needs to be some sort of script application so we
> can feed it automatically and not have to manually build each
> page.
> 	Is there any open-source platform which makes this
> especially quick and easy?

I've found that a source file from : separated valus serves
well for the (sometimes changed and appended) source data,
and a Makefile that does everything else. From this Makefile,
I simply first call a preamble HTML file, then a simple
awk script that adds the data lines, sourced by the CSV
file, in HTML format, and finally a HTML file with the
rest of the page. The command "make install" would then
automatically upload it.

> Of course, as one who likes to script
> repetitive tasks, I can attest to the fact that that first
> script is murder at times but the time you spent building it is
> payed back the next time when it runs automatically at 3 A.M.
> and only took 15 seconds to run.

Really, it's not a big deal, no "murder at times". The easiest
way is you start with one HTML file that represents what you
want to have in the end, then cut it into three parts (the
preamble, the changing part, the footer) and the replace the
changing part by a script.

Well, you can even (ab)use cpp for this.

	HTMLPP=cpp -C -P -traditional

The advantage is that you have separated parts for everything.
The preamble file changes the look of the page, e. g. via CSS.
The CSV database contains the changing data, and the awk script
contains the description how the data should be displayed. This
separation makes it very easy if you want to change of of the
different aspects I mentioned.

> 	So, are there php-based or other packages that help
> automate this process?

Forgive my polite disagreement, but according to your description
which sounds to describe a relatively easy problem, PHP looks
like really too much, "too big" for this job. (I don't use PHP
very often, so my opinion might not be the best one to rely on.)

> That's why I love Unix.

If you love UNIX, why not following its philosophy? Keep the
thing simple. Make one solution that solves the problem best,
nothing more, nothing less. As you said, it may take some time
to get it running, but when it runs, it will run nearly forever.

>From Magdeburg, Germany
Happy FreeBSD user since 4.0
Andra moi ennepe, Mousa, ...

More information about the freebsd-questions mailing list