- $template->param(tags => join(', ',
- map { IkiWiki::htmllink($page, $destpage, $_) }
- @{$tags{$page}}))
- if exists $tags{$page} && $template->query(name => "tags");
+ $template->param(tags => [
+ map {
+ link => htmllink($page, $destpage, tagpage($_))
+ }, @{$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}}]);
+ }
+ }