Configure root template page in config file
Currently the root template is page.tpl.html.
This commit is contained in:
parent
e19e34a60a
commit
dd8b9b655b
@ -55,7 +55,7 @@ sub main {
|
|||||||
read_config "site.cfg" => my %config;
|
read_config "site.cfg" => my %config;
|
||||||
|
|
||||||
my $tt = get_template_html($config{DBI});
|
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;
|
return 0;
|
||||||
}
|
}
|
||||||
@ -79,14 +79,14 @@ sub get_template_html (\%@) {
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
sub generate_page ($tt, $navigation, $content) {
|
sub generate_page {
|
||||||
my ($tt, $navigation, $content) = @_;
|
my ($tt, $page, $navigation, $content) = @_;
|
||||||
my $tt_vars = {
|
my $tt_vars = {
|
||||||
navigation => $navigation,
|
navigation => $navigation,
|
||||||
content => $content
|
content => $content
|
||||||
};
|
};
|
||||||
|
|
||||||
$tt->process('page.tpl.html', $tt_vars)
|
$tt->process($page, $tt_vars)
|
||||||
|| die $tt->error(), "\n";
|
|| die $tt->error(), "\n";
|
||||||
|
|
||||||
}
|
}
|
||||||
|
5
site.cfg
5
site.cfg
@ -6,6 +6,11 @@ driver: dbi:SQLite:hpr.db
|
|||||||
user:
|
user:
|
||||||
password:
|
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
|
# Configure the navigation menu and the content templates for each page
|
||||||
# of the site:
|
# of the site:
|
||||||
# [page_name]
|
# [page_name]
|
||||||
|
Loading…
Reference in New Issue
Block a user