2 package IkiWiki::Plugin::pagecount;
9 hook(type => "preprocess", id => "pagecount", call => \&preprocess);
12 sub preprocess (@) { #{{{
14 $params{pages}="*" unless defined $params{pages};
16 # Needs to update count whenever a page is added or removed, so
17 # register a dependency.
18 add_depends($params{page}, $params{pages});
20 my @pages=keys %pagesources;
21 return $#pages+1 if $params{pages} eq "*"; # optimisation
23 foreach my $page (@pages) {
24 $count++ if pagespec_match($page, $params{pages}, $params{page});