diff options
author | Simon McVittie <smcv@debian.org> | 2010-11-22 23:33:13 +0000 |
---|---|---|
committer | Simon McVittie <smcv@debian.org> | 2010-11-22 23:47:05 +0000 |
commit | 4c224ae143ebc4b13f824fe1782561a5cd165864 (patch) | |
tree | 37dff831b8272cb067841037ea1a01f7ff55bf2e /IkiWiki.pm | |
parent | f032bce79158005032c09e4db75093abaca45751 (diff) | |
download | ikiwiki-4c224ae143ebc4b13f824fe1782561a5cd165864.tar ikiwiki-4c224ae143ebc4b13f824fe1782561a5cd165864.tar.gz |
urlto(): if $from is undef, return a local path, not an absolute URL
Diffstat (limited to 'IkiWiki.pm')
-rw-r--r-- | IkiWiki.pm | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/IkiWiki.pm b/IkiWiki.pm index a4afef8e0..ee0b1f1ea 100644 --- a/IkiWiki.pm +++ b/IkiWiki.pm @@ -1148,6 +1148,12 @@ sub urlto ($$;$) { return $config{url}.beautify_urlpath("/".$to); } + if (! defined $from) { + my $u = $local_url; + $u =~ s{/$}{}; + return $u.beautify_urlpath("/".$to); + } + my $link = abs2rel($to, dirname(htmlpage($from))); return beautify_urlpath($link); |