orphans: Reuse backlinks info
This plugin was building essentially the same data that is built to handle backlinks, so reuse that as an optimisation.master
parent
949eb252e9
commit
f486271009
|
@ -27,15 +27,9 @@ sub preprocess (@) {
|
||||||
# register a dependency.
|
# register a dependency.
|
||||||
add_depends($params{page}, $params{pages});
|
add_depends($params{page}, $params{pages});
|
||||||
|
|
||||||
my %linkedto;
|
|
||||||
foreach my $p (keys %links) {
|
|
||||||
map { $linkedto{bestlink($p, $_)}=1 if length $_ }
|
|
||||||
@{$links{$p}};
|
|
||||||
}
|
|
||||||
|
|
||||||
my @orphans;
|
my @orphans;
|
||||||
foreach my $page (pagespec_match_list(
|
foreach my $page (pagespec_match_list(
|
||||||
[ grep { ! $linkedto{$_} && $_ ne 'index' }
|
[ grep { ! IkiWiki::backlink_pages($_) && $_ ne 'index' }
|
||||||
keys %pagesources ],
|
keys %pagesources ],
|
||||||
$params{pages}, location => $params{page})) {
|
$params{pages}, location => $params{page})) {
|
||||||
# If the page has a link to some other page, it's
|
# If the page has a link to some other page, it's
|
||||||
|
|
Loading…
Reference in New Issue