feat: dedicated books page

This commit is contained in:
Cory Dransfeldt 2024-04-22 12:50:44 -07:00
parent 75047889ae
commit 18c07b5c0f
No known key found for this signature in database
8 changed files with 97 additions and 1 deletions

View file

@ -0,0 +1,22 @@
---
title: Currently reading • Books
layout: default
permalink: "/books/index.html"
---
{%- assign bookData = books | bookStatus: 'started' -%}
<h2 class="page-header">Currently reading</h2>
<p>Here's what I'm reading at the moment. <a href="/books/want-to-read/">You can also take a look at what I'm planning to read (eventually).</a></p>
<hr class="large-spacing" />
{% for book in bookData %}
{% capture alt %}{{ book.title }} by {{ book.authors }}{% endcapture %}
<article class="book-entry">
{% image book.image, alt %}
<div class="book-meta">
<p class="title"><strong>{{ book.title }}</strong></p>
{% if book.authors or book.categories %}
<p class="author-categories">{% if book.authors %}By {{ book.authors }}{% endif %}{% if book.categories %}{% if book.authors %}• {% endif %}<em>{{ book.categories }}</em>{% endif %}</p>
{% endif %}
{% if book.description %}<blockquote class="description">{{ book.description }}</blockquote>{% endif %}
</div>
</article>
{% endfor %}

View file

@ -0,0 +1,25 @@
---
title: Want to read • Books
layout: default
pagination:
data: collections.booksToRead
alias: books
size: 30
permalink: "/books/want-to-read/{{ pagination.pageNumber }}/index.html"
---
{% if pagination.pageNumber == 0 %}
<h2 class="page-header">Want to read</h2>
<p>These are books I want to read, sorted in alphabetical order. As one would expect, it will change as I navigate through and add to it.</p>
<hr class="large-spacing" />
{% endif %}
<ul class="link-list reduced-spacing">
{% for book in pagination.items %}
<li>
<a href="{{ book.url }}" title="{{ book.title | escape }}">
<strong>{{ book.title }}</strong>
</a>
{% if book.authors %}by {{ book.authors }}{% endif %}{% if book.categories %} • <em>{{ book.categories }}</em>{% endif %}
</li>
{% endfor %}
</ul>
{% render "partials/paginator.liquid", pagination:pagination %}