X-Git-Url: http://git.vanrenterghem.biz/git.ikiwiki.info.git/blobdiff_plain/b4b452f4ee73fb67c6ff0aa761783def7483313b..be0b4f603f918444b906e42825908ddac78b7073:/IkiWiki/Plugin/version.pm?ds=sidebyside diff --git a/IkiWiki/Plugin/version.pm b/IkiWiki/Plugin/version.pm index 0e8d7b5e7..f96d2df06 100644 --- a/IkiWiki/Plugin/version.pm +++ b/IkiWiki/Plugin/version.pm @@ -14,9 +14,17 @@ 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 (exists $pagesources{$page} && + 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}; + } } } } # }}}