diff options
author | Joey Hess <joey@kitenet.net> | 2010-04-23 16:41:07 -0400 |
---|---|---|
committer | Joey Hess <joey@kitenet.net> | 2010-04-23 16:41:07 -0400 |
commit | 6486452e4c94f5699d98d13e25a361435ed3ddeb (patch) | |
tree | 6ced202f49928fac0140cbab57f14f99b708c060 | |
parent | 8d72e3dc09b017329397bee88db88b4c5dab351e (diff) |
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.
-rw-r--r-- | IkiWiki/Render.pm | 23 |
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, |