X-Git-Url: http://git.vanrenterghem.biz/git.ikiwiki.info.git/blobdiff_plain/fa52a730ff3b30c7d2cdd8cd5f9c8c25a0c0a2a5..b9dc3e84a512eecf66b2b3e73be39530b588f49c:/IkiWiki/Plugin/pagestats.pm diff --git a/IkiWiki/Plugin/pagestats.pm b/IkiWiki/Plugin/pagestats.pm index 1edb39455..5479e8986 100644 --- a/IkiWiki/Plugin/pagestats.pm +++ b/IkiWiki/Plugin/pagestats.pm @@ -12,7 +12,7 @@ package IkiWiki::Plugin::pagestats; use warnings; use strict; -use IkiWiki; +use IkiWiki 2.00; # Names of the HTML classes to use for the tag cloud our @classes = ('smallestPC', 'smallPC', 'normalPC', 'bigPC', 'biggestPC' ); @@ -33,10 +33,9 @@ sub preprocess (@) { #{{{ my %counts; my $max = 0; foreach my $page (keys %links) { - if (pagespec_match($page, $params{pages}, $params{page})) { + if (pagespec_match($page, $params{pages}, location => $params{page})) { use IkiWiki::Render; - my @bl = IkiWiki::backlinks($page); - $counts{$page} = scalar(@bl); + $counts{$page} = scalar(IkiWiki::backlinks($page)); $max = $counts{$page} if $counts{$page} > $max; } } @@ -50,7 +49,8 @@ sub preprocess (@) { #{{{ } sort { $counts{$b} <=> $counts{$a} } keys %counts). "\n\n" ; - } else { + } + else { # In case of misspelling, default to a page cloud my $res = "