X-Git-Url: https://sipb.mit.edu/gitweb.cgi/ikiwiki.git/blobdiff_plain/7f64dd4f6688149306282f1a2a951535b9493300..5466a1daf99e8e4c67a19f871aaf558312569652:/IkiWiki/Plugin/search.pm diff --git a/IkiWiki/Plugin/search.pm b/IkiWiki/Plugin/search.pm index 213ed45ff..c94974ac4 100644 --- a/IkiWiki/Plugin/search.pm +++ b/IkiWiki/Plugin/search.pm @@ -9,6 +9,8 @@ use IkiWiki; sub import { #{{{ IkiWiki::hook(type => "checkconfig", id => "hyperestraier", call => \&checkconfig); + IkiWiki::hook(type => "pagetemplate", id => "hyperestraier", + call => \&pagetemplate); IkiWiki::hook(type => "delete", id => "hyperestraier", call => \&delete); IkiWiki::hook(type => "change", id => "hyperestraier", @@ -23,8 +25,14 @@ sub checkconfig () { #{{{ IkiWiki::error("Must specify $required when using the search plugin\n"); } } +} #}}} + +sub pagetemplate ($$) { #{{{ + my $page=shift; + my $template=shift; - $IkiWiki::config{headercontent}.=qq{ + # Add search box to page header. + $template->param(searchform => qq{
@@ -32,7 +40,7 @@ sub checkconfig () { #{{{
-}; +}); } #}}} sub delete (@) { #{{{