summaryrefslogtreecommitdiff
path: root/IkiWiki/Plugin/favicon.pm
blob: 6060914c5a59a6736971f5557d97b3efc992d953 (plain)
  1. #!/usr/bin/perl
  2. # favicon plugin.
  3. package IkiWiki::Plugin::favicon;
  4. use warnings;
  5. use strict;
  6. use IkiWiki 3.00;
  7. sub import {
  8. hook(type => "getsetup", id => "favicon", call => \&getsetup);
  9. hook(type => "pagetemplate", id => "favicon", call => \&pagetemplate);
  10. }
  11. sub getsetup () {
  12. return
  13. plugin => {
  14. safe => 1,
  15. rebuild => 1,
  16. },
  17. }
  18. sub pagetemplate (@) {
  19. my %params=@_;
  20. my $template=$params{template};
  21. if ($template->query(name => "favicon")) {
  22. $template->param(favicon => "favicon.ico");
  23. }
  24. }
  25. 1