aboutsummaryrefslogtreecommitdiff
path: root/IkiWiki/Plugin/search.pm
diff options
context:
space:
mode:
Diffstat (limited to 'IkiWiki/Plugin/search.pm')
-rw-r--r--IkiWiki/Plugin/search.pm17
1 files changed, 8 insertions, 9 deletions
diff --git a/IkiWiki/Plugin/search.pm b/IkiWiki/Plugin/search.pm
index 751c75ab5..c8e0dd580 100644
--- a/IkiWiki/Plugin/search.pm
+++ b/IkiWiki/Plugin/search.pm
@@ -27,6 +27,7 @@ sub checkconfig () { #{{{
}
} #}}}
+my $form;
sub pagetemplate (@) { #{{{
my %params=@_;
my $page=$params{page};
@@ -34,15 +35,13 @@ sub pagetemplate (@) { #{{{
# Add search box to page header.
if ($template->query(name => "searchform")) {
- $template->param(searchform => qq{
-<form method="get" action="$IkiWiki::config{cgiurl}" id="searchform">
-<div>
-<input type="text" name="phrase" value="" size="16" />
-<input type="hidden" name="enc" value="UTF-8" />
-<input type="hidden" name="do" value="hyperestraier" />
-</div>
-</form>
-});
+ if (! defined $form) {
+ my $searchform = IkiWiki::template("searchform.tmpl", blind_cache => 1);
+ $searchform->param(searchaction => $IkiWiki::config{cgiurl});
+ $form=$searchform->output;
+ }
+
+ $template->param(searchform => $form);
}
} #}}}