Archived
4
2

Configure root template page in config file

Currently the root template is page.tpl.html.
This commit is contained in:
2022-06-29 11:03:32 -04:00
parent e19e34a60a
commit dd8b9b655b
2 changed files with 9 additions and 4 deletions

View File

@@ -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";
}