forked from rho_n/hpr_generator
Consume root_template properties generically
Allow user to define root_template properties in the site.cfg file without need to modify site_generator program.
This commit is contained in:
parent
fb70ae6253
commit
d556e28e2d
@ -140,12 +140,13 @@ sub main {
|
|||||||
$page_config->{'root_template'} = $config{root_template}{content};
|
$page_config->{'root_template'} = $config{root_template}{content};
|
||||||
}
|
}
|
||||||
|
|
||||||
if (exists $config{root_template}{baseurl}) {
|
# Set all config root_template properties as default page config properties
|
||||||
$page_config->{'baseurl'} = $config{root_template}{baseurl};
|
# except the previously set root_template content property
|
||||||
}
|
my @root_args = grep { $_ ne 'content' } keys %{$config{root_template}};
|
||||||
|
foreach my $root_arg (@root_args) {
|
||||||
if (exists $config{root_template}{media_hostname}) {
|
if (exists $page_config->{$root_arg} == 0) {
|
||||||
$page_config->{'media_hostname'} = $config{root_template}{media_hostname};
|
$page_config->{$root_arg} = $config{root_template}{$root_arg};
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($page_config->{'multipage'} && $page_config->{'multipage'} eq 'true') {
|
if ($page_config->{'multipage'} && $page_config->{'multipage'} eq 'true') {
|
||||||
|
Loading…
Reference in New Issue
Block a user