feat: initial commit
This commit is contained in:
commit
e214116e40
253 changed files with 17406 additions and 0 deletions
55
src/pages/media/books/index.html
Normal file
55
src/pages/media/books/index.html
Normal file
|
@ -0,0 +1,55 @@
|
|||
---
|
||||
title: Books
|
||||
description: Here's what I'm reading at the moment.
|
||||
permalink: "/books/index.html"
|
||||
schema: books
|
||||
updated: "now"
|
||||
---
|
||||
{%- assign currentYear = 'now' | date: "%Y" -%}
|
||||
{%- assign bookData = books.all | filterBooksByStatus: 'started' | reverse -%}
|
||||
{%- assign currentBookCount = books.currentYear | size -%}
|
||||
<h2 class="page-title">Currently reading</h2>
|
||||
<p>Here's what I'm reading at the moment. I've finished <mark>{{ currentBookCount }} books</mark> this year. I've read <mark>{{ books.daysRead }}</mark> days in a row and counting.</p>
|
||||
<p class="book-years">{{ books.years | bookYearLinks }}</p>
|
||||
{% render "blocks/banners/rss.liquid",
|
||||
url: "/feeds/books.xml",
|
||||
text: "Subscribe to my books feed or follow along on this page"
|
||||
%}
|
||||
<hr />
|
||||
{% for book in bookData %}
|
||||
{% capture alt %}{{ book.title }} by {{ book.authors }}{% endcapture %}
|
||||
<article class="book-entry">
|
||||
<a href="{{ book.url }}">
|
||||
<img
|
||||
srcset="
|
||||
{{ globals.cdn_url }}{{ book.image }}?class=verticalsm&type=webp 200w,
|
||||
{{ globals.cdn_url }}{{ book.image }}?class=verticalmd&type=webp 400w
|
||||
"
|
||||
sizes="(max-width: 450px) 200px,
|
||||
400px"
|
||||
src="{{ globals.cdn_url }}{{ book.image }}?class=verticalsm&type=webp"
|
||||
alt="{{ alt | replaceQuotes }}"
|
||||
loading="lazy"
|
||||
decoding="async"
|
||||
width="200"
|
||||
height="307"
|
||||
/>
|
||||
</a>
|
||||
<div class="media-meta">
|
||||
<a href="{{ book.url }}">
|
||||
<h2>{{ book.title }}</h2>
|
||||
</a>
|
||||
{% if book.author %}
|
||||
<span class="sub-meta">By {{ book.author }}</span>
|
||||
{% endif %}
|
||||
{% if book.progress %}
|
||||
{% render "media/progress-bar.liquid",
|
||||
percentage:book.progress
|
||||
%}
|
||||
{% endif %}
|
||||
{% if book.description %}
|
||||
<div class="description">{{ book.description | normalize_whitespace | markdown | htmlTruncate }}</div>
|
||||
{% endif %}
|
||||
</div>
|
||||
</article>
|
||||
{% endfor %}
|
29
src/pages/media/books/year.html
Normal file
29
src/pages/media/books/year.html
Normal file
|
@ -0,0 +1,29 @@
|
|||
---
|
||||
pagination:
|
||||
data: books.years
|
||||
size: 1
|
||||
alias: year
|
||||
permalink: "/books/years/{{ year.value }}/index.html"
|
||||
schema: books-year
|
||||
---
|
||||
{%- assign bookData = year.data | filterBooksByStatus: 'finished' -%}
|
||||
{%- assign bookDataFavorites = bookData | findFavoriteBooks -%}
|
||||
{%- capture favoriteBooks -%}{{ bookDataFavorites | shuffleArray | mediaLinks: "book", 5 }}{%- endcapture -%}
|
||||
{%- assign currentYear = 'now' | date: "%Y" -%}
|
||||
{%- assign yearString = year.value | append: '' -%}
|
||||
{%- assign currentYearString = currentYear | append: '' -%}
|
||||
<a href="/books" class="back-link">{% tablericon "arrow-left" %} Back to books</a>
|
||||
<h2 class="page-title">{{ year.value }} • Books</h2>
|
||||
{% if yearString == currentYearString %}
|
||||
<p>I've finished <mark>{{ bookData.size }} book{% unless bookData.size == 1 %}s{% endunless %}</mark> this year.{%- if favoriteBooks %} Among my favorites are {{ favoriteBooks }}.{%- endif -%}</p>
|
||||
{% else %}
|
||||
<p>I finished <mark>{{ bookData.size }} book{% unless bookData.size == 1 %}s{% endunless %}</mark> in <mark>{{ year.value }}</mark>.{%- if favoriteBooks %} Among my favorites were {{ favoriteBooks }}.{%- endif -%}</p>
|
||||
{% endif %}
|
||||
<hr />
|
||||
{% render "media/grid.liquid",
|
||||
globals:globals,
|
||||
data:bookData,
|
||||
shape:"vertical",
|
||||
count:200,
|
||||
loading:"eager"
|
||||
%}
|
Loading…
Add table
Add a link
Reference in a new issue