diff --git a/site-generator b/site-generator index f59052e..a984089 100755 --- a/site-generator +++ b/site-generator @@ -55,7 +55,7 @@ sub main { read_config "site.cfg" => my %config; my $tt = get_template_html($config{DBI}); - generate_page($tt, $config{correspondents}{navigation}, $config{correspondents}{content}); + generate_page($tt, $config{root_template}{content}, $config{correspondents}{navigation}, $config{correspondents}{content}); return 0; } @@ -79,14 +79,14 @@ sub get_template_html (\%@) { } -sub generate_page ($tt, $navigation, $content) { - my ($tt, $navigation, $content) = @_; +sub generate_page { + my ($tt, $page, $navigation, $content) = @_; my $tt_vars = { navigation => $navigation, content => $content }; - $tt->process('page.tpl.html', $tt_vars) + $tt->process($page, $tt_vars) || die $tt->error(), "\n"; } diff --git a/site.cfg b/site.cfg index e023acc..f90fab6 100644 --- a/site.cfg +++ b/site.cfg @@ -6,6 +6,11 @@ driver: dbi:SQLite:hpr.db user: password: +# Configure the root template page which pulls in the navigation and +# content templates used by each page. +[root_template] +content: page.tpl.html + # Configure the navigation menu and the content templates for each page # of the site: # [page_name]