Archived
4
2

5 Commits

Author SHA1 Message Date
Roan Horning
082ea4069d Merge pull request '[I31] Fix URL to individual series page on series index page' (#32) from I31_Fix-URL into main
Reviewed-on: #32
2022-08-26 00:17:33 +00:00
dfbb4a24db Add missing MACRO absolute_path to link path 2022-08-25 20:10:21 -04:00
4e1d525e6e Merge branch 'main' of repo.anhonesthost.net:rho_n/hpr_generator 2022-08-19 22:20:17 -04:00
694c100bcf Add command line option all
Use --all or -a when calling site-generator instead of special page
ALL to generate all the configured pages for a website.
2022-08-19 22:19:50 -04:00
52a314f2a9 Add command line option all
Use --all or -a when calling site-generator instead of special page
ALL to generate all the configured pages for a website.
2022-08-19 22:11:38 -04:00
3 changed files with 10 additions and 10 deletions

View File

@@ -26,7 +26,7 @@ Generate two specific pages:
`site-generator index about`
Generate the whole site:
`site-generator ALL`
`site-generator --all`
Generate pages based on the same template:
`site-generator correspondent=1,3,5..10`

View File

@@ -8,6 +8,7 @@
site-generator [OPTION]... PAGE|PAGE=<comma separated list of ids>...
-a, --all generate all pages defined in 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
@@ -23,7 +24,7 @@
site-generator index about
Generate the whole site:
site-generator ALL
site-generator --all
Generate pages based on the same template:
site-generator correspondent=1,3,5..10
@@ -92,33 +93,32 @@ exit main();
sub main {
# Argument parsing
my $all;
my $preview;
my $verbose;
my $quiet;
GetOptions(
'all' => \$all,
'list' => \&print_available_pages,
'preview' => \$preview,
'verbose' => \$verbose,
'quiet' => \$quiet,
) or pod2usage(1);
pod2usage(1) unless @ARGV;
pod2usage(1) unless @ARGV || $all;
my (@page_args) = @ARGV;
if ($quiet) {
$verbose = 'quiet';
};
# Set flag indicating whether or not to generate all pages.
# The flag is set to true if the special argument ALL is
# passed into the generator
my $ALL = grep { $_ eq 'ALL' } @page_args;
# Load config file
read_config "site.cfg" => my %config;
my $tt = get_template_html($config{DBI});
if ($ALL) {
# If command line option all is set, parse configuration file
# for all pages
if ($all) {
@page_args = keys %config;
# Remove non page sections of the configuration file

View File

@@ -16,7 +16,7 @@
GROUP BY series) AS ep ON ep.series = miniseries.id
ORDER BY name'
) %-->
<h2><a href="series/<!--% zero_pad_left(series.id) %-->.html"><!--% series.name %--></a></h2>
<h2><a href="<!--% absolute_path(baseurl) %-->series/<!--% zero_pad_left(series.id) %-->.html"><!--% series.name %--></a></h2>
<ul>
<li>Number of episodes: <!--% series.number_of_episodes %--></li>
<li>Open/closed: <!--% display_choice(series.private, 'closed', 'open') %--></li>