use warnings;
use strict;
-use IkiWiki;
+use IkiWiki 2.00;
my %tags;
my $page = $params{page};
delete $params{page};
delete $params{destpage};
+ delete $params{preview};
- $tags{$page} = [];
foreach my $tag (keys %params) {
- push @{$tags{$page}}, $tag;
+ $tag=IkiWiki::linkpage($tag);
+ $tags{$page}{$tag}=1;
# hidden WikiLink
push @{$links{$page}}, tagpage($tag);
}
$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 => "pubdate")) {
- # It's an rss template. Add any categories.
- if (exists $tags{$page} && @{$tags{$page}}) {
- $template->param(categories => [map { category => $_ }, @{$tags{$page}}]);
+ 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 => $_ },
+ sort keys %{$tags{$page}}]);
}
}
} # }}}