diff --git a/site-generator b/site-generator index c81cffc..1147b68 100755 --- a/site-generator +++ b/site-generator @@ -8,13 +8,13 @@ site-generator [OPTION]... PAGE|PAGE=... - -a, --all generate all pages defined in configuration file - -c, --configure path to configuration file - -l, --list print list of configured pages - -p, --preview print generated pages to standard out - -q, --quiet suppress progress information while generating pages - -v, --verbose print extended progress information while generating pages - --help print this help message + -a, --all generate all pages defined in configuration file + -c, --configuration path to configuration file + -l, --list print list of configured pages + -p, --preview print generated pages to standard out + -q, --quiet suppress progress information while generating pages + -v, --verbose print extended progress information while generating pages + --help print this help message Where I is a file name of a web page or the special I (to generate all pages). @@ -30,6 +30,10 @@ Generate pages based on the same template: site-generator correspondent=1,3,5..10 + Generate two specific pages with a different configuration: + site-generator --configuration=site_sqlite.cfg index about + + =head1 DESCRIPTION This is a site generator for the Hacker Public Radio website based upon the Perl Templates Toolkit. @@ -115,12 +119,12 @@ sub main { my $verbose; my $quiet; GetOptions( - 'all' => \$all, + 'all' => \$all, 'configuration=s' => \$configuration_path, - 'list' => \&print_available_pages, - 'preview' => \$preview, - 'verbose' => \$verbose, - 'quiet' => \$quiet, + 'list' => \&print_available_pages, + 'preview' => \$preview, + 'verbose' => \$verbose, + 'quiet' => \$quiet, ) or pod2usage(1); pod2usage(1) unless @ARGV || $all; my (@page_args) = @ARGV; @@ -179,8 +183,10 @@ sub main { } if ($page_config->{'multipage'} && $page_config->{'multipage'} eq 'true') { - if (scalar @{$parsed_arg{'ids'}} == 1) { - @{$parsed_arg{'ids'}} = get_ids_from_db($tt, \$page_config); + # Empty arrayref bug fixed, so count is reduced by 1 +# if (scalar @{$parsed_arg{'ids'}} == 1) { + if (scalar @{$parsed_arg{'ids'}} == 0) { + @{$parsed_arg{'ids'}} = get_ids_from_db($tt, \$page_config); } foreach my $id (@{$parsed_arg{'ids'}}) { $page_config->{'id'} = $id; @@ -252,7 +258,8 @@ sub parse_page_arg { my ($page_arg) = @_; # Split page name from page ids if available. my ($page, $ids) = split(/=/, $page_arg); - my @ids = []; + #my @ids = []; + my @ids; if(!$ids) { $ids = ""; @@ -287,8 +294,9 @@ sub get_ids_from_db { $tt->process($id_template, $$config, \$selected_ids) || die $tt->error(), "\n"; - - return split(/,/, substr($selected_ids, 1)); + + # Starts with a newline and comma + return split(/,/, substr($selected_ids, 2)); } sub get_filename { @@ -313,7 +321,7 @@ sub get_filename { # Default naming if full filename configuration is not supplied. if ($$config{'multipage'} && $$config{'multipage'} eq 'true') { my $padded_index = sprintf("%04d", $$config{'id'}); - $filename = "$base_path$$config{'page'}${padded_index}.html"; + $filename = "$base_path$$config{'page'}${padded_index}.html"; } else { $filename = "$base_path$$config{'page'}.html"; diff --git a/templates/content-correspondents.tpl.html b/templates/content-correspondents.tpl.html index dce4335..6e5eb68 100644 --- a/templates/content-correspondents.tpl.html +++ b/templates/content-correspondents.tpl.html @@ -8,14 +8,15 @@ - + diff --git a/templates/content-episode.tpl.html b/templates/content-episode.tpl.html index 3689e13..4515096 100644 --- a/templates/content-episode.tpl.html +++ b/templates/content-episode.tpl.html @@ -5,14 +5,14 @@ - + + @@ -87,13 +87,41 @@ Subscribe to the comments - + + + + + + + + + + + + + + + + + + +
Avatar Name & Host IDlicenseLicense Last Show
Comment:
+
Are you a spammer? + + + + +
Who hosted this show? + + +
What does HPR mean to you?
+
diff --git a/templates/content-sitemap.tpl.html b/templates/content-sitemap.tpl.html index 873328a..0bef9fe 100644 --- a/templates/content-sitemap.tpl.html +++ b/templates/content-sitemap.tpl.html @@ -27,7 +27,7 @@
  • Hosts ← A list of all our Hosts.
  • Contact ← How to get in touch with us.
  • Promote HPR ← Ways you can spread the word.
  • -
  • Show Comments ← Read the latest comments left on shows.
  • +
  • Show Comments ← Read the latest comments left on shows.
  • Search ← Search HPR
  • diff --git a/templates/page.tpl.html b/templates/page.tpl.html index 837e384..9d8aca3 100644 --- a/templates/page.tpl.html +++ b/templates/page.tpl.html @@ -11,7 +11,7 @@ - +