diff --git a/package-lock.json b/package-lock.json index a7faabfa..e19a18a4 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "coryd.dev", - "version": "22.5.3", + "version": "22.6.0", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "coryd.dev", - "version": "22.5.3", + "version": "22.6.0", "license": "MIT", "dependencies": { "@cdransf/api-text": "^1.5.0", @@ -20,10 +20,10 @@ "@11ty/eleventy-plugin-syntaxhighlight": "^5.0.0", "@11tyrocks/eleventy-plugin-lightningcss": "^1.4.0", "@cdransf/eleventy-plugin-tabler-icons": "^1.11.0", - "@supabase/supabase-js": "^2.45.1", + "@supabase/supabase-js": "^2.45.2", "dotenv-flow": "^4.1.0", "ics": "^3.7.6", - "liquidjs": "^10.16.3", + "liquidjs": "^10.16.4", "luxon": "^3.5.0", "markdown-it": "^14.1.0", "markdown-it-anchor": "^9.0.1", @@ -443,9 +443,9 @@ } }, "node_modules/@supabase/storage-js": { - "version": "2.6.0", - "resolved": "https://registry.npmjs.org/@supabase/storage-js/-/storage-js-2.6.0.tgz", - "integrity": "sha512-REAxr7myf+3utMkI2oOmZ6sdplMZZ71/2NEIEMBZHL9Fkmm3/JnaOZVSRqvG4LStYj2v5WhCruCzuMn6oD/Drw==", + "version": "2.7.0", + "resolved": "https://registry.npmjs.org/@supabase/storage-js/-/storage-js-2.7.0.tgz", + "integrity": "sha512-iZenEdO6Mx9iTR6T7wC7sk6KKsoDPLq8rdu5VRy7+JiT1i8fnqfcOr6mfF2Eaqky9VQzhP8zZKQYjzozB65Rig==", "dev": true, "license": "MIT", "dependencies": { @@ -453,9 +453,9 @@ } }, "node_modules/@supabase/supabase-js": { - "version": "2.45.1", - "resolved": "https://registry.npmjs.org/@supabase/supabase-js/-/supabase-js-2.45.1.tgz", - "integrity": "sha512-/PVe3lXmalazD8BGMIoI7+ttvT1mLXy13lNcoAPtjP1TDDY83g8csZbVR6l+0/RZtvJxl3LGXfTJT4bjWgC5Nw==", + "version": "2.45.2", + "resolved": "https://registry.npmjs.org/@supabase/supabase-js/-/supabase-js-2.45.2.tgz", + "integrity": "sha512-kJKY3ISFusVKQWCP8Kqo20Ebxy2WLp6Ry/Suco0aQsPXH7bvn7clswsdhcfcH/5Tr0MYz/jcCjF0n/27SetiCw==", "dev": true, "license": "MIT", "dependencies": { @@ -464,7 +464,7 @@ "@supabase/node-fetch": "2.6.15", "@supabase/postgrest-js": "1.15.8", "@supabase/realtime-js": "2.10.2", - "@supabase/storage-js": "2.6.0" + "@supabase/storage-js": "2.7.0" } }, "node_modules/@types/linkify-it": { @@ -2153,9 +2153,9 @@ } }, "node_modules/liquidjs": { - "version": "10.16.3", - "resolved": "https://registry.npmjs.org/liquidjs/-/liquidjs-10.16.3.tgz", - "integrity": "sha512-CbIeSH5zc7nVPFgexN1EQlAxAk2DAQDvIN8r40PHs/HxubhQyEoZS/CgKpd9ax9walAUqk+VpkSR1CfoFr4Nhw==", + "version": "10.16.4", + "resolved": "https://registry.npmjs.org/liquidjs/-/liquidjs-10.16.4.tgz", + "integrity": "sha512-5kK5HRZng6crSedS11D1h9Od8pYB5wjWjvJIlbhLVS7n+ITWzQervv27jx+7MkOS2KYfAEhwlEinTsTn4Ae5WQ==", "dev": true, "license": "MIT", "dependencies": { @@ -2267,9 +2267,9 @@ } }, "node_modules/micromatch": { - "version": "4.0.7", - "resolved": "https://registry.npmjs.org/micromatch/-/micromatch-4.0.7.tgz", - "integrity": "sha512-LPP/3KorzCwBxfeUuZmaR6bG2kdeHSbe0P2tY3FLRU4vYrjYz5hI4QZwV0njUx3jeuKe67YukQ1LSPZBKDqO/Q==", + "version": "4.0.8", + "resolved": "https://registry.npmjs.org/micromatch/-/micromatch-4.0.8.tgz", + "integrity": "sha512-PXwfBhYu0hBCPw8Dn0E+WDYb7af3dSLVWKi3HGv84IdF4TyFoC0ysxFd0Goxw7nSv4T/PzEJQxsYsEiFCKo2BA==", "dev": true, "license": "MIT", "dependencies": { diff --git a/package.json b/package.json index 281ea8a3..eb033bac 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "coryd.dev", - "version": "22.5.3", + "version": "22.6.0", "description": "The source for my personal site. Built using 11ty (and other tools).", "type": "module", "scripts": { @@ -35,10 +35,10 @@ "@11ty/eleventy-plugin-syntaxhighlight": "^5.0.0", "@11tyrocks/eleventy-plugin-lightningcss": "^1.4.0", "@cdransf/eleventy-plugin-tabler-icons": "^1.11.0", - "@supabase/supabase-js": "^2.45.1", + "@supabase/supabase-js": "^2.45.2", "dotenv-flow": "^4.1.0", "ics": "^3.7.6", - "liquidjs": "^10.16.3", + "liquidjs": "^10.16.4", "luxon": "^3.5.0", "markdown-it": "^14.1.0", "markdown-it-anchor": "^9.0.1", diff --git a/src/assets/styles/components/buttons.css b/src/assets/styles/components/buttons.css index 66170d9f..cb49bd2d 100644 --- a/src/assets/styles/components/buttons.css +++ b/src/assets/styles/components/buttons.css @@ -6,6 +6,10 @@ button, appearance: none; border: none; + & + hr { + margin-top: 0; + } + &:not(.theme-toggle) { border: 2px solid var(--accent-color); padding: var(--sizing-xs) var(--sizing-md); diff --git a/src/assets/styles/pages/books.css b/src/assets/styles/pages/books.css index 9f8b7c34..f6d18577 100644 --- a/src/assets/styles/pages/books.css +++ b/src/assets/styles/pages/books.css @@ -112,6 +112,15 @@ p { margin: var(--sizing-base) 0; + + &.music { + color: var(--music); + + & svg { + stroke: var(--music); + margin-right: var(--sizing-xs); + } + } } } diff --git a/src/assets/styles/pages/music.css b/src/assets/styles/pages/music.css index 5d2e7fac..96c720e2 100644 --- a/src/assets/styles/pages/music.css +++ b/src/assets/styles/pages/music.css @@ -26,6 +26,15 @@ } } + & p.books { + color: var(--books); + + & svg { + stroke: var(--books); + margin-right: var(--sizing-xs); + } + } + & .artist-display { display: flex; flex-direction: column; diff --git a/src/data/artists.js b/src/data/artists.js index 3f393030..5edbad11 100644 --- a/src/data/artists.js +++ b/src/data/artists.js @@ -27,7 +27,8 @@ const fetchAllArtists = async () => { tattoo, art, albums, - concerts + concerts, + books `) .range(rangeStart, rangeStart + PAGE_SIZE - 1) @@ -66,7 +67,14 @@ const processArtists = (artists) => { totalPlays: album['total_plays'], art: album.art ? `/${album['art']}` : '' })).sort((a, b) => a['release_year'] - b['release_year']), - concerts: artist['concerts']?.[0]?.id ? artist['concerts'].sort((a, b) => new Date(b['date']) - new Date(a['date'])) : null + concerts: artist['concerts']?.[0]?.id ? artist['concerts'].sort((a, b) => new Date(b['date']) - new Date(a['date'])) : null, + books: artist['books']?.[0]?.id ? artist['books'].map(book => ({ + title: book['title'], + author: book['author'], + isbn: book['isbn'], + description: book['description'], + url: `/books/${book['isbn']}`, + })).sort((a, b) => a['title'].localeCompare(b['title'])) : null })) } diff --git a/src/data/books.js b/src/data/books.js index 77d8c9eb..ad47f616 100644 --- a/src/data/books.js +++ b/src/data/books.js @@ -1,4 +1,5 @@ import { createClient } from '@supabase/supabase-js' +import { sanitizeMediaString, parseCountryField } from '../../config/utilities/index.js' const SUPABASE_URL = process.env.SUPABASE_URL const SUPABASE_KEY = process.env.SUPABASE_KEY @@ -25,7 +26,8 @@ const fetchAllBooks = async () => { review, art, favorite, - tags + tags, + artists `) .order('date_finished', { ascending: false }) .range(rangeStart, rangeStart + PAGE_SIZE - 1) @@ -47,6 +49,11 @@ const processBooks = (books) => { return books.map(book => { const dateFinished = new Date(book['date_finished']) const year = dateFinished.getUTCFullYear() + const artists = book?.['artists']?.map(artist => { + artist['url'] = `/music/artists/${sanitizeMediaString(artist['name'])}-${sanitizeMediaString(parseCountryField(artist['country']))}` + return artist + }).sort((a, b) => a['name'].localeCompare(b['name'])) + return { title: book['title'], author: book['author'] || '', @@ -59,9 +66,10 @@ const processBooks = (books) => { date: book['date_finished'], status: book['read_status'], progress: book['progress'], - tags: book['tags'] ? book['tags'].split(',') : [], + tags: Array.isArray(book['tags']) ? book['tags'] : book['tags']?.split(',') || [], // Ensure tags is an array isbn: book['isbn'], type: 'book', + artists, year, } }) diff --git a/src/pages/dynamic/books/book.html b/src/pages/dynamic/books/book.html index 97cee234..480b0181 100644 --- a/src/pages/dynamic/books/book.html +++ b/src/pages/dynamic/books/book.html @@ -54,6 +54,25 @@ schema: book {{ book.review | markdown }}
{% endif %} + {%- if book.artists -%} + {%- capture sectionTitle -%} + {% if book.artists.size > 1 %} + I listen to artists featured in this book! + {% else %} + I listen to the artist featured in this book! + {%- endif -%} + {%- endcapture -%} +

+ {% tablericon "headphones" "Music" %} + {{ sectionTitle }} +

+ +
+ {%- endif -%} {% if book.description %}

Overview

{{ book.description | markdown }} diff --git a/src/pages/dynamic/books/index.html b/src/pages/dynamic/books/index.html index 7d0d58d9..b25f77e1 100644 --- a/src/pages/dynamic/books/index.html +++ b/src/pages/dynamic/books/index.html @@ -11,7 +11,7 @@ schema: books

Currently reading

Here's what I'm reading at the moment. I've finished {{ currentBookCount }} books this year.

{{ books.years | bookYearLinks }}

-{% render "partials/blocks/banners/rss.liquid", url: "https://coryd.dev/feeds/books", text: "Subscribe to my books feed or follow along on this page" %} +{% render "partials/blocks/banners/rss.liquid", url: "/feeds/books", text: "Subscribe to my books feed or follow along on this page" %}
{% for book in bookData %} {% capture alt %}{{ book.title }} by {{ book.authors }}{% endcapture %} diff --git a/src/pages/dynamic/links.html b/src/pages/dynamic/links.html index e6604c27..4487e602 100644 --- a/src/pages/dynamic/links.html +++ b/src/pages/dynamic/links.html @@ -10,7 +10,7 @@ permalink: "/links/{% if pagination.pageNumber > 0 %}{{ pagination.pageNumber }} {% if pagination.pageNumber == 0 %}

Links

These are links I've liked or otherwise found interesting. They're all added manually, after having been read and, I suppose, properly considered.

-{% render "partials/blocks/banners/rss.liquid", url: "https://coryd.dev/feeds/links", text: "Subscribe to my links feed or follow along on this page" %} +{% render "partials/blocks/banners/rss.liquid", url: "/feeds/links", text: "Subscribe to my links feed or follow along on this page" %}
{% endif %}