1
0
forked from HPR/hpr_generator

Initial add of site-generator app and config file

A Perl program which uses Template Toolkit to generate static html
files for Hacker Public Radio.

Signed-off-by: Roan Horning <roan.horning@gmail.com>
This commit is contained in:
2022-06-28 05:25:36 -04:00
parent 158550d7e2
commit 5cb694de14
2 changed files with 84 additions and 0 deletions

61
site-generator Executable file
View File

@@ -0,0 +1,61 @@
#!/usr/bin/perl
=head1 NAME
siteGenerator - HPR Site Generator
=head1 SYNOPSIS
siteGenerator [OPTION]... PAGE...
-v, --verbose use verbose mode
--help print this help message
Where I<PAGE> is a file name of a web page.
Examples:
Generate two specific pages:
siteGenerator index about
Generate the whole site:
siteGenerator ALL
=head1 DESCRIPTION
This is a site generator based upon the Perl Templates Toolkit.
=head1 AUTHOR
Roan Horning <roan.horning@no-spam.gmail.com>
=cut
use strict;
use warnings;
use Getopt::Long qw(:config auto_help);
use Pod::Usage;
use Config::Std;
exit main();
sub main {
# Argument parsing
my $verbose;
GetOptions(
'verbose' => \$verbose,
) or pod2usage(1);
pod2usage(1) unless @ARGV;
my (@pages) = @ARGV;
# Load config file
read_config "site.cfg" => my %config;
use Data::Dumper 'Dumper';
warn Dumper [ \%config ];
return 0;
}