feat: dedicated books page
This commit is contained in:
parent
75047889ae
commit
18c07b5c0f
8 changed files with 97 additions and 1 deletions
22
src/pages/books/index.html
Normal file
22
src/pages/books/index.html
Normal 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 %}
|
25
src/pages/books/want-to-read.html
Normal file
25
src/pages/books/want-to-read.html
Normal 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 %}
|
Reference in a new issue