Photos
Blog
Projects
vanrenterghem.biz
projects
/
git.ikiwiki.info.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
* Fix an infinite loop in the aggregator when finding a unique filename.
[git.ikiwiki.info.git]
/
IkiWiki
/
Plugin
/
orphans.pm
diff --git
a/IkiWiki/Plugin/orphans.pm
b/IkiWiki/Plugin/orphans.pm
index bd3c6b8b9f8e4157856417847458832fbe731d26..2219634caa3a4c28d2a07276712847be48f8363b 100644
(file)
--- a/
IkiWiki/Plugin/orphans.pm
+++ b/
IkiWiki/Plugin/orphans.pm
@@
-7,7
+7,8
@@
use strict;
use IkiWiki;
sub import { #{{{
use IkiWiki;
sub import { #{{{
- IkiWiki::register_plugin("preprocess", "orphans", \&preprocess);
+ IkiWiki::hook(type => "preprocess", id => "orphans",
+ call => \&preprocess);
} # }}}
sub preprocess (@) { #{{{
} # }}}
sub preprocess (@) { #{{{
@@
-27,15
+28,19
@@
sub preprocess (@) { #{{{
my @orphans;
foreach my $page (keys %IkiWiki::renderedfiles) {
next if $linkedto{$page};
my @orphans;
foreach my $page (keys %IkiWiki::renderedfiles) {
next if $linkedto{$page};
- next unless IkiWiki::
globlist
_match($page, $params{pages});
+ next unless IkiWiki::
pagespec
_match($page, $params{pages});
# If the page has a link to some other page, it's
# indirectly linked to a page via that page's backlinks.
# 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 $_ && $_ !~/\/Discussion$/i && IkiWiki::bestlink($page, $_) ne $page } @{$IkiWiki::links{$page}};
+ next if grep {
+ length $_ &&
+ ($_ !~ /\/Discussion$/i || ! $IkiWiki::config{discussion}) &&
+ IkiWiki::bestlink($page, $_) !~ /^($page|)$/
+ } @{$IkiWiki::links{$page}};
push @orphans, $page;
}
return "All pages are linked to by other pages." unless @orphans;
push @orphans, $page;
}
return "All pages are linked to by other pages." unless @orphans;
- return "<ul>\n".join("\n", map { "<li>".IkiWiki::htmllink($params{page}, $_, 1)."</li>" } sort @orphans)."</ul>\n";
+ return "<ul>\n".join("\n", map { "<li>".IkiWiki::htmllink($params{page}, $
params{destpage}, $
_, 1)."</li>" } sort @orphans)."</ul>\n";
} # }}}
1
} # }}}
1