Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

single module page added, readme_content in proto.json

  • Loading branch information...
commit 82ac65e145e57a74087d7c955736ed6d94b25001 1 parent ebd39a0
Filip Sergot authored
Showing with 11 additions and 1 deletion.
  1. +7 −1 web/build.p6
  2. +4 −0 web/mkjson.p6
8 web/build.p6
View
@@ -2,7 +2,7 @@ use v6;
use JSON::Tiny;
use Template::Mojo;
-my $site_dir = '/home/user/public_html/modules/';
+my $site_dir = '/home/user/public_html/modules';
my $last_update = DateTime.now.Str;
my $tmpl = slurp "index.mojo";
@@ -12,3 +12,9 @@ my $projects = from-json(slurp("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;
+
+for $projects.list -> $p {
+ my $m = open "$site_dir/module/{$p<name>}.html", :w;
+ $m.say: Template::Mojo.new(slurp "module.mojo").render($p);
+ $m.close;
+}
4 web/mkjson.p6
View
@@ -10,8 +10,10 @@ class Project {
has $.name;
has $.readme;
+ has $.readme_content;
has $.logo;
has $.description;
+
has $!path;
has Pair $.test-results is rw; # colour => description
@@ -52,6 +54,7 @@ class Project {
my $readme_file = readme_file($!path);
$!readme = $readme_file ?? $!URL~"/blob/master/"~$readme_file !! False;
+ $!readme_content = slurp "$!path/$readme_file";
}
sub readme_file(Str $path) {
@@ -65,6 +68,7 @@ class Project {
"URL" => $.URL,
"gitname" => $.gitname,
"readme" => $.readme,
+ "readme_content" => $.readme_content,
"description" => $.description,
"has_tests" => self.has_tests,
"is_fresh" => self.is_fresh,
Please sign in to comment.
Something went wrong with that request. Please try again.