diff options
author | Joey Hess <joey@kodama.kitenet.net> | 2008-07-25 16:16:44 -0400 |
---|---|---|
committer | Joey Hess <joey@kodama.kitenet.net> | 2008-07-25 16:16:44 -0400 |
commit | a71b9a1cf1322cd1423971483969d37efa5ebcf8 (patch) | |
tree | f726ca780ff8f6f2d7b709ef8bdbfd171aaa1420 /IkiWiki.pm | |
parent | af5299677e3a3bdaef75e72f82ccc4600cbd2f66 (diff) | |
download | ikiwiki-a71b9a1cf1322cd1423971483969d37efa5ebcf8.tar ikiwiki-a71b9a1cf1322cd1423971483969d37efa5ebcf8.tar.gz |
fix feed urls
The fix for colons involved adding "./" to some urls. Due to the weird way
inline called urlto, these snuck into feed urls and permalinks. Fix it by
adding an optional third parameter to urlto.
Diffstat (limited to 'IkiWiki.pm')
-rw-r--r-- | IkiWiki.pm | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/IkiWiki.pm b/IkiWiki.pm index c14124f79..01e7cc1e4 100644 --- a/IkiWiki.pm +++ b/IkiWiki.pm @@ -545,10 +545,11 @@ sub beautify_urlpath ($) { #{{{ return $url; } #}}} -sub urlto ($$) { #{{{ +sub urlto ($$;$) { #{{{ my $to=shift; my $from=shift; - + my $absolute=shift; + if (! length $to) { return beautify_urlpath(baseurl($from)."index.$config{htmlext}"); } @@ -557,6 +558,10 @@ sub urlto ($$) { #{{{ $to=htmlpage($to); } + if ($absolute) { + return $config{url}.beautify_urlpath("/".$to); + } + my $link = abs2rel($to, dirname(htmlpage($from))); return beautify_urlpath($link); |