Add MACRO media_baseurl

Allow the audio files to be served from a different host
This commit is contained in:
Roan Horning 2022-09-18 16:18:05 -04:00
parent 0edf9cc5a2
commit c817e3a17a
Signed by untrusted user: rho_n
GPG Key ID: 234AEF20B72D5769
2 changed files with 12 additions and 0 deletions

View File

@ -125,6 +125,8 @@ sub main {
# from the generated list of pages. # from the generated list of pages.
@page_args= grep { $_ ne 'DBI' } @page_args; @page_args= grep { $_ ne 'DBI' } @page_args;
@page_args= grep { $_ ne 'root_template' } @page_args; @page_args= grep { $_ ne 'root_template' } @page_args;
@page_args= grep { $_ ne 'media_hostname' } @page_args;
}; };
foreach my $page_arg (@page_args) { foreach my $page_arg (@page_args) {
my %parsed_arg = parse_page_arg($page_arg); my %parsed_arg = parse_page_arg($page_arg);
@ -142,6 +144,10 @@ sub main {
$page_config->{'baseurl'} = $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};
}
if ($page_config->{'multipage'} && $page_config->{'multipage'} eq 'true') { if ($page_config->{'multipage'} && $page_config->{'multipage'} eq 'true') {
if (scalar @{$parsed_arg{'ids'}} == 1) { if (scalar @{$parsed_arg{'ids'}} == 1) {
@{$parsed_arg{'ids'}} = get_ids_from_db($tt, \$page_config); @{$parsed_arg{'ids'}} = get_ids_from_db($tt, \$page_config);

View File

@ -39,6 +39,12 @@
<!--% IF baseurl %-->./<!--% ELSE %-->/<!--% END %--> <!--% IF baseurl %-->./<!--% ELSE %-->/<!--% END %-->
<!--% END %--> <!--% END %-->
<!--% MACRO media_baseurl(baseurl, media_hostname) BLOCK %-->
<!--% IF media_hostname %-->
https://<!--% media_hostname %-->/<!--% ELSE %-->
<!--% baseurl %--><!--% END %-->
<!--% END %-->
<!--% MACRO step_navigation(baseurl, links, folder) BLOCK %--> <!--% MACRO step_navigation(baseurl, links, folder) BLOCK %-->
<!--% IF folder == "" %--> <!--% IF folder == "" %-->
<!--% folder = hpr %--> <!--% folder = hpr %-->