[WM] Recursive reading of content files

Warren Post munisrc.softhome.net
Mon Dec 30 12:44:01 GMT 2002


I have content files, one per output page, in a directory structure that
mimics the directory structure of my site, like:

/
    root1.txt
    root2.txt
    /albert/
      albert1.txt
      albert2.txt
      /bill/
        bill1.txt
        bill2.txt
    /abigail/
      abigail1.txt
      abigail2.txt

...and so on. I want WebMake to read each file and create the
corresponding output files. From one of jmason's examples I have the
following in my .wmk file:

<contents src="." name=".../*.txt" />
<content name=all_files>
<{perl
    # this script from webmake.taint.org
    # create a ${all_files} variable containing the list
    # of all the text files we just loaded.
    $_ = "";
    foreach my $pg (content_matching ("*.txt")) {
      $pg =~ s/.txt//; $_ .= "$pg ";
    }
    $_;
}>
</content>

<content name=out_helper>
    <{set page_text="${${WebMake.OutName}.txt}" }>
    ${page_template}
</content>

<for name="out" values="${all_files}">
    <out file="${out}.html" name="${out}">
      ${out_helper}
    </out>
</for>

...which reads and processes all content files in the root directory
(root1 and root2 in the example above) but does not recursively read the
files in subdirectories. What am I missing to recursively read the files 
in the subdirectories?

TIA and happy holidays.
-- 
Warren Post, Voluntario Naciones Unidas
Departamento de Informática
Municipalidad de Santa Rosa de Copán, Honduras
http://santarosahistorica.net/






More information about the Webmake-talk mailing list