]> git.vanrenterghem.biz Git - git.ikiwiki.info.git/blob - IkiWiki/Plugin/favicon.pm
del wrong hook & ikiwiki --post-commit --a-lot-of-switches
[git.ikiwiki.info.git] / IkiWiki / Plugin / favicon.pm
1 #!/usr/bin/perl
2 # favicon plugin.
4 package IkiWiki::Plugin::favicon;
6 use warnings;
7 use strict;
8 use IkiWiki 3.00;
10 sub import {
11         hook(type => "getsetup", id => "favicon", call => \&getsetup);
12         hook(type => "pagetemplate", id => "favicon", call => \&pagetemplate);
13 }
15 sub getsetup () {
16         return
17                 plugin => {
18                         safe => 1,
19                         rebuild => 1,
20                 },
21 }
23 sub pagetemplate (@) {
24         my %params=@_;
26         my $template=$params{template};
27         
28         if ($template->query(name => "favicon")) {
29                 $template->param(favicon => "favicon.ico");
30         }
31 }
33 1