]> sipb.mit.edu Git - ikiwiki.git/blobdiff - IkiWiki/Plugin/autoindex.pm
autoindex and tag use transient underlay when not committing, so do not need to disab...
[ikiwiki.git] / IkiWiki / Plugin / autoindex.pm
index d0261858104cdc2783709c7fafda468b94b975b4..78571b27677d4377892f8f9a451f1c87dbde365a 100644 (file)
@@ -7,6 +7,7 @@ use IkiWiki 3.00;
 use Encode;
 
 sub import {
+       hook(type => "checkconfig", id => "autoindex", call => \&checkconfig);
        hook(type => "getsetup", id => "autoindex", call => \&getsetup);
        hook(type => "refresh", id => "autoindex", call => \&refresh);
        IkiWiki::loadplugin("transient");
@@ -28,6 +29,12 @@ sub getsetup () {
                },
 }
 
+sub checkconfig () {
+       if (! defined $config{autoindex_commit}) {
+               $config{autoindex_commit} = 1;
+       }
+}
+
 sub genindex ($) {
        my $page=shift;
        my $file=newpagefile($page, $config{default_pageext});
@@ -64,6 +71,7 @@ sub refresh () {
 
        my (%pages, %dirs);
        foreach my $dir ($config{srcdir}, @{$config{underlaydirs}}, $config{underlaydir}) {
+               next if $dir eq $IkiWiki::Plugin::transient::transientdir;
                chdir($dir) || next;
 
                find({