]> git.vanrenterghem.biz Git - git.ikiwiki.info.git/blobdiff - IkiWiki/Render.pm
Merge branch 'master' of ssh://git.ikiwiki.info
[git.ikiwiki.info.git] / IkiWiki / Render.pm
index c88de1e8e5f7f8974729b6e5a52be956149bb3f3..c1a3dcbf272a468cd0df682d7fa2983877984510 100644 (file)
@@ -134,6 +134,7 @@ sub genpage ($$) {
                ctime => displaytime($pagectime{$page}, undef, 1),
                baseurl => baseurl($page),
                html5 => $config{html5},
                ctime => displaytime($pagectime{$page}, undef, 1),
                baseurl => baseurl($page),
                html5 => $config{html5},
+               responsive_layout => $config{responsive_layout},
        );
 
        run_hooks(pagetemplate => sub {
        );
 
        run_hooks(pagetemplate => sub {
@@ -154,7 +155,7 @@ sub genpage ($$) {
 
 sub scan ($) {
        my $file=shift;
 
 sub scan ($) {
        my $file=shift;
-       return if $scanned{$file};
+       return if $phase > PHASE_SCAN || $scanned{$file};
        $scanned{$file}=1;
 
        debug(sprintf(gettext("scanning %s"), $file));
        $scanned{$file}=1;
 
        debug(sprintf(gettext("scanning %s"), $file));
@@ -473,7 +474,8 @@ sub find_new_files ($) {
                        }
                        $pagecase{lc $page}=$page;
                        if (! exists $pagectime{$page}) {
                        }
                        $pagecase{lc $page}=$page;
                        if (! exists $pagectime{$page}) {
-                               $pagectime{$page}=(srcfile_stat($file))[10];
+                               my $ctime=(srcfile_stat($file, 1))[10];
+                               $pagectime{$page}=$ctime if defined $ctime;
                        }
                }
        }
                        }
                }
        }
@@ -533,10 +535,11 @@ sub find_changed ($) {
        my @internal_changed;
        foreach my $file (@$files) {
                my $page=pagename($file);
        my @internal_changed;
        foreach my $file (@$files) {
                my $page=pagename($file);
-               my ($srcfile, @stat)=srcfile_stat($file);
-               if (! exists $pagemtime{$page} ||
-                   $stat[9] > $pagemtime{$page} ||
-                   $forcerebuild{$page}) {
+               my ($srcfile, @stat)=srcfile_stat($file, 1);
+               if (defined $srcfile && 
+                   (! exists $pagemtime{$page} ||
+                    $stat[9] > $pagemtime{$page} ||
+                    $forcerebuild{$page})) {
                        $pagemtime{$page}=$stat[9];
 
                        if (isinternal($page)) {
                        $pagemtime{$page}=$stat[9];
 
                        if (isinternal($page)) {
@@ -883,6 +886,9 @@ sub refresh () {
 
        # At this point it becomes OK to start matching pagespecs.
        $phase = PHASE_RENDER;
 
        # At this point it becomes OK to start matching pagespecs.
        $phase = PHASE_RENDER;
+       # Save some memory: we no longer need to keep track of which pages
+       # we've scanned
+       %scanned = ();
 
        remove_del(@$del, @$internal_del);
 
 
        remove_del(@$del, @$internal_del);