X-Git-Url: http://git.vanrenterghem.biz/git.ikiwiki.info.git/blobdiff_plain/3e593eb9c0edd3f5cce7381ca145c0889441d719..e3f7675264914032a21fca8a50170d6c0dd375f9:/IkiWiki.pm diff --git a/IkiWiki.pm b/IkiWiki.pm index 703b596a8..4869b3ef3 100644 --- a/IkiWiki.pm +++ b/IkiWiki.pm @@ -67,6 +67,7 @@ sub defaultconfig () { #{{{ locale => undef, sslcookie => 0, httpauth => 0, + userdir => "", } #}}} sub checkconfig () { #{{{ @@ -116,13 +117,8 @@ sub checkconfig () { #{{{ } #}}} sub loadplugins () { #{{{ - foreach my $plugin (@{$config{plugin}}) { - my $mod="IkiWiki::Plugin::".possibly_foolish_untaint($plugin); - eval qq{use $mod}; - if ($@) { - error("Failed to load plugin $mod: $@"); - } - } + loadplugin($_) foreach @{$config{plugin}}; + run_hooks(getopt => sub { shift->() }); if (grep /^-/, @ARGV) { print STDERR "Unknown option: $_\n" @@ -131,6 +127,16 @@ sub loadplugins () { #{{{ } } #}}} +sub loadplugin ($) { #{{{ + my $plugin=shift; + + my $mod="IkiWiki::Plugin::".possibly_foolish_untaint($plugin); + eval qq{use $mod}; + if ($@) { + error("Failed to load plugin $mod: $@"); + } +} #}}} + sub error ($) { #{{{ if ($config{cgi}) { print "Content-type: text/html\n\n"; @@ -349,7 +355,7 @@ sub baseurl (;$) { #{{{ sub abs2rel ($$) { #{{{ # Work around very innefficient behavior in File::Spec if abs2rel # is passed two relative paths. It's much faster if paths are - # absolute! (Debian bug #376658) + # absolute! (Debian bug #376658; fixed in debian unstable now) my $path="/".shift; my $base="/".shift; @@ -391,9 +397,6 @@ sub htmllink ($$$;$$$) { #{{{ return "$linktext" if length $bestlink && $page eq $bestlink; - # TODO BUG: %renderedfiles may not have it, if the linked to page - # was also added and isn't yet rendered! Note that this bug is - # masked by the bug that makes all new files be rendered twice. if (! grep { $_ eq $bestlink } map { @{$_} } values %renderedfiles) { $bestlink=htmlpage($bestlink); }