<webmake>

<content name="story_1.txt" format="text/et">
<wmmeta name="Title" value="Story 1, blah blah" />
<wmmeta name="Score" value="20" />
<wmmeta name="Abstract"> Story 1, just another story.  </wmmeta>
<wmmeta name="Section" value="Business" />
<wmmeta name="Up" value="mymap" />
This is story 1.
</content>

<content name="story_2.txt" format="text/et">
<wmmeta name="Title" value="Story 2, blah blah" />
<wmmeta name="Score" value="20" />
<wmmeta name="Abstract"> Story 2, just another story.  </wmmeta>
<wmmeta name="Section" value="Technology" />
<wmmeta name="Up" value="story_1.txt" />
This is story 2.
</content>

<content name="story_3.txt" format="text/et">
<wmmeta name="Title" value="Hot! story 3, etc etc." />
<wmmeta name="Score" value="10" />
<wmmeta name="Abstract"> Story 3, the highest-scored story.  </wmmeta>
<wmmeta name="Section" value="Technology" />
<wmmeta name="Up" value="story_2.txt" />
Breaking news! this is story 3.
</content>

<content name="story_4.txt" format="text/et">
<wmmeta name="Title" value="Story 4, zzzzzzz" />
<wmmeta name="Score" value="999" />
<wmmeta name="Abstract"> Story 4, incredibly boring.  </wmmeta>
<wmmeta name="Section" value="Business" />
<wmmeta name="Up" value="story_2.txt" />
This is story 4. It's astoundingly boring, which is why it's down here.
</content>

<content name="story_5.txt" format="text/et">
<wmmeta name="Title" value="Story 5, zzz blah blah" />
<wmmeta name="Score" value="21" />
<wmmeta name="Abstract"> Story 5, nothing much here.  </wmmeta>
<wmmeta name="Section" value="World" />
<wmmeta name="Up" value="story_3.txt" />
This is story 5.
</content>

<content name="story_6.txt" format="text/et">
<wmmeta name="Title" value="Story 6, blah blah" />
<wmmeta name="Score" value="20" />
<wmmeta name="Abstract"> Story 6, just another story.  </wmmeta>
<wmmeta name="Section" value="World" />
<wmmeta name="Up" value="story_5.txt" />
This is story 6.
</content>


<{perlpostdecl
        # create a ${all_stories} variable containing the list
        # of all text files just loaded.
        $_ = '';
        foreach my $pg (sorted_content_matching ("score title", "*.txt"))
	{ $pg =~ s/\.txt$//; $_ .= "$pg "; }
        set_content ("all_stories", $_);
        '';
}>

<{!-- ------------------------------------------------------------------- --}>

<content name=header map=false>
  <html><head> <title>$[this.title]</title> </head>
  <body bgcolor=#ffffff> <h1>WebMake Breadcrumbs Test</h1> <hr />
  $[crumbs] &nbsp; -- &nbsp; <a href=$(idx)>Map</a> <hr />
</content>

<content name=footer map=false> </body> </html> </content>

<{!-- ------------------------------------------------------------------- --}>

<for name=pg values="${all_stories}">
  <out name="${pg}" file="log/breadcrumbs_${pg}.html">
    ${header}${${pg}.txt}${footer}
  </out>
</for>

<{!-- ------------------------------------------------------------------- --}>

<content name=sitemapnode map=false>
  <li> <a href=$(url)>${title}</a>: $[${name}.abstract]<br>
  <ul> ${list} </ul> </li>
</content>

<content name=sitemapleaf map=false>
  <li> <a href=$(url)>${title}</a>: $[${name}.abstract]<br> </li>
</content>

<out name=idx file=log/breadcrumbs.html>
  ${header}${mymap}${footer}
</out>

<sitemap name=mymap node=sitemapnode leaf=sitemapleaf isroot=true>
<wmmeta name=title value="site map" />
<wmmeta name=Abstract value="Map of the site" />
</sitemap>

<{!-- ------------------------------------------------------------------- --}>

<content name=btop map=false>[ <a href=${url}>$[${name}.title]</a> /</content>
<content name=blevel map=false><a href=${url}>$[${name}.title]</a> /</content>
<content name=btail map=false><a href=${url}>$[${name}.title]</a> ]</content>
<breadcrumbs map=mymap name=crumbs top=btop tail=btail level=blevel />

<{!-- ------------------------------------------------------------------- --}>

</webmake>

