From 8cde2365e43f1c96432dcedb378be55d2308dd08 Mon Sep 17 00:00:00 2001
From: Joey Hess <joey@kitenet.net>
Date: Wed, 21 Apr 2010 19:09:59 -0400
Subject: add separate template variable for tag page and sanitize displayed
 tag name

---
 IkiWiki/Plugin/tag.pm  | 3 ++-
 templates/autotag.tmpl | 2 +-
 2 files changed, 3 insertions(+), 2 deletions(-)

diff --git a/IkiWiki/Plugin/tag.pm b/IkiWiki/Plugin/tag.pm
index c98dd80b2..6a6517671 100644
--- a/IkiWiki/Plugin/tag.pm
+++ b/IkiWiki/Plugin/tag.pm
@@ -83,7 +83,8 @@ sub gentag ($) {
 			debug($message);
 
 			my $template=template("autotag.tmpl");
-			$template->param(tag => $tag);
+			$template->param(tag => IkiWiki::basename($tag));
+			$template->param(tagpage => $tagpage);
 			writefile($tagfile, $config{srcdir}, $template->output);
 			if ($config{rcs}) {
 				IkiWiki::disable_commit_hook();
diff --git a/templates/autotag.tmpl b/templates/autotag.tmpl
index a8824171b..7b0d4c90f 100644
--- a/templates/autotag.tmpl
+++ b/templates/autotag.tmpl
@@ -1,3 +1,3 @@
-## Pages tagged <TMPL_VAR TAG> ##
+## Pages tagged <TMPL_VAR TAGNAME> ##
 
 [[!inline pages="tagged(<TMPL_VAR TAG>)" actions="no" archive="yes"]]
-- 
cgit v1.2.3