]> sipb.mit.edu Git - ikiwiki.git/blobdiff - IkiWiki/Plugin/pagecount.pm
don't need to scan after all; links inside blocks of text should be found
[ikiwiki.git] / IkiWiki / Plugin / pagecount.pm
index fc69e449bb2612ee6afb73f95b4d9977448afbb5..7ced159823fff8cf8139392d9b6d81e903f3390f 100644 (file)
@@ -7,7 +7,7 @@ use strict;
 use IkiWiki;
 
 sub import { #{{{
-       IkiWiki::register_plugin("preprocess", "pagecount", \&preprocess);
+       hook(type => "preprocess", id => "pagecount", call => \&preprocess);
 } # }}}
 
 sub preprocess (@) { #{{{
@@ -16,13 +16,13 @@ sub preprocess (@) { #{{{
        
        # Needs to update count whenever a page is added or removed, so
        # register a dependency.
-       IkiWiki::add_depends($params{page}, $params{pages});
+       add_depends($params{page}, $params{pages});
        
-       my @pages=keys %IkiWiki::pagesources;
+       my @pages=keys %pagesources;
        return $#pages+1 if $params{pages} eq "*"; # optimisation
        my $count=0;
        foreach my $page (@pages) {
-               $count++ if IkiWiki::globlist_match($page, $params{pages});
+               $count++ if pagespec_match($page, $params{pages});
        }
        return $count;
 } # }}}