forked from alshedivat/al-folio
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbook-shelf.liquid
More file actions
49 lines (47 loc) · 1.94 KB
/
Copy pathbook-shelf.liquid
File metadata and controls
49 lines (47 loc) · 1.94 KB
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
---
layout: page
---
{{ content }}
{% if page.collection and page.collection.size > 0 %}
{% assign collection = site[page.collection] %}
{% if collection and collection.size > 0 %}
{% for item in collection reversed %}
{% assign current_year = item.started | date: '%Y' %}
{% if current_year != year %}
{% unless forloop.first %}
</ul>
{% endunless %}
<h1 id="y{{item.started | date: "%Y"}}">
<a href="{{ current_year | prepend: '/books/' | relative_url }}">{{ current_year }}</a>
</h1>
<ul>
{% assign year = current_year %}
{% endif %}
<figure class="cover">
<a class="cover-link" href="{{ item.url | relative_url }}">
{% if item.cover %}
<img alt="{{ item.title }} cover" src="{{ item.cover | prepend: page.covers | relative_url }}" style="height:200px">
{% elsif item.olid %}
<img alt="{{ item.title }} cover" src="https://covers.openlibrary.org/b/olid/{{ item.olid }}-L.jpg?default=false" style="height:200px">
{% elsif item.isbn %}
<img alt="{{ item.title }} cover" src="https://covers.openlibrary.org/b/isbn/{{ item.isbn }}-L.jpg?default=false" style="height:200px">
{% endif %}
{% if item.status %}
{% assign statuses = 'abandoned,finished,interested,paused,queued,reading,reread' | split: ',' %}
{% assign status = item.status | downcase | strip %}
{% if statuses contains status %}
<figcaption class="{{ status | downcase }}">{{ status | upcase }}</figcaption>
{% else %}
<figcaption class="uncategorized">UNCATEGORIZED</figcaption>
{% endif %}
{% else %}
<figcaption class="uncategorized">UNCATEGORIZED</figcaption>
{% endif %}
</a>
</figure>
{% if forloop.last %}
</ul>
{% endif %}
{% endfor %}
{% endif %}
{% endif %}