projects
/
ikiwiki.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
* Add rel=tag attribute to tag links, supporting that microformat, as well
[ikiwiki.git]
/
IkiWiki.pm
diff --git
a/IkiWiki.pm
b/IkiWiki.pm
index b4c588c3a39f42bd383170b2b3938195da8cf8d7..0af4a4fe9303f292977294a8de5ec88d5ddf7d24 100644
(file)
--- a/
IkiWiki.pm
+++ b/
IkiWiki.pm
@@
-54,6
+54,7
@@
sub defaultconfig () { #{{{
syslog => 0,
wikiname => "wiki",
default_pageext => "mdwn",
syslog => 0,
wikiname => "wiki",
default_pageext => "mdwn",
+ htmlext => "html",
cgi => 0,
post_commit => 0,
rcs => '',
cgi => 0,
post_commit => 0,
rcs => '',
@@
-85,6
+86,7
@@
sub defaultconfig () { #{{{
adminemail => undef,
plugin => [qw{mdwn inline htmlscrubber passwordauth openid signinedit
lockedit conditional}],
adminemail => undef,
plugin => [qw{mdwn inline htmlscrubber passwordauth openid signinedit
lockedit conditional}],
+ libdir => undef,
timeformat => '%c',
locale => undef,
sslcookie => 0,
timeformat => '%c',
locale => undef,
sslcookie => 0,
@@
-139,8
+141,12
@@
sub checkconfig () { #{{{
} #}}}
sub loadplugins () { #{{{
} #}}}
sub loadplugins () { #{{{
+ if (defined $config{libdir}) {
+ unshift @INC, $config{libdir};
+ }
+
loadplugin($_) foreach @{$config{plugin}};
loadplugin($_) foreach @{$config{plugin}};
-
+
run_hooks(getopt => sub { shift->() });
if (grep /^-/, @ARGV) {
print STDERR "Unknown option: $_\n"
run_hooks(getopt => sub { shift->() });
if (grep /^-/, @ARGV) {
print STDERR "Unknown option: $_\n"
@@
-256,7
+262,7
@@
sub targetpage ($$) { #{{{
sub htmlpage ($) { #{{{
my $page=shift;
sub htmlpage ($) { #{{{
my $page=shift;
- return targetpage($page,
"html"
);
+ return targetpage($page,
$config{htmlext}
);
} #}}}
sub srcfile ($) { #{{{
} #}}}
sub srcfile ($) { #{{{
@@
-466,7
+472,7
@@
sub displaytime ($) { #{{{
sub beautify_url ($) { #{{{
my $url=shift;
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;
$url =~ s!^$!./!; # Browsers don't like empty links...
return $url;
@@
-540,7
+546,12
@@
sub htmllink ($$$;@) { #{{{
$bestlink.="#".$opts{anchor};
}
$bestlink.="#".$opts{anchor};
}
- return "<a href=\"$bestlink\">$linktext</a>";
+ my @attrs;
+ if (defined $opts{rel}) {
+ push @attrs, ' rel="'.$opts{rel}.'"';
+ }
+
+ return "<a href=\"$bestlink\"@attrs>$linktext</a>";
} #}}}
sub htmlize ($$$) { #{{{
} #}}}
sub htmlize ($$$) { #{{{