From: Simon McVittie <smcv@debian.org>
Date: Sun, 14 Sep 2014 14:57:09 +0000 (+0100)
Subject: pagestats: rename disp to show, and document it
X-Git-Tag: 3.20160121~47^2
X-Git-Url: http://git.vanrenterghem.biz/git.ikiwiki.info.git/commitdiff_plain/e3e6ca2777990caf96e524f59e22925841c79e6e?ds=inline;hp=-c

pagestats: rename disp to show, and document it
---

e3e6ca2777990caf96e524f59e22925841c79e6e
diff --git a/IkiWiki/Plugin/pagestats.pm b/IkiWiki/Plugin/pagestats.pm
index d0a4ec7aa..ac0a463e3 100644
--- a/IkiWiki/Plugin/pagestats.pm
+++ b/IkiWiki/Plugin/pagestats.pm
@@ -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;
diff --git a/doc/ikiwiki/directive/pagestats.mdwn b/doc/ikiwiki/directive/pagestats.mdwn
index 8d2be0946..ab8397366 100644
--- a/doc/ikiwiki/directive/pagestats.mdwn
+++ b/doc/ikiwiki/directive/pagestats.mdwn
@@ -40,4 +40,10 @@ that name still works, if its value is numeric.
 The optional `class` parameter can be used to control the class
 of the generated tag cloud `div` or page stats `table`.
 
+By default, the names of pages are shown. The `show` parameter
+can be used (with a non-numeric value) to show the titles or descriptions
+of pages instead (as set by the [[meta]] directive). For example:
+
+	\[[!pagestats pages="tags/*" show="title"]]
+
 [[!meta robots="noindex, follow"]]