X-Git-Url: http://git.vanrenterghem.biz/git.ikiwiki.info.git/blobdiff_plain/afcf0dc79e59cdb7c0ac95898e16e7a21ab62121..eceea9db028729d68b319f8b4e95a4ca53a35c2b:/IkiWiki.pm?ds=sidebyside
diff --git a/IkiWiki.pm b/IkiWiki.pm
index 8da2ddde4..0af4a4fe9 100644
--- a/IkiWiki.pm
+++ b/IkiWiki.pm
@@ -54,6 +54,7 @@ sub defaultconfig () { #{{{
syslog => 0,
wikiname => "wiki",
default_pageext => "mdwn",
+ htmlext => "html",
cgi => 0,
post_commit => 0,
rcs => '',
@@ -85,6 +86,7 @@ sub defaultconfig () { #{{{
adminemail => undef,
plugin => [qw{mdwn inline htmlscrubber passwordauth openid signinedit
lockedit conditional}],
+ libdir => undef,
timeformat => '%c',
locale => undef,
sslcookie => 0,
@@ -139,8 +141,12 @@ sub checkconfig () { #{{{
} #}}}
sub loadplugins () { #{{{
+ if (defined $config{libdir}) {
+ unshift @INC, $config{libdir};
+ }
+
loadplugin($_) foreach @{$config{plugin}};
-
+
run_hooks(getopt => sub { shift->() });
if (grep /^-/, @ARGV) {
print STDERR "Unknown option: $_\n"
@@ -256,7 +262,7 @@ sub targetpage ($$) { #{{{
sub htmlpage ($) { #{{{
my $page=shift;
- return targetpage($page, "html");
+ return targetpage($page, $config{htmlext});
} #}}}
sub srcfile ($) { #{{{
@@ -466,7 +472,7 @@ sub displaytime ($) { #{{{
sub beautify_url ($) { #{{{
my $url=shift;
- $url =~ s!/index.html$!/!;
+ $url =~ s!/index.$config{htmlext}$!/!;
$url =~ s!^$!./!; # Browsers don't like empty links...
return $url;
@@ -540,7 +546,12 @@ sub htmllink ($$$;@) { #{{{
$bestlink.="#".$opts{anchor};
}
- return "$linktext";
+ my @attrs;
+ if (defined $opts{rel}) {
+ push @attrs, ' rel="'.$opts{rel}.'"';
+ }
+
+ return "$linktext";
} #}}}
sub htmlize ($$$) { #{{{
@@ -606,7 +617,7 @@ sub preprocess ($$$;$$) { #{{{
my $command=shift;
my $params=shift;
if (length $escape) {
- return "[[$command $params]]";
+ return "\\[[$command $params]]";
}
elsif (exists $hooks{preprocess}{$command}) {
return "" if $scan && ! $hooks{preprocess}{$command}{scan};