X-Git-Url: http://git.vanrenterghem.biz/git.ikiwiki.info.git/blobdiff_plain/a29507ec26746b59641a41cd4cc97041ba53ecfa..f7601954a862afd4c5a5b9ba83480af0472e1cf9:/IkiWiki/Plugin/orphans.pm?ds=sidebyside diff --git a/IkiWiki/Plugin/orphans.pm b/IkiWiki/Plugin/orphans.pm index f9ac2cdb2..711226772 100644 --- a/IkiWiki/Plugin/orphans.pm +++ b/IkiWiki/Plugin/orphans.pm @@ -27,29 +27,22 @@ 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; } - return gettext("All pages are linked to from other pages.") unless @orphans; + return gettext("All pages have other pages linking to them.") unless @orphans; return "