commit 556a5f41fb8a36904bb0cc4f04293f9377b01443
parent 22c2d052a80f5cc622d8110f9a7c21f856886ebd
Author: cipher <haris@2f30.org>
Date: Mon, 2 Dec 2013 19:36:50 +0200
add support for page creation without appearing on menu
Diffstat:
1 file changed, 19 insertions(+), 0 deletions(-)
diff --git a/bin/bliper-generate.pl b/bin/bliper-generate.pl
@@ -8,6 +8,7 @@ my $main_page = 'output/index.html';
my $indir = 'main-articles'; # the input directory name
my $outdir = 'output'; # the output directory name
my $pagedir = 'pages'; # individual pages directory
+my $b_pages = 'b_pages'; # pages that do not show at menu
my @maint = qx(cat template/main-top); # top section for main page
my @mainb = qx(cat template/main-bottom); # bottom section for main page
my @footer = qx(cat template/footer); # footer for every page incl main
@@ -75,6 +76,24 @@ foreach my $file (@files) { # Read each file(post) from indir, cat to $outdi
print OUT "<br>";
}
+chdir($main_dir) or die "Can't change path to $main_dir $!\n";
+chdir($b_pages) or die "Can't change path to $indir $!\n";
+print "Entering " . getcwd . "\n\n";
+
+my @ind_pages = <*>;
+foreach my $file (@ind_pages) { # Read each file(post) from indir, cat to $outdir/$file.html
+ print "Processing individual page:";
+ printf ("%-30s", $file);
+ print "\t==> output file:\t" . "../$outdir/$file.html\n";
+ my @array = qx(cat $file);
+ open (OUT, '>', "../$outdir/$file.html") or die $!;
+ print OUT @articlet;
+ my @html = qx(Markdown.pl $file); # markdown to html
+ print OUT @html; # append content
+ print OUT @articleb;
+ close OUT;
+}
+
open (OUT, '>>', "../$outdir/index.html") or die $!; # close all tags in index.html
print OUT @mainb;
print OUT @footer;