add bookshelf

This commit is contained in:
2023-01-25 01:10:36 +00:00
parent 6c5dabec65
commit d73a8fcffa
9 changed files with 93 additions and 1 deletions

1
.gitignore vendored
View File

@@ -9,3 +9,4 @@ posts/*.blog
posts/*.post posts/*.post
\#* \#*
.DS_Store .DS_Store
bookshelf.txt

View File

@@ -0,0 +1,59 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta name="description" content="Rawley.xyz, Rawley Fowler's web ring">
<title>rawley.xyz/web-ring</title>
<link href="/static/index.css" rel="stylesheet">
<style>
main a {
text-decoration: none;
}
</style>
</head>
<body>
<header>
<h1>
<a href="/">Rawley.xyz</a>
</h1>
<nav>
<li>
<a href="/blog">blog</a>
</li>
<li>
<a href="/resume">resume</a>
</li>
<li>
<a href="/philosophy">philosophy</a>
</li>
<li>
<a href="/web-ring">web ring</a>
</li>
<li>
<a href="/bookshelf">bookshelf</a>
</li>
</nav>
</header>
<main>
<p>Here is a list of books I have read, in no particular order.</p>
<div>
{{#books}}
<p>
<a href="{{href}}">{{name}}</a> by {{author}}. <b>Rating</b>: {{rating}}
</p>
{{/books}}
</div>
</main>
<footer>
<hr>
<p>
Copyright &copy; Rawley Fowler 2022
</p>
<p>
<b>Disclaimer</b>: All opinions on this site, are that of my own. They do not
reflect the opinions of any of my employers; past, present, or future.
</p>
</footer>
</body>
</html>

15
bookshelf/bookshelf.raku Normal file
View File

@@ -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);

0
bookshelf/bookshelf.tmpl Normal file
View File

View File

@@ -38,6 +38,9 @@
<li> <li>
<a href="/web-ring">web ring</a> <a href="/web-ring">web ring</a>
</li> </li>
<li>
<a href="/bookshelf">bookshelf</a>
</li>
</nav> </nav>
</header> </header>
<main> <main>

View File

@@ -38,6 +38,9 @@
<li> <li>
<a href="/web-ring">web ring</a> <a href="/web-ring">web ring</a>
</li> </li>
<li>
<a href="/bookshelf">bookshelf</a>
</li>
</nav> </nav>
</header> </header>
<main> <main>

View File

@@ -30,6 +30,9 @@
<li> <li>
<a href="/web-ring">web ring</a> <a href="/web-ring">web ring</a>
</li> </li>
<li>
<a href="/bookshelf">bookshelf</a>
</li>
</nav> </nav>
</header> </header>
<main> <main>

4
rawleydotxyz Normal file
View File

@@ -0,0 +1,4 @@
#!/bin/bash
"$(pwd)/_esy/default/build/default/rawleydotxyz.exe" &
raku "$(pwd)/bookshelf/bookshelf.raku" &

View File

@@ -25,6 +25,10 @@ let render body =
<li> <li>
<a href="/web-ring">web ring</a> <a href="/web-ring">web ring</a>
</li> </li>
<li>
<a href="/bookshelf">bookshelf</a>
</li>
</nav> </nav>
</header> </header>
<main> <main>