- 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{$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 => $_ },
+ sort keys %{$tags{$page}}]);
+ }
+ }
+}
+
+package IkiWiki::PageSpec;
+
+sub match_tagged ($$;@) {
+ my $page = shift;
+ my $glob = shift;
+ return match_link($page, IkiWiki::Plugin::tag::tagpage($glob));
+}