]> sipb.mit.edu Git - ikiwiki.git/blobdiff - IkiWiki/Render.pm
Merge branch 'master' into templatemove
[ikiwiki.git] / IkiWiki / Render.pm
index 49d080c161a9c6cc93250b3c6a8dc204a5ee209a..8ae0cbd4f64fe4f8b450114dc1cdb1ba0caad400 100644 (file)
@@ -74,7 +74,16 @@ sub genpage ($$) {
                        $templatefile=$file;
                }
        });
-       my $template=template(defined $templatefile ? $templatefile : 'page.tmpl', 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}) {
@@ -761,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,