]> git.vanrenterghem.biz Git - git.ikiwiki.info.git/blobdiff - IkiWiki/Plugin/version.pm
Allow colons in URLs after the first slash
[git.ikiwiki.info.git] / IkiWiki / Plugin / version.pm
index 0e8d7b5e71a03d3844e15c0b28540fcfb2794487..f96d2df06ce345d9939c356637e6e6d0e2d06e8b 100644 (file)
@@ -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};
+                       }
                }
        }
 } # }}}