diff --git a/.gitignore b/.gitignore index 98d9ef5..f5169bb 100644 --- a/.gitignore +++ b/.gitignore @@ -8,4 +8,5 @@ esy.lock/ posts/*.blog posts/*.post \#* -.DS_Store \ No newline at end of file +.DS_Store +bookshelf.txt diff --git a/bookshelf/bookshelf.mustache b/bookshelf/bookshelf.mustache new file mode 100644 index 0000000..9b9701e --- /dev/null +++ b/bookshelf/bookshelf.mustache @@ -0,0 +1,59 @@ + + + + + + + rawley.xyz/web-ring + + + + +
+

+ Rawley.xyz +

+ +
+
+

Here is a list of books I have read, in no particular order.

+
+ {{#books}} +

+ {{name}} by {{author}}. Rating: {{rating}} +

+ {{/books}} +
+
+ + + diff --git a/bookshelf/bookshelf.raku b/bookshelf/bookshelf.raku new file mode 100644 index 0000000..df74530 --- /dev/null +++ b/bookshelf/bookshelf.raku @@ -0,0 +1,15 @@ +use v6.d; + +use Humming-Bird::Core; +use Template::Mustache; + +my constant $BOOKSHELF-LOCATION = 'bookshelf.txt'; + +my $tmpl = Template::Mustache.new: :from<.>; + +get('/bookshelf', -> $request, $response { + my @books = $BOOKSHELF-LOCATION.IO.lines>>.split('^').map(-> ($name, $author, $href, $rating) { %(:$name, :$author, :$href, :$rating) }); + $response.html($tmpl.render('bookshelf', { :@books })); +}); + +listen(8888); diff --git a/bookshelf/bookshelf.tmpl b/bookshelf/bookshelf.tmpl new file mode 100644 index 0000000..e69de29 diff --git a/html/philosophy.html b/html/philosophy.html index 63ec188..8dd0e89 100644 --- a/html/philosophy.html +++ b/html/philosophy.html @@ -38,6 +38,9 @@
  • web ring
  • +
  • + bookshelf +
  • diff --git a/html/resume.html b/html/resume.html index 0933c7f..c26b29a 100644 --- a/html/resume.html +++ b/html/resume.html @@ -38,6 +38,9 @@
  • web ring
  • +
  • + bookshelf +
  • diff --git a/html/web-ring.html b/html/web-ring.html index df8aab8..8de4441 100644 --- a/html/web-ring.html +++ b/html/web-ring.html @@ -30,6 +30,9 @@
  • web ring
  • +
  • + bookshelf +
  • diff --git a/rawleydotxyz b/rawleydotxyz new file mode 100644 index 0000000..4d9f227 --- /dev/null +++ b/rawleydotxyz @@ -0,0 +1,4 @@ +#!/bin/bash + +"$(pwd)/_esy/default/build/default/rawleydotxyz.exe" & +raku "$(pwd)/bookshelf/bookshelf.raku" & diff --git a/views/layout.eml.ml b/views/layout.eml.ml index 4ad1dee..01a5b4e 100644 --- a/views/layout.eml.ml +++ b/views/layout.eml.ml @@ -25,6 +25,10 @@ let render body =
  • web ring
  • +
  • + bookshelf +
  • +