2 package IkiWiki::Plugin::pagecount;
9 hook(type => "getsetup", id => "pagecount", call => \&getsetup);
10 hook(type => "preprocess", id => "pagecount", call => \&preprocess);
23 my $pages=defined $params{pages} ? $params{pages} : "*";
25 # Just get a list of all the pages, and count the items in it.
26 # Use a presence dependency to only update when pages are added
30 # optimisation to avoid needing to try matching every page
31 add_depends($params{page}, $pages, deptype("presence"));
32 return scalar keys %pagesources;
35 return scalar pagespec_match_list($params{page}, $pages,
36 deptype => deptype("presence"));