]> sipb.mit.edu Git - ikiwiki.git/blobdiff - IkiWiki.pm
Merge branch 'master' into autoconfig
[ikiwiki.git] / IkiWiki.pm
index 063cef8e09220dc2beaea0eabf1afea759368a31..01e7cc1e4c1febee4d84209c281e84a78deb7198 100644 (file)
@@ -538,17 +538,18 @@ sub beautify_urlpath ($) { #{{{
 
        # Ensure url is not an empty link, and
        # if it's relative, make that explicit to avoid colon confusion.
-       if ($url !~ /\//) {
+       if ($url !~ /^\//) {
                $url="./$url";
        }
 
        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);