feat(reading): clean and refactor routing for books -> reading to separate paths
This commit is contained in:
parent
8d9455940e
commit
2666d6ed67
21 changed files with 51 additions and 89 deletions
|
@ -1,7 +1,7 @@
|
|||
---
|
||||
title: Books
|
||||
description: Here's what I'm reading at the moment.
|
||||
permalink: "/books/index.html"
|
||||
permalink: "/reading/index.html"
|
||||
schema: books
|
||||
updated: "now"
|
||||
---
|
||||
|
|
|
@ -3,8 +3,8 @@ pagination:
|
|||
data: books.years
|
||||
size: 1
|
||||
alias: year
|
||||
permalink: "/books/years/{{ year.value }}/index.html"
|
||||
schema: books-year
|
||||
permalink: "/reading/years/{{ year.value }}/index.html"
|
||||
schema: reading-year
|
||||
---
|
||||
{%- assign bookData = year.data | filterBooksByStatus: 'finished' -%}
|
||||
{%- assign bookDataFavorites = bookData | findFavoriteBooks -%}
|
||||
|
@ -12,7 +12,7 @@ schema: books-year
|
|||
{%- 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>
|
||||
<a href="/reading" class="back-link">{% tablericon "arrow-left" %} Back to reading</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>
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue