summaryrefslogtreecommitdiff
path: root/IkiWiki/Plugin/version.pm
diff options
context:
space:
mode:
Diffstat (limited to 'IkiWiki/Plugin/version.pm')
-rw-r--r--IkiWiki/Plugin/version.pm13
1 files changed, 10 insertions, 3 deletions
diff --git a/IkiWiki/Plugin/version.pm b/IkiWiki/Plugin/version.pm
index 0e8d7b5e7..d39fd9419 100644
--- a/IkiWiki/Plugin/version.pm
+++ b/IkiWiki/Plugin/version.pm
@@ -14,9 +14,16 @@ sub import { #{{{
sub needsbuild (@) { #{{{
my $needsbuild=shift;
foreach my $page (keys %pagestate) {
- if (exists $pagestate{$page}{version}{shown} &&
- $pagestate{$page}{version}{shown} ne $IkiWiki::version) {
- push @$needsbuild, $pagesources{$page};
+ if (exists $pagestate{$page}{version}{shown}) {
+ if ($pagestate{$page}{version}{shown} ne $IkiWiki::version) {
+ push @$needsbuild, $pagesources{$page};
+ }
+ if (grep { $_ eq $pagesources{$page} } @$needsbuild) {
+ # remove state, will be re-added if
+ # the version is still shown during the
+ # rebuild
+ delete $pagestate{$page}{version}{shown};
+ }
}
}
} # }}}