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

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

We cover subtags in this example. We are going to use the same configuration
from our last example. This example can be found in the doc/examples/ex2/
directory of the source distribution.

If you looked at the HTML from the last example you may have noticed that
we used the string "Hello World!" in many places. What if we wanted to change
the string to "Hello world!" with a lowercase 'w'? We would have to change it
in 9 places. This isn't too bad. But what if we need to change the name again?
And things get even worse if we add more pages with that string in it. This
sets itself up to be a candidate for tag substitution (SubTags). We could put
"<sitename>" wherever we wanted to display "Hello world!" and then define
"<sitename>" in the configuration file for each page that uses it. We can do
this by defining a SubTag as follows:

  SubTag "<sitename>" "Hello world!"

Where should we define this tag? We need it to work for every page so we
should define it in each Page in the config file. For instance, the
new Page for index.html would look something like:

  Page {
    web_page "index.html"

    SubTag "<sitename>" "Hello world!"
  }

The same modification can be done for the other two pages. Make those
modifications in ./ex2.ws. The file ./ex2.final.ws is what ./ex2.ws
should be like after this example.

The next thing we need to do is change every occurrence of "Hello World!"
to "<sitename>". We have already done this for you. But if you want to do
it, just copy the same three files (index.html,about.html,help.html) from
example 1 on top of the ones for example 2 and make the changes. Either way,
look at the files in the html directory to see how the "<sitename>" tag is
used.

To demonstrate more usefulness of subtags, let's say that we want to
include the date in a comment for when the page was last made by wsmake. We
can do this by using a command-based subtag. The only difference is that
we use the character ` for quotes surrounding the value part. Then the
value part is executed when wsmake parses the subtag, and the output from
that command is put into the output. An example subtag could be:

SubTag "<makedate>" `date`

This will replace every occurrence of <makedate> with the output of the date
command. Add this SubTag after the <sitename> subtag for each Page.

Now run wsmake against ex2.ws

  $ wsmake -f ex2.ws

Note this time we let wsmake automatically create the output directory. Go
into the docs directory and check out the results. "<sitename>" should be
replaced by "Hello world!" and "<makedate>" with the date at the time the
tag was parsed.

Ok, this is the end of example 2.
