]> git.vanrenterghem.biz Git - git.ikiwiki.info.git/blobdiff - IkiWiki/Plugin/pagestats.pm
Revert the effects of find_del_files() for (re)autoadded files.
[git.ikiwiki.info.git] / IkiWiki / Plugin / pagestats.pm
index 47638210aeddeff49866ac1e5a6459828556ddd2..4313aa271e2f55259b04df7b7abfbd1a447ba1cb 100644 (file)
@@ -63,6 +63,16 @@ sub preprocess (@) {
                $max = $counts{$page} if $counts{$page} > $max;
        }
 
                $max = $counts{$page} if $counts{$page} > $max;
        }
 
+       if (exists $params{show}) {
+               my $i=0;
+               my %show;
+               foreach my $key (sort { $counts{$b} <=> $counts{$a} } keys %counts) {
+                       last if ++$i > $params{show};
+                       $show{$key}=$counts{$key};
+               }
+               %counts=%show;
+       }
+
        if ($style eq 'table') {
                return "<table class='pageStats'>\n".
                        join("\n", map {
        if ($style eq 'table') {
                return "<table class='pageStats'>\n".
                        join("\n", map {