feat: support book reviews

This commit is contained in:
Cory Dransfeldt 2024-06-02 14:00:39 -07:00
parent abb4ba37f3
commit 80d222cdbc
No known key found for this signature in database
5 changed files with 7 additions and 5 deletions

4
package-lock.json generated
View file

@ -1,12 +1,12 @@
{ {
"name": "coryd.dev", "name": "coryd.dev",
"version": "18.4.4", "version": "18.5.4",
"lockfileVersion": 3, "lockfileVersion": 3,
"requires": true, "requires": true,
"packages": { "packages": {
"": { "": {
"name": "coryd.dev", "name": "coryd.dev",
"version": "18.4.4", "version": "18.5.4",
"license": "MIT", "license": "MIT",
"dependencies": { "dependencies": {
"@cdransf/api-text": "^1.4.0", "@cdransf/api-text": "^1.4.0",

View file

@ -1,6 +1,6 @@
{ {
"name": "coryd.dev", "name": "coryd.dev",
"version": "18.4.4", "version": "18.5.4",
"description": "The source for my personal site. Built using 11ty.", "description": "The source for my personal site. Built using 11ty.",
"type": "module", "type": "module",
"scripts": { "scripts": {

View file

@ -63,6 +63,8 @@ export default async function () {
return { return {
title: book['title'], title: book['title'],
author, author,
review: book['review'],
rating: book['star_rating'] !== 'unrated' ? book['star_rating'] : '',
description: book['description'], description: book['description'],
image: book['thumbnail'], image: book['thumbnail'],
url: `/books/${book['isbn']}`, url: `/books/${book['isbn']}`,
@ -70,7 +72,6 @@ export default async function () {
status: book['read_status'], status: book['read_status'],
progress: book['progress'], progress: book['progress'],
tags: book['tags'], tags: book['tags'],
rating: book['star_rating'] !== 'unrated' ? book['star_rating'] : '',
isbn: book['isbn'], isbn: book['isbn'],
type: 'book', type: 'book',
} }

View file

@ -48,5 +48,6 @@ schema: book
<p class="sub-meta"><a href="https://openlibrary.org/isbn/{{ book.isbn }}" title="View {{ book.title | escape }} on Open Library">View on Open Library</a></p> <p class="sub-meta"><a href="https://openlibrary.org/isbn/{{ book.isbn }}" title="View {{ book.title | escape }} on Open Library">View on Open Library</a></p>
</div> </div>
</div> </div>
{% if book.review %}{{ book.review | markdown }}{% endif %}
{% if book.description %}<p><em>{{ book.description }}</em></p>{% endif %} {% if book.description %}<p><em>{{ book.description }}</em></p>{% endif %}
</article> </article>

View file

@ -39,7 +39,7 @@ schema: movie
</div> </div>
{% if movie.review %} {% if movie.review %}
{% render "partials/banners/warning.liquid", text: "There are probably spoilers after this banner — this is a warning about them." %} {% render "partials/banners/warning.liquid", text: "There are probably spoilers after this banner — this is a warning about them." %}
<p>{{ movie.review | markdown }}</p> {{ movie.review | markdown }}
<hr class="large-spacing" /> <hr class="large-spacing" />
{% endif %} {% endif %}
{% if movie.description %}<p><em>{{ movie.description }}</em></p>{% endif %} {% if movie.description %}<p><em>{{ movie.description }}</em></p>{% endif %}