* pagetemplate hooks are now also called when generating cgi pages.
[ikiwiki.git] / IkiWiki / Plugin / favicon.pm
1 #!/usr/bin/perl
2 # favicon plugin.
3
4 package IkiWiki::Plugin::favicon;
5
6 use warnings;
7 use strict;
8 use IkiWiki;
9
10 sub import { #{{{
11         hook(type => "pagetemplate", id => "favicon", call => \&pagetemplate);
12 } # }}}
13
14 sub pagetemplate (@) { #{{{
15         my %params=@_;
16
17         my $template=$params{template};
18         
19         if ($template->query(name => "favicon")) {
20                 $template->param(favicon => "favicon.png");
21         }
22 } # }}}
23
24 1