X-Git-Url: http://git.vanrenterghem.biz/git.ikiwiki.info.git/blobdiff_plain/059259ecd1f974b98718bf05f8be63fa0e7c4e32..508bda205911058377f36fd4924b1e3f33914c71:/IkiWiki/Plugin/autoindex.pm diff --git a/IkiWiki/Plugin/autoindex.pm b/IkiWiki/Plugin/autoindex.pm index d02618581..d5ee4b58f 100644 --- a/IkiWiki/Plugin/autoindex.pm +++ b/IkiWiki/Plugin/autoindex.pm @@ -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}); @@ -82,7 +89,7 @@ sub refresh () { if (! -d _) { $pages{pagename($f)}=1; } - elsif ($dir eq $config{srcdir}) { + elsif ($dir eq $config{srcdir} || ! $config{autoindex_commit}) { $dirs{$f}=1; } }