2006-09-16 02:52:26 +02:00
|
|
|
#!/usr/bin/perl
|
|
|
|
# favicon plugin.
|
|
|
|
|
|
|
|
package IkiWiki::Plugin::favicon;
|
|
|
|
|
|
|
|
use warnings;
|
|
|
|
use strict;
|
2008-12-23 22:34:19 +01:00
|
|
|
use IkiWiki 3.00;
|
2006-09-16 02:52:26 +02:00
|
|
|
|
2008-12-17 21:22:16 +01:00
|
|
|
sub import {
|
2008-08-03 22:40:12 +02:00
|
|
|
hook(type => "getsetup", id => "favicon", call => \&getsetup);
|
2006-09-16 02:52:26 +02:00
|
|
|
hook(type => "pagetemplate", id => "favicon", call => \&pagetemplate);
|
2008-12-17 21:22:16 +01:00
|
|
|
}
|
2006-09-16 02:52:26 +02:00
|
|
|
|
2008-12-17 21:22:16 +01:00
|
|
|
sub getsetup () {
|
2008-08-03 22:40:12 +02:00
|
|
|
return
|
|
|
|
plugin => {
|
|
|
|
safe => 1,
|
|
|
|
rebuild => 1,
|
|
|
|
},
|
2008-12-17 21:22:16 +01:00
|
|
|
}
|
2008-08-03 22:40:12 +02:00
|
|
|
|
2008-12-17 21:22:16 +01:00
|
|
|
sub pagetemplate (@) {
|
2006-09-16 02:52:26 +02:00
|
|
|
my %params=@_;
|
|
|
|
|
|
|
|
my $template=$params{template};
|
|
|
|
|
|
|
|
if ($template->query(name => "favicon")) {
|
2006-09-16 17:12:01 +02:00
|
|
|
$template->param(favicon => "favicon.ico");
|
2006-09-16 02:52:26 +02:00
|
|
|
}
|
2008-12-17 21:22:16 +01:00
|
|
|
}
|
2006-09-16 02:52:26 +02:00
|
|
|
|
|
|
|
1
|