Skip to content

Commit 5d89234

Browse files
committed
Changing hiking layout.
1 parent edbbe78 commit 5d89234

2 files changed

Lines changed: 50 additions & 1 deletion

File tree

_layouts/hike-shelf.liquid

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
---
2+
layout: page
3+
---
4+
{{ content }}
5+
6+
{% if page.collection and page.collection.size > 0 %}
7+
{% assign collection = site[page.collection] %}
8+
{% if collection and collection.size > 0 %}
9+
{% for item in collection reversed %}
10+
{% assign current_year = item.date | date: '%Y' %}
11+
{% if current_year != year %}
12+
{% unless forloop.first %}
13+
</ul>
14+
{% endunless %}
15+
<h1 id="y{{item.date | date: "%Y"}}">
16+
<a href="{{ current_year | prepend: '/books/' | relative_url }}">{{ current_year }}</a>
17+
</h1>
18+
<ul>
19+
{% assign year = current_year %}
20+
{% endif %}
21+
22+
<figure class="cover">
23+
<a class="cover-link" href="{{ item.url | relative_url }}">
24+
{% if item.cover %}
25+
<img alt="{{ item.title }} cover" src="{{ item.cover | prepend: page.covers | relative_url }}" style="height:200px">
26+
{% elsif item.olid %}
27+
<img alt="{{ item.title }} cover" src="http://covers.openlibrary.org/b/olid/{{ item.olid }}-L.jpg?default=false" style="height:200px">
28+
{% elsif item.isbn %}
29+
<img alt="{{ item.title }} cover" src="http://covers.openlibrary.org/b/isbn/{{ item.isbn }}-L.jpg?default=false" style="height:200px">
30+
{% endif %}
31+
{% if item.status %}
32+
{% assign statuses = 'abandoned,finished,interested,paused,queued,reading,reread' | split: ',' %}
33+
{% assign status = item.title | downcase | strip %}
34+
{% if statuses contains status %}
35+
<figcaption class="{{ status | downcase }}">{{ status | upcase }}</figcaption>
36+
{% else %}
37+
<figcaption class="uncategorized">UNCATEGORIZED</figcaption>
38+
{% endif %}
39+
{% else %}
40+
<figcaption class="uncategorized">UNCATEGORIZED</figcaption>
41+
{% endif %}
42+
</a>
43+
</figure>
44+
{% if forloop.last %}
45+
</ul>
46+
{% endif %}
47+
{% endfor %}
48+
{% endif %}
49+
{% endif %}

_pages/hiking.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
---
2-
layout: book-shelf
2+
layout: hike-shelf
33
title: Outdoor
44
permalink: /hiking/
55
nav: false

0 commit comments

Comments
 (0)