summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--IkiWiki/Plugin/tag.pm8
-rwxr-xr-xMakefile.PL3
-rw-r--r--basewiki/style.css2
-rw-r--r--debian/changelog4
-rw-r--r--doc/plugins/tag.mdwn6
-rw-r--r--templates/inlinepage.tmpl16
-rw-r--r--templates/inlinepagetitle.tmpl1
-rw-r--r--templates/page.tmpl12
8 files changed, 35 insertions, 17 deletions
diff --git a/IkiWiki/Plugin/tag.pm b/IkiWiki/Plugin/tag.pm
index 957fd986d..c4e12e61d 100644
--- a/IkiWiki/Plugin/tag.pm
+++ b/IkiWiki/Plugin/tag.pm
@@ -40,10 +40,10 @@ sub pagetemplate (@) { #{{{
my $destpage=$params{destpage};
my $template=$params{template};
- $template->param(tags => join(', ',
- map { IkiWiki::htmllink($page, $destpage, $_) }
- @{$tags{$page}}))
- if exists $tags{$page} && $template->query(name => "tags");
+ $template->param(tags => [
+ map { link => IkiWiki::htmllink($page, $destpage, $_) },
+ @{$tags{$page}}
+ ]) if exists $tags{$page} && @{$tags{$page}} && $template->query(name => "tags");
} # }}}
1
diff --git a/Makefile.PL b/Makefile.PL
index 59c5d86ba..05547ff05 100755
--- a/Makefile.PL
+++ b/Makefile.PL
@@ -16,7 +16,8 @@ extra_build:
--wikiname="ikiwiki" --verbose --no-rcs \
--exclude=/discussion --no-discussion \
--plugin=brokenlinks --plugin=pagecount \
- --plugin=orphans --plugin=haiku --plugin=meta
+ --plugin=orphans --plugin=haiku --plugin=meta \
+ --plugin=tag
./mdwn2man ikiwiki 1 doc/usage.mdwn > ikiwiki.man
./mdwn2man ikiwiki-mass-rebuild 8 doc/ikiwiki-mass-rebuild.mdwn > ikiwiki-mass-rebuild.man
diff --git a/basewiki/style.css b/basewiki/style.css
index 74186ab3b..f96e11ab0 100644
--- a/basewiki/style.css
+++ b/basewiki/style.css
@@ -74,7 +74,7 @@ td.changelog {
margin: 1em 0;
}
-#pageinfo {
+.pageinfo {
font-style: italic;
}
diff --git a/debian/changelog b/debian/changelog
index 282fdf249..0e7a07669 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -8,10 +8,10 @@ ikiwiki (1.11) UNRELEASED; urgency=low
value.
- Fixes preprocessor directive parameter parsing so that
foo=bar baz now means "foo=bar" and a "baz" with no value.
- * Run pagetemplate hooks when inlining pages so that inlines pages also
+ * Run pagetemplate hooks when inlining pages so that inlined pages also
list their tags.
* Make all plugins with pagetemplate hooks check that variables exist
- on the template before setting them.
+ on the template before setting them, for robustness.
* Switch pagetemplate hooks to using named parameters.
* Pass a "destpage" parameter to preprocessor and pagetemplate hooks.
This will be the page that a source page will be part of, which is
diff --git a/doc/plugins/tag.mdwn b/doc/plugins/tag.mdwn
index 95a346622..4d45c6bfd 100644
--- a/doc/plugins/tag.mdwn
+++ b/doc/plugins/tag.mdwn
@@ -6,4 +6,8 @@ The tags work the same as if you had put a (hidden) [[WikiLink]] on the page
for each tag, so you can use a [[GlobList]] to link to all pages that are
tagged with a given tag, for example.
-This plugin is included in ikiwiki, but is not enabled by default.
+This plugin is included in ikiwiki, but is not enabled by default. If it is
+enabled, you'll see a note below that this page is tagged with the "tags"
+tag.
+
+[[tag tags]]
diff --git a/templates/inlinepage.tmpl b/templates/inlinepage.tmpl
index b470c5585..0f0c47767 100644
--- a/templates/inlinepage.tmpl
+++ b/templates/inlinepage.tmpl
@@ -3,10 +3,16 @@
<TMPL_VAR CONTENT>
-<p>
-<i>
+<span class="pageinfo">
Posted <TMPL_VAR CTIME>
-<TMPL_IF NAME="TAGS">Tags: <TMPL_VAR TAGS></TMPL_IF>
-</i>
-</p>
+</span>
+
+<span class="tags">
+<TMPL_IF NAME="TAGS">
+Tags:
+<TMPL_LOOP NAME="TAGS">
+<TMPL_VAR NAME=LINK>
+</TMPL_LOOP>
+</TMPL_IF>
+</span>
</div>
diff --git a/templates/inlinepagetitle.tmpl b/templates/inlinepagetitle.tmpl
index 8527b197d..10469f81c 100644
--- a/templates/inlinepagetitle.tmpl
+++ b/templates/inlinepagetitle.tmpl
@@ -2,6 +2,5 @@
<TMPL_VAR PAGELINK><br />
<i>
Posted <TMPL_VAR CTIME>
-<!-- <TMPL_IF NAME="TAGS"><TMPL_VAR TAGS></TMPL_IF> -->
</i>
</p>
diff --git a/templates/page.tmpl b/templates/page.tmpl
index 8439ef8e4..5bdde1fbc 100644
--- a/templates/page.tmpl
+++ b/templates/page.tmpl
@@ -49,6 +49,15 @@
<TMPL_VAR CONTENT>
</div>
+<div class="tags">
+<TMPL_IF NAME="TAGS">
+Tags:
+<TMPL_LOOP NAME="TAGS">
+<TMPL_VAR NAME=LINK>
+</TMPL_LOOP>
+</TMPL_IF>
+</div>
+
<div id="backlinks">
<TMPL_IF NAME="BACKLINKS">
Links:
@@ -59,10 +68,9 @@ Links:
</div>
<div id="footer">
-<span id="pageinfo">
+<span class="pageinfo">
<!-- from <TMPL_VAR NAME=WIKINAME> -->
Last edited <TMPL_VAR NAME=MTIME>
-<TMPL_IF NAME="TAGS">Tags: <TMPL_VAR TAGS></TMPL_IF>
</span>
</div>