use v5.14;
use Gruntmaster::Page;
+use Gruntmaster::Page::Log;
+use Gruntmaster::Data qw/contests jobcard problems/;
sub generate{
my $what = shift;
Gruntmaster::Page::generate $what;
}
+generate "index.html";
generate "learn.html";
-generate "${_}index.html" for '', 'ct/';
-generate "$_/index.html" for grep {-d} <ct/*>;
+generate "ct/index.html";
+generate "ct/$_/index.thml" for contests;
+generate "ct/$_/log/st.html" for contests;
-for my $ct ('', <ct/*/>) {
- generate "${ct}log/index.html";
- generate "${ct}log/st.html" if length $ct;
- generate "${ct}pb/index.html";
- generate "${ct}submit.html";
- generate "$_/index.html" for grep {-d} <${ct}log/*>, <${ct}pb/*>;
+for my $ct (undef, contests) {
+ local $Gruntmaster::Data::contests = $ct;
+ my $ctp = defined $ct ? "ct/$ct/" : '';
+ generate "${ctp}log/index.html";
+ my $pagecnt = jobcard / Gruntmaster::Page::Log::PAGE_SIZE;
+ generate "${ctp}log/$_.html" for 1 .. $pagecnt;
+ generate "${ctp}log/job/$_.html" for 1 .. jobcard;
+ generate "${ctp}submit.html";
+ generate "${ctp}pb/index.html";
+ generate "${ctp}pb/$_.html" for problems;
}