chore: more context on dates

This commit is contained in:
Cory Dransfeldt 2024-05-03 16:36:15 -07:00
parent e3e24f2499
commit f034ae2584
No known key found for this signature in database
3 changed files with 11 additions and 2 deletions

View file

@ -1,10 +1,17 @@
---
layout: default
---
{% assign bookData = books | bookStatus: 'finished' | bookFinishedYear: year %}
{%- assign bookData = books | bookStatus: 'finished' | bookFinishedYear: year -%}
{%- capture currentYear -%}{% currentYear %}{%- endcapture -%}
{%- assign yearString = year | append: '' -%}
{%- assign currentYearString = currentYear | append: '' -%}
<p><a class="link-arrow flex-centered" href="/books">{% tablericon "arrow-left" "Go back" %} Go back</a></p>
<h2 class="page-header">{{ title }}</h2>
{{ content }}
{% if yearString == currentYearString %}
<p>I've finished <strong class="highlight-text">{{ bookData.size }} books</strong> this year.</p>
{% else %}
<p>I finished <strong class="highlight-text">{{ bookData.size }} books</strong> in {{ year }}</p>
{% endif %}
<hr class="large-spacing" />
{% render "partials/now/media-grid.liquid", data:bookData, shape: "vertical", count: 200, loading: "eager" %}