summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--IkiWiki.pm3
-rw-r--r--IkiWiki/Render.pm9
2 files changed, 11 insertions, 1 deletions
diff --git a/IkiWiki.pm b/IkiWiki.pm
index 115c512d3..ad9fb7c79 100644
--- a/IkiWiki.pm
+++ b/IkiWiki.pm
@@ -14,7 +14,8 @@ use open qw{:utf8 :std};
use vars qw{%config %links %oldlinks %pagemtime %pagectime %pagecase
%pagestate %wikistate %renderedfiles %oldrenderedfiles
%pagesources %destsources %depends %depends_simple %hooks
- %forcerebuild %loaded_plugins @autofiles};
+ %forcerebuild %loaded_plugins @autofiles %dellinks
+ %delrenderedfiles};
use Exporter q{import};
our @EXPORT = qw(hook debug error template htmlpage deptype
diff --git a/IkiWiki/Render.pm b/IkiWiki/Render.pm
index dd4d9ca0c..d2fa80fbb 100644
--- a/IkiWiki/Render.pm
+++ b/IkiWiki/Render.pm
@@ -392,7 +392,9 @@ sub find_del_files ($) {
else {
push @del, $pagesources{$page};
}
+ $dellinks{$page}= $links{$page};
$links{$page}=[];
+ $delrenderedfiles{$page}= $renderedfiles{$page};
$renderedfiles{$page}=[];
$pagemtime{$page}=0;
}
@@ -642,8 +644,14 @@ sub refresh () {
scan($file);
}
+ my %del_hash = map {$_, 1} @$del;
while (my $autofile = shift (@autofiles)) {
my $page=pagename($autofile);
+ if (exists $del_hash{$page}) {
+ $links{$page}= $dellinks{$page};
+ $renderedfiles{$page}= $delrenderedfiles{$page};
+ delete $del_hash{$page};
+ }
if ($pages->{$page}) {
debug(sprintf(gettext("%s has multiple possible source pages"), $page));
}
@@ -655,6 +663,7 @@ sub refresh () {
scan($autofile);
}
+ $del = [keys %del_hash];
calculate_links();