--- layout: default pagination: data: books.years size: 1 alias: year permalink: "/books/years/{{ year.value }}.html" schema: books-year --- {%- assign bookData = year.data | bookStatus: 'finished' -%} {%- assign bookDataFavorites = bookData | bookFavorites -%} {%- capture favoriteBooks -%}{{ bookDataFavorites | shuffleArray | mediaLinks: "book", 5 }}{%- endcapture -%} {%- assign currentYear = 'now' | date: "%Y" -%} {%- assign yearString = year.value | append: '' -%} {%- assign currentYearString = currentYear | append: '' -%} {% tablericon "arrow-left" %} Back to books

{{ year.value }} / Books

{% if yearString == currentYearString %}

I've finished {{ bookData.size }} books this year.{%- if favoriteBooks %} Among my favorites are {{ favoriteBooks }}.{%- endif -%}

{% else %}

I finished {{ bookData.size }} books in {{ year.value }}.{%- if favoriteBooks %} Among my favorites were {{ favoriteBooks }}.{%- endif -%}

{% endif %}
{% render "partials/media/grid.liquid", data:bookData, shape:"vertical", count: 200, loading: "eager" %}