-
Notifications
You must be signed in to change notification settings - Fork 0
/
books.html
88 lines (82 loc) · 3.67 KB
/
books.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
---
layout: default
title: Reading
current-year: 2024
---
<h1 id="top">{{ page.title }}</h1>
<p>I started this reading list at the beginning of 2019. It includes books I've started or completed since the beginning of that year.</p>
<p>I prefer to read analog books, but I increasingly listen to audiobooks. Audiobooks are marked with 🎧.</p>
<p>In 2024, I added my rating for each book. These ratings are marked with ★s. As you might expect, the ratings are from one to five. I'll likely revise the ratings as I continue to reflect on a given book.</p>
<p>Book cover art is displayed only for the current year.</p>
<!--Anchor nav for years, but only if more than one exists-->
{% assign bookYears = site.data.books.list | size %}
{% if bookYears > 1 %}
<ul class="tag-group">
{% for entry in site.data.books.list %}
{% assign bookSize = entry.books | size %}
<li class="tags"><a href="#{{entry.year}}-books">{{ entry.year }}
{% if bookSize %}
{% if bookSize == 1 %}<span class="details">{{ bookSize }} book
{% elsif bookSize > 1 %}<span class="details">{{ bookSize }} books
{% endif %}
</span></a></li>
{% endif %}
{% endfor %}
</ul>
{% endif %}
<!--Subheadings for each year and number of books for that year-->
{% for entry in site.data.books.list %}
<div>
<div class="line-header">
{% assign bookSize = entry.books | size %}
{% if bookSize == 1 %}
<h2 id="{{entry.year}}-books">{{ entry.year }}</h2><span class="details">{{ bookSize }} book</span>
{% elsif bookSize > 1 %}
<h2 id="{{entry.year}}-books">{{ entry.year }}</h2><span class="details">{{ bookSize }} books</span>
{% else %}
<h2 id="{{entry.year}}-books">{{ entry.year }}</h2><span class="details">I haven't read any books this year.</span>
{% endif %}
</div>
<div>
{% comment %} Books for each year {% endcomment %}
<ul class="book-list">
{% comment %} Books in progress {% endcomment %}
{% assign in_progress = entry.books | where: "completed", "In progress" %}
{% assign next_up = entry.books | where: "completed", "Next" %}
{% for book in in_progress %}
{% include book-item.html %}
<p class="post-meta">
<span>Status: </span><span style="color: #EB002B">{% if book.format == 'audiobook' %} 🎧 {{ book.completed }}{% else %} 📖 {{ book.completed }}{% endif %} {% if book.progress %}<span class="book-author">{{ book.progress }}%</span>{% endif %}</span>
</p>
</li>
{% endfor %}
{% for book in next_up %}
{% include book-item.html %}
<p class="post-meta">
<span>Status: </span><span style="color: #026431">📚 Next up</span>
</p>
</li>
{% endfor %}
{% comment %} Books that aren't in progress {% endcomment %}
{% for book in entry.books %}
{% unless book.completed == "In progress" or book.completed == "Next" %}
{% include book-item.html %}
<p class="post-meta">
{% if book.completed == 'Abandoned' %}
<span>Status: </span><span style="color: #EB002B">{{ book.completed }} ¯\_(ツ)_/¯ </span>
{% else %}
<span>Date completed: </span>{{ book.completed | date: "%B %-d, %Y" }}
{% endif %}
{% include book-format.html %}
{% include book-rating.html %}
</p>
</div>
</div>
</li>
{% endunless %}
{% endfor %}
</ul>
</div>
</div>
<p class="details"><a href="#top">Back to top</a></p>
{% endfor %}