forked from academicpages/academicpages.github.io
-
Notifications
You must be signed in to change notification settings - Fork 3
/
books.html
127 lines (111 loc) · 2.99 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
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
---
layout: standalone
---
{{ content }}
{% assign books=site.books %}
<h2>{{ page.list_title | default: "Books" }}</h2>
{% if books.size > 0 %}
{% for book in books reversed %}
{% assign currentdate = book.date | date: "%Y" %}
{% if currentdate != date %}
{% unless forloop.first %}</ul>{% endunless %}
<h1 id="y{{ currentdate }}">{{ currentdate }}</h1>
<ul>
{% assign date = currentdate %}
{% endif %}
<li class="container">
<figure class="book-cover">
<a class="booklink" href="{{ book.url | relative_url }}">
{% if book.cover %}
<img
alt="{{ book.title }} cover"
src="{{ book.baseurl }}/images/covers/{{ book.cover }}"
/>
{% elsif book.olid %}
<img
alt="{{ book.title }} cover"
src="http://covers.openlibrary.org/b/olid/{{ book.olid }}-L.jpg?default=false"
/>
{% elsif book.isbn %}
<img
alt="{{ book.title }} cover"
src="http://covers.openlibrary.org/b/isbn/{{ book.isbn }}-L.jpg?default=false"
/>
{% endif %}
{% assign status = book.status | upcase | strip %}
<figcaption class="
{% case status %}
{% when 'READING' %}reading
{% when 'FINISHED' %}finished
{% when 'QUEUED' %}queued
{% when 'ABANDONED' %}abandoned
{% when 'INTERESTED' %}interested
{% when 'REREAD' %}reread
{% when 'PAUSED' %}paused
{% else %}uncategorized
{% endcase %}
">
{{ status | default: 'UNCATEGORIZED' }}
</figcaption>
</a>
</figure>
</li>
{% if forloop.last %}</ul>{% endif %}
{% endfor %}
{% endif %}
<style>
ul {
list-style-type: none;
padding: 0;
display: flex;
flex-wrap: wrap;
gap: 16px;
}
.container {
display: flex;
flex-direction: column;
align-items: center;
width: 150px;
}
figure {
display: grid;
grid-template-rows: 1fr auto;
align-items: end;
margin: 0;
height: 100%;
}
figure img {
max-width: 150px;
width: auto;
height: auto;
align-self: end;
}
figcaption {
font-family: monospace;
color: #23212D;
text-transform: uppercase;
padding: 4px 8px;
margin-top: 4px;
width: 150px;
box-sizing: border-box;
text-align: center;
}
.reading { background-color: #f89406; }
.finished { background-color: #62c462; }
.queued { background-color: #9e76b5; }
.abandoned { background-color: #ee5f5b; }
.interested { background-color: #7691db; }
.reread { background-color: #a6517d; }
.paused { background-color: #bdac7e; }
.uncategorized { background-color: #b0abb3; }
.booklink {
text-decoration: none;
display: flex;
flex-direction: column;
align-items: center;
}
.booklink:hover {
color: #23212D;
opacity: 0.8;
}
</style>