aboutsummaryrefslogtreecommitdiff
path: root/IkiWiki
diff options
context:
space:
mode:
authorSimon McVittie <smcv@debian.org>2014-10-05 23:49:17 +0100
committerSimon McVittie <smcv@debian.org>2014-10-05 23:49:37 +0100
commit33f60260b233d0310ce6dd4304304a516595b906 (patch)
tree76381930a5f2301c76cf88af8e32bb176d905f22 /IkiWiki
parent3b8da667cc1514a9589190b614307c0a76af532a (diff)
downloadikiwiki-33f60260b233d0310ce6dd4304304a516595b906.tar
ikiwiki-33f60260b233d0310ce6dd4304304a516595b906.tar.gz
In html5 mode, generate a host- or protocol-relative <base> for the CGI
This increases the number of situations in which we do the right thing.
Diffstat (limited to 'IkiWiki')
-rw-r--r--IkiWiki/CGI.pm12
1 files changed, 10 insertions, 2 deletions
diff --git a/IkiWiki/CGI.pm b/IkiWiki/CGI.pm
index 70e3b7134..0224c2aac 100644
--- a/IkiWiki/CGI.pm
+++ b/IkiWiki/CGI.pm
@@ -66,7 +66,10 @@ sub cgitemplate ($$$;@) {
my $page="";
if (exists $params{page}) {
$page=delete $params{page};
- $params{forcebaseurl}=urlabs(urlto($page), $topurl);
+ $params{forcebaseurl}=urlto($page);
+ if (! $config{html5}) {
+ $params{forcebaseurl}=urlabs($params{forcebaseurl}, $topurl);
+ }
}
run_hooks(pagetemplate => sub {
shift->(
@@ -77,12 +80,17 @@ sub cgitemplate ($$$;@) {
});
templateactions($template, "");
+ my $baseurl = baseurl();
+ if (! $config{html5}) {
+ $baseurl = urlabs($baseurl, $topurl),
+ }
+
$template->param(
dynamic => 1,
title => $title,
wikiname => $config{wikiname},
content => $content,
- baseurl => urlabs(baseurl(), $topurl),
+ baseurl => $baseurl,
html5 => $config{html5},
%params,
);