]> git.vanrenterghem.biz Git - git.ikiwiki.info.git/blobdiff - IkiWiki/Plugin/autoindex.pm
call gentag for taglinks too
[git.ikiwiki.info.git] / IkiWiki / Plugin / autoindex.pm
index e50464dca1191f20add84df54e96584d7ed67e6f..c71d73349c091021ab1d8083292fbd8888ce7d82 100644 (file)
@@ -16,7 +16,6 @@ sub getsetup () {
                plugin => {
                        safe => 1,
                        rebuild => 0,
                plugin => {
                        safe => 1,
                        rebuild => 0,
-                       section => "special-purpose",
                },
 }
 
                },
 }
 
@@ -62,8 +61,16 @@ sub refresh () {
        }
        
        my %deleted;
        }
        
        my %deleted;
-        if (ref $pagestate{index}{autoindex}{deleted}) {
-              %deleted=%{$pagestate{index}{autoindex}{deleted}};
+       if (ref $wikistate{autoindex}{deleted}) {
+               %deleted=%{$wikistate{autoindex}{deleted}};
+       }
+        elsif (ref $pagestate{index}{autoindex}{deleted}) {
+               # compatability code
+               %deleted=%{$pagestate{index}{autoindex}{deleted}};
+               delete $pagestate{index}{autoindex};
+       }
+
+       if (keys %deleted) {
                foreach my $dir (keys %deleted) {
                        # remove deleted page state if the deleted page is re-added,
                        # or if all its subpages are deleted
                foreach my $dir (keys %deleted) {
                        # remove deleted page state if the deleted page is re-added,
                        # or if all its subpages are deleted
@@ -72,7 +79,7 @@ sub refresh () {
                                delete $deleted{$dir};
                        }
                }
                                delete $deleted{$dir};
                        }
                }
-               $pagestate{index}{autoindex}{deleted}=\%deleted;
+               $wikistate{autoindex}{deleted}=\%deleted;
        }
 
        my @needed;
        }
 
        my @needed;
@@ -83,10 +90,10 @@ sub refresh () {
                                # This page must have just been deleted, so
                                # don't re-add it. And remember it was
                                # deleted.
                                # This page must have just been deleted, so
                                # don't re-add it. And remember it was
                                # deleted.
-                               if (! ref $pagestate{index}{autoindex}{deleted}) {
-                                       $pagestate{index}{autoindex}{deleted}={};
+                               if (! ref $wikistate{autoindex}{deleted}) {
+                                       $wikistate{autoindex}{deleted}={};
                                }
                                }
-                               ${$pagestate{index}{autoindex}{deleted}}{$dir}=1;
+                               ${$wikistate{autoindex}{deleted}}{$dir}=1;
                        }
                        else {
                                push @needed, $dir;
                        }
                        else {
                                push @needed, $dir;