aboutsummaryrefslogtreecommitdiff
path: root/IkiWiki/Plugin
diff options
context:
space:
mode:
authorJoey Hess <joey@kitenet.net>2010-04-24 20:22:20 -0400
committerJoey Hess <joey@kitenet.net>2010-04-24 20:22:20 -0400
commitca9c6cc254d934837406ef9bb0dc5d021983661b (patch)
tree4e9e9edcbcee0227e550c6674167b010fe82acd1 /IkiWiki/Plugin
parent0d8fc55d3356ea7da2ce175d25230d207bd32088 (diff)
downloadikiwiki-ca9c6cc254d934837406ef9bb0dc5d021983661b.tar
ikiwiki-ca9c6cc254d934837406ef9bb0dc5d021983661b.tar.gz
add support for mass dependencies
Registered by passing "" as page name to add_depends.
Diffstat (limited to 'IkiWiki/Plugin')
-rw-r--r--IkiWiki/Plugin/google.pm6
-rw-r--r--IkiWiki/Plugin/search.pm6
2 files changed, 10 insertions, 2 deletions
diff --git a/IkiWiki/Plugin/google.pm b/IkiWiki/Plugin/google.pm
index 68cb16513..529a2c801 100644
--- a/IkiWiki/Plugin/google.pm
+++ b/IkiWiki/Plugin/google.pm
@@ -25,6 +25,10 @@ sub checkconfig () {
if (! length $config{url}) {
error(sprintf(gettext("Must specify %s when using the %s plugin"), "url", 'google'));
}
+
+ # This is a mass dependency, so if the search form template
+ # changes, every page is rebuilt.
+ add_depends("", "googleform.tmpl");
}
my $form;
@@ -36,7 +40,7 @@ sub pagetemplate (@) {
# Add search box to page header.
if ($template->query(name => "searchform")) {
if (! defined $form) {
- my $searchform = template_depends("googleform.tmpl", $page, blind_cache => 1);
+ my $searchform = template("googleform.tmpl", blind_cache => 1);
$searchform->param(url => $config{url});
$form=$searchform->output;
}
diff --git a/IkiWiki/Plugin/search.pm b/IkiWiki/Plugin/search.pm
index 55edf8752..c9a69f443 100644
--- a/IkiWiki/Plugin/search.pm
+++ b/IkiWiki/Plugin/search.pm
@@ -41,6 +41,10 @@ sub checkconfig () {
if (! defined $config{omega_cgi}) {
$config{omega_cgi}="/usr/lib/cgi-bin/omega/omega";
}
+
+ # This is a mass dependency, so if the search form template
+ # changes, every page is rebuilt.
+ add_depends("", "searchform.tmpl");
}
my $form;
@@ -52,7 +56,7 @@ sub pagetemplate (@) {
# Add search box to page header.
if ($template->query(name => "searchform")) {
if (! defined $form) {
- my $searchform = template_depends("searchform.tmpl", $page, blind_cache => 1);
+ my $searchform = template("searchform.tmpl", blind_cache => 1);
$searchform->param(searchaction => $config{cgiurl});
$form=$searchform->output;
}