diff options
author | Simon McVittie <smcv@debian.org> | 2014-03-05 10:11:04 +0000 |
---|---|---|
committer | Simon McVittie <smcv@debian.org> | 2014-03-05 10:42:19 +0000 |
commit | a9fc30b19cfb68c1bd326e0088a677fc87c7dca5 (patch) | |
tree | 920c0949467e359a62e8c02ace24b730c0470d12 /IkiWiki/Render.pm | |
parent | 236c46a3f7e5e62296484dc47b4882f7f4327a06 (diff) | |
download | ikiwiki-a9fc30b19cfb68c1bd326e0088a677fc87c7dca5.tar ikiwiki-a9fc30b19cfb68c1bd326e0088a677fc87c7dca5.tar.gz |
Track whether we're in the scan or render phase
In the scan phase, it's too early to match pagespecs or sort pages;
in the render phase, both of those are OK.
It would be possible to add phases later, renumbering them if necessary
to maintain numerical order.
Diffstat (limited to 'IkiWiki/Render.pm')
-rw-r--r-- | IkiWiki/Render.pm | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/IkiWiki/Render.pm b/IkiWiki/Render.pm index 9e93534c6..c88de1e8e 100644 --- a/IkiWiki/Render.pm +++ b/IkiWiki/Render.pm @@ -827,6 +827,8 @@ sub gen_autofile ($$$) { } sub refresh () { + $phase = PHASE_SCAN; + srcdir_check(); run_hooks(refresh => sub { shift->() }); my ($files, $pages, $new, $internal_new, $del, $internal_del, $changed, $internal_changed); @@ -878,7 +880,10 @@ sub refresh () { } calculate_links(); - + + # At this point it becomes OK to start matching pagespecs. + $phase = PHASE_RENDER; + remove_del(@$del, @$internal_del); foreach my $file (@$changed) { @@ -942,6 +947,10 @@ sub commandline_render () { loadindex(); unlockwiki(); + # This function behaves as though it's in the render phase; + # all other files are assumed to have been scanned last time. + $phase = PHASE_RENDER; + my $srcfile=possibly_foolish_untaint($config{render}); my $file=$srcfile; $file=~s/\Q$config{srcdir}\E\/?//; |