From: Marius Gavrilescu Date: Thu, 16 Jan 2014 15:52:34 +0000 (+0200) Subject: Update gruntmaster-genallpages X-Git-Url: http://git.ieval.ro/?a=commitdiff_plain;h=5a505a290572152298325fee353fa7cf852141c4;p=gruntmaster-page.git Update gruntmaster-genallpages --- diff --git a/gruntmaster-genallpages b/gruntmaster-genallpages index ca70a72..d26c02d 100755 --- a/gruntmaster-genallpages +++ b/gruntmaster-genallpages @@ -2,6 +2,8 @@ use v5.14; use Gruntmaster::Page; +use Gruntmaster::Page::Log; +use Gruntmaster::Data qw/contests jobcard problems/; sub generate{ my $what = shift; @@ -9,14 +11,20 @@ sub generate{ Gruntmaster::Page::generate $what; } +generate "index.html"; generate "learn.html"; -generate "${_}index.html" for '', 'ct/'; -generate "$_/index.html" for grep {-d} ; +generate "ct/index.html"; +generate "ct/$_/index.thml" for contests; +generate "ct/$_/log/st.html" for contests; -for my $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; }