#!/bin/bash

SITE_NAME="WickedDocs"

ApplyTemplates()
{
	TITLE="$1"
    SUB_TITLE="$2"
	PAGE_BASENAME="$3"
	# This next command makes it possible for variable expansion to happen when applying the header
	echo `eval $'cat <<\002\n'"$(<tmpl/header.htm)"$'\n\002'` > $PAGE_BASENAME.html
	# The way this does the echo of the cat command causes the white space to be removed
	echo `cat pages/$PAGE_BASENAME.htm tmpl/footer.htm` >> $PAGE_BASENAME.html
}

ApplyTemplates  "About"         "" index
ApplyTemplates  "Downloads"     "" download
ApplyTemplates  "Features"      "" features
ApplyTemplates  "Screenshots"   "" screenshots
ApplyTemplates  "News"          "" news
ApplyTemplates  "Documentation" "" documentation
ApplyTemplates  "Help"          "" help
ApplyTemplates  "Support"       "" support
ApplyTemplates  "F.A.Q."        "Frequently Asked Questions" faq
ApplyTemplates  "Community"     "" community
ApplyTemplates  "Registration"  "" register
ApplyTemplates  "Contact"       "" contact
ApplyTemplates  "Legal"         "" legal

