diff options
author | Joey Hess <joey@gnu.kitenet.net> | 2009-04-23 15:45:30 -0400 |
---|---|---|
committer | Joey Hess <joey@gnu.kitenet.net> | 2009-04-23 15:45:30 -0400 |
commit | aa306957bac11477b914ac19b93890184ffe4062 (patch) | |
tree | c9b05bf73cb4d19e55297ad3b335bb1fc3ce67e5 /IkiWiki/Plugin/orphans.pm | |
parent | 527d178c12141d2467dfa86492e249d021b88997 (diff) | |
download | ikiwiki-aa306957bac11477b914ac19b93890184ffe4062.tar ikiwiki-aa306957bac11477b914ac19b93890184ffe4062.tar.gz |
pagespec_match_list added and used in most appropriate places
* pagespec_match_list: New API function, matches pages in a list
and throws an error if the pagespec is bad.
* inline, brokenlinks, calendar, linkmap, map, orphans, pagecount,
pagestate, postsparkline: Display a handy error message if the pagespec
is erronious.
Diffstat (limited to 'IkiWiki/Plugin/orphans.pm')
-rw-r--r-- | IkiWiki/Plugin/orphans.pm | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/IkiWiki/Plugin/orphans.pm b/IkiWiki/Plugin/orphans.pm index 605e6e43a..cf74c9b79 100644 --- a/IkiWiki/Plugin/orphans.pm +++ b/IkiWiki/Plugin/orphans.pm @@ -35,9 +35,10 @@ sub preprocess (@) { my @orphans; my $discussion=gettext("discussion"); - foreach my $page (keys %pagesources) { - next if $linkedto{$page} || $page eq 'index'; - next unless pagespec_match($page, $params{pages}, location => $params{page}); + foreach my $page (pagespec_match_list( + [ grep { ! $linkedto{$_} && $_ 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 { |