2 package IkiWiki::Plugin::google;
10 hook(type => "getsetup", id => "google", call => \&getsetup);
11 hook(type => "checkconfig", id => "google", call => \&checkconfig);
12 hook(type => "pagetemplate", id => "google", call => \&pagetemplate);
25 if (! length $config{url}) {
26 error(sprintf(gettext("Must specify %s when using the %s plugin"), "url", 'google'));
31 sub pagetemplate (@) {
33 my $page=$params{page};
34 my $template=$params{template};
36 # Add search box to page header.
37 if ($template->query(name => "searchform")) {
38 if (! defined $form) {
39 my $searchform = template("googleform.tmpl", blind_cache => 1);
40 $searchform->param(url => $config{url});
41 $form=$searchform->output;
44 $template->param(searchform => $form);