From 299bb8bef3811b16d29a0e8ebb2c292c8dd11020 Mon Sep 17 00:00:00 2001
From: joey <joey@0fa5a96a-9a0e-0410-b3b2-a0fd24251071>
Date: Sat, 29 Jul 2006 20:14:07 +0000
Subject: [PATCH] more links

---
 IkiWiki/Plugin/pagestats.pm | 10 ++++++++--
 doc/plugins/pagestats.mdwn  |  2 ++
 2 files changed, 10 insertions(+), 2 deletions(-)

diff --git a/IkiWiki/Plugin/pagestats.pm b/IkiWiki/Plugin/pagestats.pm
index 86ebbe1d5..1d4d5ecdf 100644
--- a/IkiWiki/Plugin/pagestats.pm
+++ b/IkiWiki/Plugin/pagestats.pm
@@ -42,8 +42,14 @@ sub preprocess (@) { #{{{
 	}
 
 	if ($style eq 'table') {
-		return "<table class='pageStats'>\n".join("\n", map { "<tr><td>$_</td><td>".$counts{$_}."</td></tr>" }
-		      sort { $counts{$b} <=> $counts{$a} } keys %counts)."\n</table>\n" ;
+		return "<table class='pageStats'>\n".
+			join("\n", map {
+				"<tr><td>".
+				IkiWiki::htmllink($params{page}, $params{destpage}, $_, 1).
+				"</td><td>".$counts{$_}."</td></tr>"
+			}
+			sort { $counts{$b} <=> $counts{$a} } keys %counts).
+			"\n</table>\n" ;
 	} else {
 		# In case of misspelling, default to a page cloud
 
diff --git a/doc/plugins/pagestats.mdwn b/doc/plugins/pagestats.mdwn
index f750e3cb1..e37f804a3 100644
--- a/doc/plugins/pagestats.mdwn
+++ b/doc/plugins/pagestats.mdwn
@@ -13,3 +13,5 @@ And here's how to create a table of all the pages on the wiki:
 This plugin is included in ikiwiki, but is not enabled by default. If it is
 enabled, here's a link cloud for this entire wiki:
 [[pagestats ]]
+And here's a table:
+[[pagestats style="table"]]
-- 
2.39.5