X-Git-Url: http://git.vanrenterghem.biz/git.ikiwiki.info.git/blobdiff_plain/498dba8b7049455996c22d791fa146333c04e201..e4ccc4f3b09aaaa4f64bdba1d6ffff24e924fd20:/IkiWiki/Plugin/pagestats.pm
diff --git a/IkiWiki/Plugin/pagestats.pm b/IkiWiki/Plugin/pagestats.pm
index 86ebbe1d5..a1b4c1d45 100644
--- a/IkiWiki/Plugin/pagestats.pm
+++ b/IkiWiki/Plugin/pagestats.pm
@@ -33,7 +33,7 @@ sub preprocess (@) { #{{{
my %counts;
my $max = 0;
- foreach my $page (%IkiWiki::links) {
+ foreach my $page (keys %IkiWiki::links) {
if (IkiWiki::globlist_match($page, $params{pages})) {
my @bl = IkiWiki::backlinks($page);
$counts{$page} = scalar(@bl);
@@ -42,8 +42,14 @@ sub preprocess (@) { #{{{
}
if ($style eq 'table') {
- return "
\n".
+ join("\n", map {
+ "".
+ IkiWiki::htmllink($params{page}, $params{destpage}, $_, 1).
+ " | ".$counts{$_}." |
"
+ }
+ sort { $counts{$b} <=> $counts{$a} } keys %counts).
+ "\n
\n" ;
} else {
# In case of misspelling, default to a page cloud