Package: ikiwiki
Version: 3.20101023
Severity: wishlist

Hi,

Is creation of index pages by the autoindex plugin limited only to files under
srcdir by some justified reason? Currently autoindex doesn't create index pages
for empty directories of underlays. If index pages aren't supposed to be
created for empty directories under underlay dirs, why iterate over the
underlay dirs in the first place (the for loop at the line 41 of autoindex.pm).
The attached patch corrects this. Please consider applying if this is ok.

br,
Tuomas Jormola
>From 5d18914e77d852fc10c09f9903dba61a050ddeac Mon Sep 17 00:00:00 2001
From: Tuomas Jormola <t...@solitudo.net>
Date: Tue, 25 Jan 2011 11:46:57 +0200
Subject: [PATCH] Allow creation of index pages outside of srcdir

After this change autoindex creates index pages also for empty directories
included in underlays.
---
 IkiWiki/Plugin/autoindex.pm |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/IkiWiki/Plugin/autoindex.pm b/IkiWiki/Plugin/autoindex.pm
index 11595e2..f45ab9e 100644
--- a/IkiWiki/Plugin/autoindex.pm
+++ b/IkiWiki/Plugin/autoindex.pm
@@ -57,7 +57,7 @@ sub refresh () {
                                        if (! -d _) {
                                                $pages{pagename($f)}=1;
                                        }
-                                       elsif ($dir eq $config{srcdir}) {
+                                       else {
                                                $dirs{$f}=1;
                                        }
                                }
-- 
1.7.0.4

Reply via email to