X-Git-Url: http://git.vanrenterghem.biz/git.ikiwiki.info.git/blobdiff_plain/5466a1daf99e8e4c67a19f871aaf558312569652..a1c7308b7d26915956d938808bbb05c194d60a45:/IkiWiki/Plugin/search.pm?ds=inline diff --git a/IkiWiki/Plugin/search.pm b/IkiWiki/Plugin/search.pm index c94974ac4..751c75ab5 100644 --- a/IkiWiki/Plugin/search.pm +++ b/IkiWiki/Plugin/search.pm @@ -27,12 +27,14 @@ sub checkconfig () { #{{{ } } #}}} -sub pagetemplate ($$) { #{{{ - my $page=shift; - my $template=shift; +sub pagetemplate (@) { #{{{ + my %params=@_; + my $page=$params{page}; + my $template=$params{template}; # Add search box to page header. - $template->param(searchform => qq{ + if ($template->query(name => "searchform")) { + $template->param(searchform => qq{
}); + } } #}}} sub delete (@) { #{{{ @@ -53,7 +56,7 @@ sub change (@) { #{{{ IkiWiki::debug("updating hyperestraier search index"); IkiWiki::estcmd("gather -cm -bc -cl -sd", map { - $IkiWiki::config{destdir}."/".$IkiWiki::renderedfiles{IkiWiki::pagename($_)} + Encode::encode_utf8($IkiWiki::config{destdir}."/".$IkiWiki::renderedfiles{IkiWiki::pagename($_)}) } @_ ); IkiWiki::estcfg(); @@ -87,9 +90,7 @@ sub estcfg () { #{{{ close TEMPLATE; open(TEMPLATE, ">$estdir/$cgi.conf") || error("write $estdir/$cgi.conf: $!"); - my $template=HTML::Template->new( - filename => "$config{templatedir}/estseek.conf" - ); + my $template=template("estseek.conf"); eval q{use Cwd 'abs_path'}; $template->param( index => $estdir,