]> git.vanrenterghem.biz Git - git.ikiwiki.info.git/blobdiff - IkiWiki/Render.pm
* Various minor bug fixes for silly mistakes in the code, thanks to the
[git.ikiwiki.info.git] / IkiWiki / Render.pm
index ef4d1123505ae8f456691899d0cab50460b03c9b..a95da40d253f8650671fd843cf5ee858bbfd42cc 100644 (file)
@@ -69,7 +69,15 @@ sub genpage ($$$) { #{{{
        my $content=shift;
        my $mtime=shift;
 
-       my $template=template("page.tmpl", blind_cache => 1);
+       my $templatefile;
+       run_hooks(templatefile => sub {
+               return if defined $templatefile;
+               my $file=shift->(page => $page);
+               if (defined $file && defined template_file($file)) {
+                       $templatefile=$file;
+               }
+       });
+       my $template=template(defined $templatefile ? $templatefile : 'page.tmpl', blind_cache => 1);
        my $actions=0;
 
        if (length $config{cgiurl}) {
@@ -320,6 +328,11 @@ sub refresh () { #{{{
                        prune($config{destdir}."/".$_)
                                foreach @{$oldrenderedfiles{$page}};
                        delete $pagesources{$page};
+                       foreach (keys %destsources) {
+                               if ($destsources{$_} eq $page) {
+                                       delete $destsources{$_};
+                               }
+                       }
                }
        }