-if (!$ENV{GATEWAY_INTERFACE} and param('-password') and $static_password and param('-password') eq $static_password) {
-
- param('-quiet') or print "Blosxom is generating static index pages...\n";
-
- # Home Page and Directory Indexes
- my %done;
- foreach my $path ( sort keys %indexes) {
- my $p = '';
- foreach ( ('', split /\//, $path) ) {
- $p .= "/$_";
- $p =~ s!^/!!;
- $done{$p}++ and next;
- (-d "$static_dir/$p" or $p =~ /\.$file_extension$/) or mkdir "$static_dir/$p", 0755;
- foreach $flavour ( @static_flavours ) {
- my $content_type = (&$template($p,'content_type',$flavour));
- $content_type =~ s!\n.*!!s;
- my $fn = $p =~ m!^(.+)\.$file_extension$! ? $1 : "$p/index";
- param('-quiet') or print "$fn.$flavour\n";
- my $fh_w = new FileHandle "> $static_dir/$fn.$flavour" or die "Couldn't open $static_dir/$p for writing: $!";
- $output = '';
- if ($indexes{$path} == 1) {
- # category
- $path_info = $p;
- # individual story
- $path_info =~ s!\.$file_extension$!\.$flavour!;
- print $fh_w &generate('static', $path_info, '', $flavour, $content_type);
- } else {
- # date
- local ($path_info_yr,$path_info_mo,$path_info_da, $path_info) =
- split /\//, $p, 4;
- unless (defined $path_info) {$path_info = ""};
- print $fh_w &generate('static', '', $p, $flavour, $content_type);
+if ( !$ENV{GATEWAY_INTERFACE}
+ and param('-password')
+ and $static_password
+ and param('-password') eq $static_password )
+{
+
+ param('-quiet') or print "Blosxom is generating static index pages...\n";
+
+ # Home Page and Directory Indexes
+ my %done;
+ foreach my $path ( sort keys %indexes ) {
+ my $p = '';
+ foreach ( ( '', split /\//, $path ) ) {
+ $p .= "/$_";
+ $p =~ s!^/!!;
+ next if $done{$p}++;
+ mkdir "$static_dir/$p", 0755
+ unless ( -d "$static_dir/$p" or $p =~ /\.$file_extension$/ );
+ foreach $flavour (@static_flavours) {
+ my $content_type
+ = ( &$template( $p, 'content_type', $flavour ) );
+ $content_type =~ s!\n.*!!s;
+ my $fn = $p =~ m!^(.+)\.$file_extension$! ? $1 : "$p/index";
+ param('-quiet') or print "$fn.$flavour\n";
+ my $fh_w = new FileHandle "> $static_dir/$fn.$flavour"
+ or die "Couldn't open $static_dir/$p for writing: $!";
+ $output = '';
+ if ( $indexes{$path} == 1 ) {
+
+ # category
+ $path_info = $p;
+
+ # individual story
+ $path_info =~ s!\.$file_extension$!\.$flavour!;
+ print $fh_w &generate( 'static', $path_info, '', $flavour,
+ $content_type );
+ }
+ else {
+
+ # date
+ local (
+ $path_info_yr, $path_info_mo,
+ $path_info_da, $path_info
+ ) = split /\//, $p, 4;
+ unless ( defined $path_info ) { $path_info = "" }
+ print $fh_w &generate( 'static', '', $p, $flavour,
+ $content_type );
+ }
+ $fh_w->close;
+ }