3 package IkiWiki::Plugin::tag;
12 IkiWiki::hook(type => "preprocess", id => "tag",
13 call => \&preprocess);
14 IkiWiki::hook(type => "pagetemplate", id => "tag",
15 call => \&pagetemplate);
18 sub preprocess (@) { #{{{
23 my $page = $params{page};
27 foreach my $tag (keys %params) {
28 push @{$tags{$page}}, $tag;
30 push @{$IkiWiki::links{$page}}, $tag;
36 sub pagetemplate (@) { #{{{
38 my $page=$params{page};
39 my $destpage=$params{destpage};
40 my $template=$params{template};
42 $template->param(tags => join(', ',
43 map { IkiWiki::htmllink($page, $destpage, $_) }
45 if exists $tags{$page} && $template->query(name => "tags");