]> git.vanrenterghem.biz Git - git.ikiwiki.info.git/blobdiff - IkiWiki/Plugin/pagestats.pm
meta: Error if we can't parse dates because Date::Parse is missing
[git.ikiwiki.info.git] / IkiWiki / Plugin / pagestats.pm
index d0a4ec7aa0f2d323799f6b6e745da3e98fb88518..304ddd1c826e95f86d9dbfe139626852149e482c 100644 (file)
@@ -34,10 +34,10 @@ sub getsetup () {
 sub linktext ($%) {
        # Return the text of the link to a tag, depending on option linktext.
        my ($page, %params) = @_;
-       if (exists $params{disp} &&
+       if (exists $params{show} &&
                exists $pagestate{$page} &&
-               exists $pagestate{$page}{meta}{$params{disp}}) {
-               return $pagestate{$page}{meta}{$params{disp}};
+               exists $pagestate{$page}{meta}{$params{show}}) {
+               return $pagestate{$page}{meta}{$params{show}};
        }
        else {
                return undef;
@@ -86,7 +86,7 @@ sub preprocess (@) {
        if (exists $params{limit}) {
                my $i=0;
                my %show;
-               foreach my $key (sort { $counts{$b} <=> $counts{$a} } keys %counts) {
+               foreach my $key (sort { $counts{$b} <=> $counts{$a} || $a cmp $b } keys %counts) {
                        last if ++$i > $params{limit};
                        $show{$key}=$counts{$key};
                }
@@ -100,7 +100,7 @@ sub preprocess (@) {
                                htmllink($params{page}, $params{destpage}, $_, noimageinline => 1, linktext => linktext($_, %params)).
                                "</td><td>".$counts{$_}."</td></tr>"
                        }
-                       sort { $counts{$b} <=> $counts{$a} } keys %counts).
+                       sort { $counts{$b} <=> $counts{$a} || $a cmp $b } keys %counts).
                        "\n</table>\n" ;
        }
        else {