forrest-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jeff Turner <je...@apache.org>
Subject Re: index.html linking and menus
Date Mon, 24 Feb 2003 02:50:39 GMT
On Sun, Feb 23, 2003 at 11:44:25AM -0400, admin wrote:
> Hi,
> 
> when linking to the directory without the file name, or when creating
> site.xml like this:
> 
>     <ch1 label="Chapter 1" href="ch1/"/>
>     <ch2 label="Chapter 2" href="ch2/"/>
>     <ch3 label="Chapter 3" href="ch3/"/>
> 
> forrest appends urls with index.html "automagically". Is there a
> way to stop this? (i.e. I need href=../ch2/ instead of
> href=../ch2/index.html) I've tried to change
> 
> <map:match pattern="**/">
>   <map:redirect-to uri="{request:contextPath}/{1}/index.html" />
> </map:match>
> 
> to
> 
> <map:match pattern="**/">
>   <map:redirect-to uri="{request:contextPath}/{1}/" />
> </map:match>
> 
> in sitemap.xmap to no avail.

This is a bug/feature of the Cocoon command-line.  The workaround is a
bit horrible..

1) Copy $FORREST_HOME/context/sitemap.xmap into your project's
   src/documentation/
2) Edit src/documentation/sitemap.xmap, and change the line 154 from:

         <map:transform src="library/xslt/filterlinks.xsl" />

to:

         <map:transform src="resources/stylesheets/filterlinks.xsl" />

3) Copy the attached filterlinks.xsl into
src/documentation/resources/stylesheets/ (you'll have to create that
directory).

This filters out any links that end with '/', so the Cocoon command-line
doesn't see them.

> Question #2 -- is it possible to rename files during copying to
> "build" dir -- for example replace file extension with "shtml" instead of
> "html"?

It might be possible with enough tweaking of a custom sitemap, but the
easiest solution is just to write an Ant script to do it after Forrest
has run:

<move todir="build/site">
  <fileset dir="build/site"/>
  <mapper type="glob" from="*.html" to="*.shtml"/>
</move>

(haven't tested that)


--Jeff



> 
> many thanks in advance
> 
> -- Sergey
> 
> 

Mime
View raw message