diff --git a/package-lock.json b/package-lock.json index 45296155..bfca45dc 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "coryd.dev", - "version": "18.2.4", + "version": "18.3.4", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "coryd.dev", - "version": "18.2.4", + "version": "18.3.4", "license": "MIT", "dependencies": { "@cdransf/api-text": "^1.4.0", diff --git a/package.json b/package.json index 5edab42c..271fae96 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "coryd.dev", - "version": "18.2.4", + "version": "18.3.4", "description": "The source for my personal site. Built using 11ty.", "type": "module", "scripts": { diff --git a/src/_data/books.js b/src/_data/books.js index 7b56317e..acade5c6 100644 --- a/src/_data/books.js +++ b/src/_data/books.js @@ -67,7 +67,8 @@ export default async function () { image: book['thumbnail'], url: `/books/${book['isbn']}`, date, - status: book['status'], + status: book['read_status'], + progress: book['progress'], tags: book['tags'], rating: book['rating'] !== 'unrated' ? book['rating'] : '', isbn: book['isbn'], diff --git a/src/assets/styles/pages/books.css b/src/assets/styles/pages/books.css index d73176b6..11d97234 100644 --- a/src/assets/styles/pages/books.css +++ b/src/assets/styles/pages/books.css @@ -37,6 +37,10 @@ width: fit-content; } + & .progress-bar-wrapper { + max-width: 75%; + } + & blockquote.description { -webkit-box-orient: vertical; display: -webkit-box; @@ -102,6 +106,10 @@ & .book-meta { align-items: start; + + & .progress-bar-wrapper { + max-width: 40%; + } } } } \ No newline at end of file diff --git a/src/pages/main/books/book.html b/src/pages/main/books/book.html index 0a57048f..4fad5ce0 100644 --- a/src/pages/main/books/book.html +++ b/src/pages/main/books/book.html @@ -38,7 +38,13 @@ schema: book {% if book.author %}

By {{ book.author }}

{% endif %} - {% if book.status == 'finished' %}

Finished on: {{ book.date | date: "%B %e, %Y" }}

{% endif %} + {% if book.status == 'finished' %} +

Finished on: {{ book.date | date: "%B %e, %Y" }}

+ {% endif %} + {% unless book.status == 'finished' %} + {%- assign percentage = book.progress | append: '%' -%} + {% render "partials/media/progress-bar.liquid", percentage:percentage %} + {% endunless %}

View on Open Library

diff --git a/src/pages/main/books/index.html b/src/pages/main/books/index.html index 53a5c81a..ed090b6c 100644 --- a/src/pages/main/books/index.html +++ b/src/pages/main/books/index.html @@ -44,6 +44,10 @@ schema: books {% if book.author %}

By {{ book.author }}

{% endif %} + {% if book.progress %} + {%- assign percentage = book.progress | append: '%' -%} + {% render "partials/media/progress-bar.liquid", percentage:percentage %} + {% endif %} {% if book.description %}
{{ book.description }}
{% endif %}