[WM] server-side includes

Alan Jackson ajackson.oplnk.net
Mon Jul 8 18:40:05 IST 2002


On Mon, 08 Jul 2002 15:19:44 +0100
jm at jmason.org (Justin Mason) wrote:

> 
> Alan Jackson said:
> 
> > I'm a new Webmake user, and I'm still struggling to get my head around
> > all the concepts, but I'm think I'm getting pretty close. One thing is
> > eluding me, however. I have a site where a few pages use server-side 
> > includes from cgi-bin scripts. I need to either, for those selected
> > pages, change their suffix to shtml, or better, just chmod them to
> > have execute permission so that Apache will look for the includes.
> > But I can't for the life of me see how to do it in WebMake. Has
> > anyone else done something like this?
> 
> Hi Alan --
> 
> I don't think there's a good way to get webmake to chmod them
> automatically, apart from shelling out using a bit of perl code.  But
> using .shtml instead of .html should be trivial -- just use that in the
> <out> tag.  Am I missing something?
> 

Well I've tried to do the shtml thing, and the problem I ran into is
that I tried to set it up as metadata, but it didn't seem to work, I couldn't
ever get it to recognize the suffix.

I tried the perl chmod thing too, but the timing was wrong. The perl got run before
the final files were renamed, so it only worked if the file didn't get updated.

If this is something that WebMake doesn't do, perhaps I could hack the code. I'm
a reasonable perl hacker. I'm thinking perhaps an added attribute to the
<out> tag?

BTW - I like it a lot, even if I can't quite get it to do what I want. The parts I
have working are exceptionally cool.

Here is the code that wouldn't work... but then the metadata is still a little bit
of a mystery to me. Basically I set up 2 pages for each file I read in, one with
lots of decoration, and a "printer friendly" style as well.

<contents src="file:raw" name="*" skip=".*" format="text/html" listname="txtfiles" />

<metatable delimiter="|">
.|menu|suffix|filename|title|Abstract
index|Home|html|index|Episcopal Church of the Holy Spirit|Homepage for Church of the Holy Spirit
Staff|Staff|html|Staff|Holy Spirit Staff|Staff and e-mail addresses for Church of the Holy Spirit
Calendar|Calendar|shtml|Calendar|Holy Spirit Calendar|Calendar of Events
</metatable>

<for name="pagename" values="${txtfiles}">
	<out file="${pagename}.${${pagename}.suffix}" name="${pagename}">
		<{set page_text="${${pagename}}" }>
		<{set print="${pagename}_print.html" }>
         	${page_template}
	</out>
	<out file="${pagename}_print.html" name="${pagename}_print">
		<{set page_text="${${pagename}}" }>
		${print_template}
	</out>
</for>

-- 
-----------------------------------------------------------------------
| Alan K. Jackson            | To see a World in a Grain of Sand      |
| alan at ajackson.org          | And a Heaven in a Wild Flower,         |
| www.ajackson.org           | Hold Infinity in the palm of your hand |
| Houston, Texas             | And Eternity in an hour. - Blake       |
-----------------------------------------------------------------------




More information about the Webmake-talk mailing list