- map { link => IkiWiki::htmllink($page, $destpage, $_) },
- @{$tags{$page}}
- ]) if exists $tags{$page} && @{$tags{$page}} && $template->query(name => "tags");
-} # }}}
+ map {
+ link => taglink($page, $destpage, $_, rel => "tag")
+ }, sort keys %$tags
+ ]) if defined $tags && %$tags && $template->query(name => "tags");
+
+ if ($template->query(name => "categories")) {
+ # It's an rss/atom template. Add any categories.
+ if (defined $tags && %$tags) {
+ $template->param(categories => [map { category => $_ },
+ sort keys %$tags]);
+ }
+ }
+}
+
+package IkiWiki::PageSpec;
+
+sub match_tagged ($$;@) {
+ return match_link($_[0], IkiWiki::Plugin::tag::tagpage($_[1]), linktype => 'tag');
+}