X-Git-Url: http://git.vanrenterghem.biz/git.ikiwiki.info.git/blobdiff_plain/a326ffed1f20aaebf751002476696e9878178092..cb5aaa3cee8b35d6fc6e88a7449a9477a6587c7a:/IkiWiki/Plugin/autoindex.pm

diff --git a/IkiWiki/Plugin/autoindex.pm b/IkiWiki/Plugin/autoindex.pm
index 6ff06538f..d1b3edb1f 100644
--- a/IkiWiki/Plugin/autoindex.pm
+++ b/IkiWiki/Plugin/autoindex.pm
@@ -21,7 +21,7 @@ sub getsetup () { #{{{
 
 sub genindex ($) { #{{{
 	my $page=shift;
-	my $file=$page.".".$config{default_pageext};
+	my $file=newpagefile($page, $config{default_pageext});
 	my $template=template("autoindex.tmpl");
 	$template->param(page => $page);
 	writefile($file, $config{srcdir}, $template->output);
@@ -97,7 +97,9 @@ sub refresh () { #{{{
 		if ($config{rcs}) {
 			IkiWiki::disable_commit_hook();
 		}
-		genindex($_) foreach @needed;
+		foreach my $page (@needed) {
+			genindex($page);
+		}
 		if ($config{rcs}) {
 			IkiWiki::rcs_commit_staged(
 				gettext("automatic index generation"),