]> sipb.mit.edu Git - ikiwiki.git/blobdiff - IkiWiki/Plugin/pagecount.pm
delete inline data after it's used
[ikiwiki.git] / IkiWiki / Plugin / pagecount.pm
index 7ced159823fff8cf8139392d9b6d81e903f3390f..2c20ca195dcd1f55ff4cdbe9ad70fed642c236af 100644 (file)
@@ -1,10 +1,9 @@
 #!/usr/bin/perl
 #!/usr/bin/perl
-# Provides [[pagecount ]] to count the number of pages.
 package IkiWiki::Plugin::pagecount;
 
 use warnings;
 use strict;
 package IkiWiki::Plugin::pagecount;
 
 use warnings;
 use strict;
-use IkiWiki;
+use IkiWiki 2.00;
 
 sub import { #{{{
        hook(type => "preprocess", id => "pagecount", call => \&preprocess);
 
 sub import { #{{{
        hook(type => "preprocess", id => "pagecount", call => \&preprocess);
@@ -22,7 +21,7 @@ sub preprocess (@) { #{{{
        return $#pages+1 if $params{pages} eq "*"; # optimisation
        my $count=0;
        foreach my $page (@pages) {
        return $#pages+1 if $params{pages} eq "*"; # optimisation
        my $count=0;
        foreach my $page (@pages) {
-               $count++ if pagespec_match($page, $params{pages});
+               $count++ if pagespec_match($page, $params{pages}, location => $params{page});
        }
        return $count;
 } # }}}
        }
        return $count;
 } # }}}