summaryrefslogtreecommitdiff
path: root/IkiWiki
diff options
context:
space:
mode:
Diffstat (limited to 'IkiWiki')
-rw-r--r--IkiWiki/Plugin/tag.pm12
1 files changed, 6 insertions, 6 deletions
diff --git a/IkiWiki/Plugin/tag.pm b/IkiWiki/Plugin/tag.pm
index 29d1d030a..b06eadd13 100644
--- a/IkiWiki/Plugin/tag.pm
+++ b/IkiWiki/Plugin/tag.pm
@@ -41,9 +41,8 @@ sub preprocess (@) { #{{{
delete $params{page};
delete $params{destpage};
- $tags{$page} = [];
foreach my $tag (keys %params) {
- push @{$tags{$page}}, $tag;
+ $tags{$page}{$tag}=1;
# hidden WikiLink
push @{$links{$page}}, tagpage($tag);
}
@@ -60,13 +59,14 @@ sub pagetemplate (@) { #{{{
$template->param(tags => [
map {
link => htmllink($page, $destpage, tagpage($_))
- }, @{$tags{$page}}
- ]) if exists $tags{$page} && @{$tags{$page}} && $template->query(name => "tags");
+ }, sort keys %{$tags{$page}}
+ ]) if exists $tags{$page} && %{$tags{$page}} && $template->query(name => "tags");
if ($template->query(name => "categories")) {
# It's an rss/atom template. Add any categories.
- if (exists $tags{$page} && @{$tags{$page}}) {
- $template->param(categories => [map { category => $_ }, @{$tags{$page}}]);
+ if (exists $tags{$page} && %{$tags{$page}}) {
+ $template->param(categories => [map { category => $_ },
+ sort keys %{$tags{$page}}]);
}
}
} # }}}