--- MT.pm.orig Wed May 28 04:02:32 2003 +++ MT.pm Wed Sep 24 23:30:55 2003 @@ -374,7 +374,17 @@ require MT::Template; for my $map (@map) { my $file = File::Spec->catfile($arch_root, $map->{__saved_output_file}); - my $tmpl = $mt->{__cached_templates}{$map->template_id}; + ## DLD + ## If the file is a directory, append on "index.html" or whatever + ## the correct extension is. Since the directory may not yet + ## exist, see if the basename is empty. If so, then it must be a + ## directory. + if (basename($file) eq "") { + my $ext = $blog->file_extension || 'html'; + $file = File::Spec->catfile($file, "index." . $ext); + } + + my $tmpl = $mt->{__cached_templates}{$map->template_id}; unless ($tmpl) { $tmpl = MT::Template->load($map->template_id); if ($mt->{cache_templates}) {