diff options
Diffstat (limited to 'IkiWiki/Plugin/orphans.pm')
-rw-r--r-- | IkiWiki/Plugin/orphans.pm | 11 |
1 files changed, 2 insertions, 9 deletions
diff --git a/IkiWiki/Plugin/orphans.pm b/IkiWiki/Plugin/orphans.pm index 7c938ef74..711226772 100644 --- a/IkiWiki/Plugin/orphans.pm +++ b/IkiWiki/Plugin/orphans.pm @@ -27,23 +27,16 @@ sub preprocess (@) { # register a dependency. 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 $discussion=lc(gettext("Discussion")); foreach my $page (pagespec_match_list( - [ grep { ! $linkedto{$_} && $_ ne 'index' } + [ grep { ! IkiWiki::backlink_pages($_) && $_ ne 'index' } keys %pagesources ], $params{pages}, location => $params{page})) { # If the page has a link to some other page, it's # indirectly linked to a page via that page's backlinks. next if grep { length $_ && - ($_ !~ /\/\Q$discussion\E$/i || ! $config{discussion}) && + ($_ !~ /\/\Q$config{discussionpage}\E$/i || ! $config{discussion}) && bestlink($page, $_) !~ /^(\Q$page\E|)$/ } @{$links{$page}}; push @orphans, $page; |