feat: book progress bars

This commit is contained in:
Cory Dransfeldt 2024-06-02 12:55:59 -07:00
parent cc2ca7d134
commit d31ce9b2cd
No known key found for this signature in database
6 changed files with 24 additions and 5 deletions

View file

@ -38,7 +38,13 @@ schema: book
{% if book.author %}
<p class="sub-meta">By {{ book.author }}</p>
{% endif %}
{% if book.status == 'finished' %}<p class="sub-meta">Finished on: {{ book.date | date: "%B %e, %Y" }}</p>{% endif %}
{% if book.status == 'finished' %}
<p class="sub-meta">Finished on: {{ book.date | date: "%B %e, %Y" }}</p>
{% endif %}
{% unless book.status == 'finished' %}
{%- assign percentage = book.progress | append: '%' -%}
{% render "partials/media/progress-bar.liquid", percentage:percentage %}
{% endunless %}
<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>

View file

@ -44,6 +44,10 @@ schema: books
{% if book.author %}
<p class="sub-meta">By {{ book.author }}</p>
{% endif %}
{% if book.progress %}
{%- assign percentage = book.progress | append: '%' -%}
{% render "partials/media/progress-bar.liquid", percentage:percentage %}
{% endif %}
{% if book.description %}<blockquote class="description">{{ book.description }}</blockquote>{% endif %}
</div>
</article>