]> sipb.mit.edu Git - ikiwiki.git/blobdiff - IkiWiki/Plugin/pagecount.pm
* Set die_on_bad_params => 0 for all templates, to allow users to modify
[ikiwiki.git] / IkiWiki / Plugin / pagecount.pm
index 865ab4c39d7471154e1185647e962d004bd826ea..cfc962b6c4df0172fca409033326b3153602fc3f 100644 (file)
@@ -4,9 +4,11 @@ package IkiWiki::Plugin::pagecount;
 
 use warnings;
 use strict;
+use IkiWiki;
 
 sub import { #{{{
-       IkiWiki::register_plugin("preprocess", "pagecount", \&preprocess);
+       IkiWiki::hook(type => "preprocess", id => "pagecount", 
+               call => \&preprocess);
 } # }}}
 
 sub preprocess (@) { #{{{
@@ -21,7 +23,7 @@ sub preprocess (@) { #{{{
        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 IkiWiki::pagespec_match($page, $params{pages});
        }
        return $count;
 } # }}}