Permalink
Switch branches/tags
Nothing to show
Find file
Fetching contributors…
Cannot retrieve contributors at this time
25 lines (19 sloc) 672 Bytes
use v6;
use JSON::Tiny;
use Template::Mojo;
my $site_dir = '/home/sergot/public_html/modules';
my $fullpath = '/home/sergot/modules.perl6.org';
my $last_update = DateTime.now.Str;
my $tmpl = slurp "$fullpath/web/index.mojo";
my $projects = from-json(slurp("$site_dir/proto.json")).values;
my $index = open "$site_dir/index.html", :w;
$index.say: Template::Mojo.new($tmpl).render($projects.list.sort(*.<name>).item, $last_update);
$index.close;
$tmpl = slurp "$fullpath/web/module.mojo";
for $projects.list -> $p {
if $p {
my $m = open "$site_dir/module/{$p<name>}.html", :w;
$m.say: Template::Mojo.new($tmpl).render($p);
$m.close;
}
}