From 33f60260b233d0310ce6dd4304304a516595b906 Mon Sep 17 00:00:00 2001 From: Simon McVittie Date: Sun, 5 Oct 2014 23:49:17 +0100 Subject: In html5 mode, generate a host- or protocol-relative for the CGI This increases the number of situations in which we do the right thing. --- IkiWiki/CGI.pm | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) (limited to 'IkiWiki/CGI.pm') 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, ); -- cgit v1.2.3