Hi All
I'm trying to include an extra page in the build.
The default is that the extra page ends up like this:
/extra/index.html
What I want to do is have:
/extra.html
To name the file 'extra.html', I'm gonna create a tag in links.cfg below $build_index and call it $extra_index:
$extra_index = "extra.html";
Here is the sub from nph-build:
# --------------------------------------------------------
# Creates an "Extra" page.
local $title_linked;
if ($build_extra_path =~ m,^$build_root_path/(.*)$,) {
&build_dir ($1);
}
$title_linked = &build_linked_title ("EXTRA");
open (EXTRA, ">$build_extra_path/$extra_index") or cgierr ("unable to open EXTRA page: $build_extra_path/$extra_index. Reason: $!");
print EXTRA &site_html_extra;
close EXTRA;
}
However, the part that I'm stuck on is how to get rid of the directory creation:
/extra/extra.html
How can I change the $build_extra_path above to just create the extra.html page without creating the directory?
/extra.html
------
Here's the sub build_dir if needed:
# --------------------------------------------------------
# Verifies that all neccessary directories have been created
# before we create the category file. Takes as input, the category
# to verify, and returns the full directory path.
my $input = shift;
my ($dir, $path) = '';
my @dirs = split /\//, $input;
foreach $dir (@dirs) {
$path .= "/$dir";
&build_check_dir ($build_root_path, $path);
if (! (-e "$build_root_path$path")) {
print "\tMaking Directory ($build_dir_per): '$build_root_path$path' ...";
if (mkdir ("$build_root_path$path", "$build_dir_per")) {;
print "Made. CHMOD ($build_dir_per) ...";
if (chmod ($build_dir_per, "$build_root_path$path")) {;
print "Done.";
}
else { print "CHMOD ($build_dir_per) failed! Reason: $!."; }
}
else { print "mkdir failed! Reason: $!."; }
print "\n";
}
}
return "$build_root_path$path";
}
Here's the sub site_html_extra from site_html_templates.pl:
# --------------------------------------------------------
#
&html_print_headers;
return &load_template ('extra.html', {
title_linked => $title_linked,
%globals
} );
}
[/url]
Thanks very much
------------------------------------------
I'm trying to include an extra page in the build.
The default is that the extra page ends up like this:
/extra/index.html
What I want to do is have:
/extra.html
To name the file 'extra.html', I'm gonna create a tag in links.cfg below $build_index and call it $extra_index:
$extra_index = "extra.html";
Here is the sub from nph-build:
Code:
sub build_extra_page { # --------------------------------------------------------
# Creates an "Extra" page.
local $title_linked;
if ($build_extra_path =~ m,^$build_root_path/(.*)$,) {
&build_dir ($1);
}
$title_linked = &build_linked_title ("EXTRA");
open (EXTRA, ">$build_extra_path/$extra_index") or cgierr ("unable to open EXTRA page: $build_extra_path/$extra_index. Reason: $!");
print EXTRA &site_html_extra;
close EXTRA;
}
However, the part that I'm stuck on is how to get rid of the directory creation:
/extra/extra.html
How can I change the $build_extra_path above to just create the extra.html page without creating the directory?
/extra.html
------
Here's the sub build_dir if needed:
Code:
sub build_dir { # --------------------------------------------------------
# Verifies that all neccessary directories have been created
# before we create the category file. Takes as input, the category
# to verify, and returns the full directory path.
my $input = shift;
my ($dir, $path) = '';
my @dirs = split /\//, $input;
foreach $dir (@dirs) {
$path .= "/$dir";
&build_check_dir ($build_root_path, $path);
if (! (-e "$build_root_path$path")) {
print "\tMaking Directory ($build_dir_per): '$build_root_path$path' ...";
if (mkdir ("$build_root_path$path", "$build_dir_per")) {;
print "Made. CHMOD ($build_dir_per) ...";
if (chmod ($build_dir_per, "$build_root_path$path")) {;
print "Done.";
}
else { print "CHMOD ($build_dir_per) failed! Reason: $!."; }
}
else { print "mkdir failed! Reason: $!."; }
print "\n";
}
}
return "$build_root_path$path";
}
Here's the sub site_html_extra from site_html_templates.pl:
Code:
sub site_html_extra { # --------------------------------------------------------
#
&html_print_headers;
return &load_template ('extra.html', {
title_linked => $title_linked,
%globals
} );
}
[/url]
Thanks very much
------------------------------------------