diff --git a/IkiWiki/Plugin/pagestats.pm b/IkiWiki/Plugin/pagestats.pm index 460a5969a..b0ecf7eca 100644 --- a/IkiWiki/Plugin/pagestats.pm +++ b/IkiWiki/Plugin/pagestats.pm @@ -31,6 +31,19 @@ sub getsetup () { }, } +sub linktext ($%) { + # Return the text of the link to a tag, depending on option linktext. + my ($page, %params) = @_; + if (exists $params{disp} && + exists $pagestate{$page} && + exists $pagestate{$page}{meta}{$params{disp}}) { + return $pagestate{$page}{meta}{$params{disp}}; + } + else { + return undef; + } +} + sub preprocess (@) { my %params=@_; $params{pages}="*" unless defined $params{pages}; @@ -84,7 +97,7 @@ sub preprocess (@) { return "
". - htmllink($params{page}, $params{destpage}, $_, noimageinline => 1). + htmllink($params{page}, $params{destpage}, $_, noimageinline => 1, linktext => linktext($_, %params)). " | ".$counts{$_}." |