From 96125d8da512d992012560a1115eb3a8115bafbe Mon Sep 17 00:00:00 2001 From: joey Date: Wed, 14 Feb 2007 04:05:08 +0000 Subject: * Allow multiple tag settings to appear in a single page. --- IkiWiki/Plugin/tag.pm | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'IkiWiki/Plugin') 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}}]); } } } # }}} -- cgit v1.2.3