]> git.vanrenterghem.biz Git - git.ikiwiki.info.git/blobdiff - IkiWiki.pm
updates
[git.ikiwiki.info.git] / IkiWiki.pm
index 0b576b32f886046d6648071dc1fdb6d5cc95d170..ea44081aa25f33c693d0c82b19bc081a38fbfa9d 100644 (file)
@@ -151,7 +151,9 @@ sub loadplugins () { #{{{
                unshift @INC, possibly_foolish_untaint($config{libdir});
        }
 
-       loadplugin($_) foreach @{$config{plugin}};
+       foreach my $plugin (@{$config{plugin}}) {
+               loadplugin($plugin);
+       }
 
        run_hooks(getopt => sub { shift->() });
        if (grep /^-/, @ARGV) {
@@ -548,10 +550,11 @@ sub beautify_url ($) { #{{{
        return $url;
 } #}}}
 
-sub urlto ($$) { #{{{
+sub urlto ($$;$) { #{{{
        my $to=shift;
        my $from=shift;
-
+       my $absolute=shift;
+       
        if (! length $to) {
                return beautify_url(baseurl($from)."index.$config{htmlext}");
        }
@@ -560,6 +563,10 @@ sub urlto ($$) { #{{{
                $to=htmlpage($to);
        }
 
+       if ($absolute) {
+               return $config{url}.beautify_urlpath("/".$to);
+       }
+
        my $link = abs2rel($to, dirname(htmlpage($from)));
 
        return beautify_url($link);
@@ -720,7 +727,7 @@ sub preprocess ($$$;$$) { #{{{
                my $params=shift;
                $params="" if ! defined $params;
 
-               f (length $escape) {
+               if (length $escape) {
                        return "[[$prefix$command $params]]";
                }
                elsif (exists $hooks{preprocess}{$command}) {