This is example 6 as described in the Wsmake User Manual.

Have you read example 5 yet? We assume that you have, so if you haven't read
it yet, please do so now.

We cover nesting PageOrders in this example. We are going to use the
same configuration from example 5. And we have made all of the changes for you.

This example can be found in the doc/examples/ex6/ directory of the source
distribution.

What does "nesting PageOrders" mean? This means PageOrders that are used by
a PageOrder. We want to use this if, for instance, our footer becomes
complex enough that dividing it into parts is efficient. In the example
we have, a possible place to use a nested PageOrder is with the menu. We
could put the menu in a PagePart, and then make a PageOrder for
the PagePart that can be used by the footer PagePart. For example:

  PagePart {
    name "menu"
    filename "menu.html"
    directory "templates"
  }

  PageOrder {
    name "menu"
    part "menu"
    data
  }

  PagePart {
    name "footer"
    filename "footer.html"
    directory "templates"

    pageorder "menu"
  }

See how the footer PagePart now uses the menu pageorder? This means that
the menu.html file will be prepended to the footer, before it is appended
later to the Page's that use it. All of the necessary changes have been
made for you in the files, but I encourage you to look at each file and
notice the differences. Specifically how the menu no longer has uniqueness
for each DefaultPage like it did before. This will be solved in the next
example.

Running wsmake on the configuration file should show an extra ".", as well
as a new part, in the make process:

New Part   : menu.html                     
New Part   : header.html                   
New Part   : footer.html                   
New Webpage: index.html                    [.i...]
New Webpage: about.html                    [....]
New Webpage: help.html                     [....]

If you update the menu, by adding a new item for instance, output could
look like (debug level 2 here):

Loading configuration:
1 PageGroup, 3 Pages.
Synchronizing database with filesystem:
Upd Part   : menu.html                     
--- Part   : header.html                   
PoU Part   : footer.html                   
Making website:
PoU Webpage: index.html                    [.i...]
PoU Webpage: about.html                    [....]
PoU Webpage: help.html                     [....]

As more and more pageorders are used, it is necessary to reduce duplication
in the configuration file to reduce maintenance time. The common element that
is repeated many times is the directory location of the PageParts. In the
PageGroup section you can define part_dir to hold a default directory to look
in for PageParts, and then leave the directory definition out of the PagePart:

  PageGroup {
    database "ex6.db"
    part_dir "templates"

    PagePart {
      name "header"
      filename "header.html"
    }
  }

A final note, another way we could have included the menu was by simply
creating the pagepart and referencing it in the "default" pageorder like:

  PageOrder {
    name "default"
    part "header"
    data
    part "menu"
    part "footer"
  }

Ok, this is the end of example 6.
