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:
Roan Horning 2022-10-01 13:33:59 -04:00
parent fb70ae6253
commit d556e28e2d
Signed by untrusted user: rho_n
GPG Key ID: 234AEF20B72D5769

View File

@ -140,12 +140,13 @@ sub main {
$page_config->{'root_template'} = $config{root_template}{content};
}
if (exists $config{root_template}{baseurl}) {
$page_config->{'baseurl'} = $config{root_template}{baseurl};
# Set all config root_template properties as default page config properties
# 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 $page_config->{$root_arg} == 0) {
$page_config->{$root_arg} = $config{root_template}{$root_arg};
}
if (exists $config{root_template}{media_hostname}) {
$page_config->{'media_hostname'} = $config{root_template}{media_hostname};
}
if ($page_config->{'multipage'} && $page_config->{'multipage'} eq 'true') {