return $page."style.css";
} #}}}
+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!
+ my $path="/".shift;
+ my $base="/".shift;
+
+ require File::Spec;
+ my $ret=File::Spec->abs2rel($path, $base);
+ $ret=~s/^// if defined $ret;
+ return $ret;
+}
+
sub htmllink ($$$;$$$) { #{{{
my $lpage=shift; # the page doing the linking
my $page=shift; # the page that will contain the link (different for inline)
"\">?</a>$linktext</span>"
}
- require File::Spec;
- $bestlink=File::Spec->abs2rel($bestlink, dirname($page));
+ $bestlink=abs2rel($bestlink, dirname($page));
if (! $noimageinline && isinlinableimage($bestlink)) {
return "<img src=\"$bestlink\" alt=\"$linktext\" />";
use warnings;
use strict;
-use File::Spec;
use IkiWiki;
use Encode;
foreach my $p (keys %links) {
next if bestlink($page, $p) eq $page;
if (grep { length $_ && bestlink($p, $_) eq $page } @{$links{$p}}) {
- my $href=File::Spec->abs2rel(htmlpage($p), dirname($page));
+ my $href=abs2rel(htmlpage($p), dirname($page));
# Trim common dir prefixes from both pages.
my $p_trimmed=$p;
* Add a html plugin, which can be used to write wikis in raw html,
if you'd ever want to do such a thing. Slightly tricky, since ikiwiki
defaults to not processing .html files, since w/o this plugin they would
- be copied unsanitised. With this plugin, it will process, and html
+ be copied unsanitised. With this plugin, it will process and html
sanitise them, like any other page type.
* Rebuilding wrappers is necessary on upgrade to this version.
* Make ikiwiki --setup --refresh rebuild wrappers, so wrapper rebuild
will be automatically done on all upgrades.
- * Don't sent pings if the wiki is being rebuilt.
+ * Don't send pings if the wiki is being rebuilt.
+ * Work around very innefficient behavior in File::Spec::abs2rel. Result
+ is a savings of 2 pointless fork/execs per link calculation, which
+ results in ~25% speedup of ikiwiki building its own doc wiki, and
+ about 35% speedup displaying RecentChanges!
- -- Joey Hess <joeyh@debian.org> Mon, 3 Jul 2006 21:01:28 -0400
+ -- Joey Hess <joeyh@debian.org> Mon, 3 Jul 2006 23:33:57 -0400
ikiwiki (1.7) unstable; urgency=low