aboutsummaryrefslogtreecommitdiff
path: root/IkiWiki/Render.pm
diff options
context:
space:
mode:
authorJoey Hess <joey@kitenet.net>2010-04-23 16:41:07 -0400
committerJoey Hess <joey@kitenet.net>2010-04-23 16:41:07 -0400
commit6486452e4c94f5699d98d13e25a361435ed3ddeb (patch)
tree6ced202f49928fac0140cbab57f14f99b708c060 /IkiWiki/Render.pm
parent8d72e3dc09b017329397bee88db88b4c5dab351e (diff)
downloadikiwiki-6486452e4c94f5699d98d13e25a361435ed3ddeb.tar
ikiwiki-6486452e4c94f5699d98d13e25a361435ed3ddeb.tar.gz
special case for page.tmpl dependency handling
Rather than wasting resources recording that every page depends on page.tmpl, add a special case. The special case curretly rebuilds non-page files too when page.tmpl changes, but that's minor.
Diffstat (limited to 'IkiWiki/Render.pm')
-rw-r--r--IkiWiki/Render.pm23
1 files changed, 18 insertions, 5 deletions
diff --git a/IkiWiki/Render.pm b/IkiWiki/Render.pm
index 7cf19645e..8ae0cbd4f 100644
--- a/IkiWiki/Render.pm
+++ b/IkiWiki/Render.pm
@@ -74,9 +74,16 @@ sub genpage ($$) {
$templatefile=$file;
}
});
- my $template=template_depends(
- defined $templatefile ? $templatefile : 'page.tmpl', $page,
- blind_cache => 1);
+ my $template;
+ if (defined $templatefile) {
+ $template=template_depends($templatefile, $page,
+ blind_cache => 1);
+ }
+ else {
+ # no explicit depends as special case
+ $template=template('page.tmpl',
+ blind_cache => 1);
+ }
my $actions=0;
if (length $config{cgiurl}) {
@@ -763,8 +770,14 @@ sub refresh () {
foreach my $file (@$new, @$del) {
render_linkers($file);
}
-
- if (@$changed || @$internal_changed ||
+
+ if ($rendered{"templates/page.tmpl"}) {
+ foreach my $f (@$files) {
+ next if $f eq "templates/page.tmpl";
+ render($f, sprintf(gettext("building %s, which depends on %s"), $f, "templates/page.tmpl"));
+ }
+ }
+ elsif (@$changed || @$internal_changed ||
@$del || @$internal_del || @$internal_new) {
1 while render_dependent($files, $new, $internal_new,
$del, $internal_del, $internal_changed,