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);
24 if (! length $config{url}) {
25 error(sprintf(gettext("Must specify %s when using the %s plugin"), "url", 'google'));
30 sub pagetemplate (@) {
32 my $page=$params{page};
33 my $template=$params{template};
35 # Add search box to page header.
36 if ($template->query(name => "searchform")) {
37 if (! defined $form) {
38 my $searchform = template("googleform.tmpl", blind_cache => 1);
39 $searchform->param(url => $config{url});
40 $form=$searchform->output;
43 $template->param(searchform => $form);