From 41a18300eb601733f30219647299c7ce40ad12fb Mon Sep 17 00:00:00 2001 From: Roan Horning Date: Wed, 17 Aug 2022 19:13:42 -0400 Subject: [PATCH] Allow page to configure root_template in configuration file RSS commits will be broken before this commit. --- site-generator | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/site-generator b/site-generator index 99ef842..f0fc16f 100755 --- a/site-generator +++ b/site-generator @@ -131,7 +131,13 @@ sub main { if (exists($config{$parsed_arg{'page'}})) { my $page_config = $config{$parsed_arg{'page'}}; $page_config->{'page'} = $parsed_arg{'page'}; - $page_config->{'root_template'} = $config{root_template}{content}; + + # Set page's root_template to the default root_template if the + # page root_template property is not set in the configuration file. + if (exists $page_config->{'root_template'} == 0) { + $page_config->{'root_template'} = $config{root_template}{content}; + } + if (exists $config{root_template}{baseurl}) { $page_config->{'baseurl'} = $config{root_template}{baseurl}; }