summaryrefslogtreecommitdiff
path: root/IkiWiki/Plugin
diff options
context:
space:
mode:
authorjoey <joey@0fa5a96a-9a0e-0410-b3b2-a0fd24251071>2006-09-16 00:52:26 +0000
committerjoey <joey@0fa5a96a-9a0e-0410-b3b2-a0fd24251071>2006-09-16 00:52:26 +0000
commit0f25ec8eb640a850a8f1efe7081c03d05d04eda4 (patch)
tree5c290f48fb651b7c8c24849208328ef634ec22e9 /IkiWiki/Plugin
parent6206e9a62e06ca9bf55f6bc659e7229ba0b911d1 (diff)
* pagetemplate hooks are now also called when generating cgi pages.
* Add a favicon plugin, which simply adds a link tag for an icon to each page (and cgis).
Diffstat (limited to 'IkiWiki/Plugin')
-rw-r--r--IkiWiki/Plugin/favicon.pm24
1 files changed, 24 insertions, 0 deletions
diff --git a/IkiWiki/Plugin/favicon.pm b/IkiWiki/Plugin/favicon.pm
new file mode 100644
index 000000000..518d2c2ff
--- /dev/null
+++ b/IkiWiki/Plugin/favicon.pm
@@ -0,0 +1,24 @@
+#!/usr/bin/perl
+# favicon plugin.
+
+package IkiWiki::Plugin::favicon;
+
+use warnings;
+use strict;
+use IkiWiki;
+
+sub import { #{{{
+ hook(type => "pagetemplate", id => "favicon", call => \&pagetemplate);
+} # }}}
+
+sub pagetemplate (@) { #{{{
+ my %params=@_;
+
+ my $template=$params{template};
+
+ if ($template->query(name => "favicon")) {
+ $template->param(favicon => "favicon.png");
+ }
+} # }}}
+
+1