diff options
author | Joey Hess <joey@kitenet.net> | 2007-12-08 19:12:50 -0500 |
---|---|---|
committer | Joey Hess <joey@kitenet.net> | 2007-12-08 19:12:50 -0500 |
commit | a829e5b8650743aac227331db657ba1e87737426 (patch) | |
tree | 5fc26b0daa51946464a123ff8c4d7cf13d87dedc /IkiWiki/Plugin | |
parent | b4b452f4ee73fb67c6ff0aa761783def7483313b (diff) | |
download | ikiwiki-a829e5b8650743aac227331db657ba1e87737426.tar ikiwiki-a829e5b8650743aac227331db657ba1e87737426.tar.gz |
ensure state is dropped when a page stops embeddeding the version
Diffstat (limited to 'IkiWiki/Plugin')
-rw-r--r-- | IkiWiki/Plugin/version.pm | 13 |
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}; + } } } } # }}} |