summaryrefslogtreecommitdiff
path: root/IkiWiki/Plugin/favicon.pm
blob: 68359a4aa2011d5bdadd461a62b0641526f3fd23 (plain)
  1. #!/usr/bin/perl
  2. # favicon plugin.
  3. package IkiWiki::Plugin::favicon;
  4. use warnings;
  5. use strict;
  6. use IkiWiki 2.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