X-Git-Url: http://git.vanrenterghem.biz/git.ikiwiki.info.git/blobdiff_plain/4c6fa6413fc26ddbb1f8dc2c73f97a105c5002f8..b298fdd78c2eb01cd89979c886e1284e957705fe:/IkiWiki/Plugin/search.pm diff --git a/IkiWiki/Plugin/search.pm b/IkiWiki/Plugin/search.pm index a9089620b..1cf762fce 100644 --- a/IkiWiki/Plugin/search.pm +++ b/IkiWiki/Plugin/search.pm @@ -13,6 +13,7 @@ sub import { hook(type => "indexhtml", id => "search", call => \&indexhtml); hook(type => "delete", id => "search", call => \&delete); hook(type => "cgi", id => "search", call => \&cgi); + hook(type => "disable", id => "search", call => \&disable); } sub getsetup () { @@ -229,7 +230,8 @@ sub setupfiles () { # Avoid omega interpreting anything in the misctemplate # as an omegascript command. my $misctemplate=IkiWiki::misctemplate(gettext("search"), "\0", - searching => 1); + searchform => "", # avoid showing the small search form + ); eval q{use HTML::Entities}; error $@ if $@; $misctemplate=encode_entities($misctemplate, '\$'); @@ -244,4 +246,10 @@ sub setupfiles () { } } +sub disable () { + if (-d $config{wikistatedir}."/xapian") { + system("rm", "-rf", $config{wikistatedir}."/xapian"); + } +} + 1