Skip to content

Commit

Permalink
Create book type with quotations data
Browse files Browse the repository at this point in the history
  • Loading branch information
lchski committed Jun 16, 2018
1 parent 3326682 commit 610b678
Show file tree
Hide file tree
Showing 5 changed files with 69 additions and 0 deletions.
10 changes: 10 additions & 0 deletions _books/2018-06-10-medicine-river.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
---
layout: study--book
title: 'Medicine River'
author: 'Thomas King'
book_id: 'medicine-river-king'
date: '2018-06-10 12:00:00 -0400'
published: true
---


3 changes: 3 additions & 0 deletions _config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,9 @@ collections:
findings:
output: true
permalink: /study/urop/:title/
books:
output: true
permalink: /study/reading/:title/


# Build settings
Expand Down
4 changes: 4 additions & 0 deletions _data/book_quotations.tsv
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
book_id page quotation
medicine-river-king 201 He collected these interests the way some people collect stamps, and though they never seemed to last very long, the knowledge accumulated in Harlen’s brain like brown grocery bags in a closet.
medicine-river-king 188 The truth of the matter, she told me, was that marriage was always more of a burden on women than on men, that women always had to take on extra weight, while men just fell into marriage as if they were falling into bed.
medicine-river-king 217 [“Formidable.”] Harlen liked words like that, not because they were big or important sounding, but because people didn’t use them much, and there was the chance that they might get lost. … “Good words are hard to find.”
30 changes: 30 additions & 0 deletions _layouts/study--book.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
---
layout: study
site_section: study
---

<article>

<header>
<h1 class="f2 mb0">{{ page.title | markdownify | remove: '<p>' | remove: '</p>' }}</h1>
<p class="f5 black-70 measure-wide lh-copy">{{ page.author | markdownify | remove: '<p>' | remove: '</p>' }}</p>
</header>

<div class="f3 measure lh-copy serif nested-list-item-spacing">
{{ content }}
</div>

<ol>
{% for quotation in site.data.book_quotations %}
{% if quotation.book_id == page.book_id %}
<li>
<blockquote class="ml0 pl4 bl bw3 b--black-10 f4">
<p class="measure">{{ quotation.quotation }}</p>
<p class="f5 measure"><cite>– {{ page.author }}, pg. {{ quotation.page }}</cite></p>
</blockquote>
</li>
{% endif %}
{% endfor %}
</ol>

</article>
22 changes: 22 additions & 0 deletions study/reading/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
---
layout: study
title: Hit and Miss
---

<header class="ph4 pv1 nl4 nr4 mt4 mb4 bg-white-70 bt bb b--black-05 b--dotted bl-0 br-0 mw7 br-ns">
<h1 class="f2">Reading notes</h1>
</header>

<ul class="list pl0 w-50-ns mw6">
{% assign sorted_books = (site.books | sort: 'date') | reverse %}
{% for book in sorted_books %}
{% assign book_item_classes = 'b--black-20 pb2' %}
{% if forloop.last != true %}
{% assign book_item_classes = book_item_classes | append: ' bw1 bb' %}
{% endif %}
<li class="{{ book_item_classes }}">
<h2 class="f4 mb0 lh-title"><a class="link dim light-purple" href="{{ book.url }}">{{ book.title }}</a></h2>
<p class="f6 black-70 mt2">by {{ book.author }}</p>
</li>
{% endfor %}
</ul>

0 comments on commit 610b678

Please sign in to comment.