From b0d31ee5071378fbc46884dfa2cc41e92b27cbf3 Mon Sep 17 00:00:00 2001 From: Roan Horning Date: Sat, 1 Oct 2022 12:51:11 -0400 Subject: [PATCH 1/5] Allow user to modify zero_pad_left MACRO's padding Add optional pad length argument --- templates/shared-utils.tpl.html | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/templates/shared-utils.tpl.html b/templates/shared-utils.tpl.html index 958f17a..e7d5c85 100644 --- a/templates/shared-utils.tpl.html +++ b/templates/shared-utils.tpl.html @@ -1,6 +1,11 @@ - + + + + + + - + From 64ae9c4f86bf867acede0389102b1f9007038cc3 Mon Sep 17 00:00:00 2001 From: Roan Horning Date: Sat, 1 Oct 2022 13:18:35 -0400 Subject: [PATCH 2/5] Refactor media_baseurl MACRO to media_basepath MACRO Prevent name collision with media_basepath root_template/page property of same name. Also fix application of trailing forward slash to path based on existence of baseurl property. --- templates/shared-utils.tpl.html | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/templates/shared-utils.tpl.html b/templates/shared-utils.tpl.html index e7d5c85..52ad659 100644 --- a/templates/shared-utils.tpl.html +++ b/templates/shared-utils.tpl.html @@ -44,10 +44,10 @@ .// - - -https:/// -/ + + + +/ From fb70ae6253a1ca00201611930e7c450ba2f31a23 Mon Sep 17 00:00:00 2001 From: Roan Horning Date: Sat, 1 Oct 2022 13:23:36 -0400 Subject: [PATCH 3/5] Add media_path MACRO to shared utilities Generate the full URL of an audio file. --- templates/shared-utils.tpl.html | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/templates/shared-utils.tpl.html b/templates/shared-utils.tpl.html index 52ad659..3eaecae 100644 --- a/templates/shared-utils.tpl.html +++ b/templates/shared-utils.tpl.html @@ -49,6 +49,21 @@ / + + + + + + + + + + + + + + . + From d556e28e2d05d42506f98fcf6839527d35b6edde Mon Sep 17 00:00:00 2001 From: Roan Horning Date: Sat, 1 Oct 2022 13:33:59 -0400 Subject: [PATCH 4/5] Consume root_template properties generically Allow user to define root_template properties in the site.cfg file without need to modify site_generator program. --- site-generator | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/site-generator b/site-generator index 91e090b..86e52a7 100755 --- a/site-generator +++ b/site-generator @@ -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}; - } - - if (exists $config{root_template}{media_hostname}) { - $page_config->{'media_hostname'} = $config{root_template}{media_hostname}; + # 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 ($page_config->{'multipage'} && $page_config->{'multipage'} eq 'true') { From 1d4e6e15b7bf231375f370bb27e5def70daba65c Mon Sep 17 00:00:00 2001 From: Roan Horning Date: Sat, 1 Oct 2022 13:42:46 -0400 Subject: [PATCH 5/5] Refactor templates to use media_path MACRO --- templates/content-episode.tpl.html | 2 +- templates/content-index.tpl.html | 2 +- templates/content-twat_episode.tpl.html | 4 ++-- templates/shared-episode-summary.tpl.html | 11 +++++++++-- templates/shared-listen-now.tpl.html | 15 ++++++--------- 5 files changed, 19 insertions(+), 15 deletions(-) diff --git a/templates/content-episode.tpl.html b/templates/content-episode.tpl.html index 9b3b643..0ad89a1 100644 --- a/templates/content-episode.tpl.html +++ b/templates/content-episode.tpl.html @@ -75,7 +75,7 @@ Hosted by +

diff --git a/templates/content-index.tpl.html b/templates/content-index.tpl.html index 1743d75..a1cb3b7 100644 --- a/templates/content-index.tpl.html +++ b/templates/content-index.tpl.html @@ -84,7 +84,7 @@
- +
diff --git a/templates/content-twat_episode.tpl.html b/templates/content-twat_episode.tpl.html index 204795b..ef9d965 100644 --- a/templates/content-twat_episode.tpl.html +++ b/templates/content-twat_episode.tpl.html @@ -58,14 +58,14 @@

Hosted by on is flagged as and is released under a license.

- +