push @links, { url => $href, page => pagetitle($p_trimmed) };
}
- @links = sort { $a->{page} cmp $b->{page} } @links;
-
- return \@links, [] if @links <= $config{numbacklinks} || ! $config{numbacklinks};
- return [@links[0..$config{numbacklinks}-1]],
- [@links[$config{numbacklinks}..$#links]];
+ return @links;
} #}}}
sub parentlinks ($) { #{{{
$template->param(have_actions => 1);
}
- my ($backlinks, $more_backlinks)=backlinks($page);
+ my @backlinks=sort { $a->{page} cmp $b->{page} } backlinks($page);
+ my ($backlinks, $more_backlinks);
+ if (@backlinks <= $config{numbacklinks} || ! $config{numbacklinks}) {
+ $backlinks=\@backlinks;
+ $more_backlinks=[];
+ }
+ else {
+ $backlinks=[@backlinks[0..$config{numbacklinks}-1]];
+ $more_backlinks=[@backlinks[$config{numbacklinks}..$#backlinks]];
+ }
$template->param(
title => $page eq 'index'
# Always needs to be done, since filters might add links
# to the content.
- $content=filter($page, $content);
+ $content=filter($page, $page, $content);
my @links;
while ($content =~ /(?<!\\)$config{wiki_link_regexp}/g) {
my $type=pagetype($file);
my $srcfile=srcfile($file);
if (defined $type) {
- my $content=readfile($srcfile);
my $page=pagename($file);
delete $depends{$page};
will_render($page, htmlpage($page), 1);
- $content=filter($page, $content);
- $content=preprocess($page, $page, $content);
- $content=linkify($page, $page, $content);
- $content=htmlize($page, $type, $content);
+ my $content=htmlize($page, $type,
+ linkify($page, $page,
+ preprocess($page, $page,
+ filter($page, $page,
+ readfile($srcfile)))));
writefile(htmlpage($page), $config{destdir},
genpage($page, $content, mtime($srcfile)));
my $content=readfile($srcfile);
my $page=pagename($file);
$pagesources{$page}=$file;
- $content=filter($page, $content);
+ $content=filter($page, $page, $content);
$content=preprocess($page, $page, $content);
$content=linkify($page, $page, $content);
$content=htmlize($page, $type, $content);