diff --git a/config/collections/index.js b/config/collections/index.js index dc7de456..6c820d6a 100644 --- a/config/collections/index.js +++ b/config/collections/index.js @@ -45,12 +45,11 @@ export const followContent = (collection) => { if (!parsedDate.isValid) parsedDate = DateTime.fromFormat(date, 'dd-MM-yyyy') return parsedDate.isValid ? parsedDate.toISO() : null } - const addContent = (items, icon, getTitle, getDate) => { if (items) { items.forEach(item => { const content = { - url: item.url.includes('http') ? item.url : `https://coryd.dev${item.url}`, + url: item.url?.includes('http') ? item.url : `https://coryd.dev${item.url}`, title: `${icon}: ${getTitle(item)}` } if (item.data?.link) content.url = item.data?.link @@ -63,8 +62,8 @@ export const followContent = (collection) => { addContent(posts, '📝', item => item.data.title, item => item.data.date) addContent(links, '🔗', item => item.data.title, item => item.data.date) - addContent(books.filter(book => book.status === 'started'), '📖', item => item.title, item => item.date) - addContent(movies, '🎥', item => item.title, item => item.lastWatched) + addContent(books.filter(book => book.status === 'finished'), '📖', item => item.title, item => item.date) + addContent(movies, '🎥', item => `${item.title}${item.rating ? ' (' + item.rating + ')' : ''}`, item => item.lastWatched) addContent(weeklyArtistChart, '🎧', item => item.title, item => item.date) return aggregateContent.sort((a, b) => { diff --git a/config/filters/index.js b/config/filters/index.js index 9242f9bc..8a9797b3 100644 --- a/config/filters/index.js +++ b/config/filters/index.js @@ -174,6 +174,7 @@ export default { content: entry?.description || entry?.data?.description, date, excerpt, + rating: entry?.rating || '' }) }) return posts @@ -197,7 +198,12 @@ export default { normalized['alt'] = `${item['plays']} plays of ${item['title']}` normalized['subtext'] = `${item['plays']} plays` } - if (item.type === 'movie') normalized['alt'] = item['title'] + if (item.type === 'movie') { + normalized['title'] = `${item['title']} (${item['year']})` + normalized['alt'] = item['title'] + normalized['rating'] = item['rating'] + normalized['subtext'] = item['rating'] + } if (item.type === 'book') { normalized['alt'] = `${item['title']} by ${item['authors']}` normalized['subtext'] = `${item['percentage']} finished` @@ -217,14 +223,15 @@ export default { }), calculatePlayPercentage: (plays, mostPlayed) => `${plays/mostPlayed * 100}%`, bookStatus: (books, status) => books.filter(book => book.status === status), - bookFinishedYear: (books, year) => books.filter(book => { - if (book.status === 'finished' && book.date) return parseInt(book.date.split('-')[0]) === year - return '' - }).sort((a, b) => { + bookSortDescending: (books) => books.sort((a, b) => { const dateA = DateTime.fromISO(a.date) const dateB = DateTime.fromISO(b.date) return dateB - dateA }), + bookFinishedYear: (books, year) => books.filter(book => { + if (book.status === 'finished' && book.date) return parseInt(book.date.split('-')[0]) === year + return '' + }), currentBookCount: (books) => { const year = DateTime.now().year return books.filter(book => { diff --git a/package-lock.json b/package-lock.json index ae5daa86..eab81c65 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "coryd.dev", - "version": "15.3.0", + "version": "15.4.0", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "coryd.dev", - "version": "15.3.0", + "version": "15.4.0", "license": "MIT", "dependencies": { "@cdransf/api-text": "^1.2.2", @@ -4296,9 +4296,9 @@ "dev": true }, "node_modules/lightningcss": { - "version": "1.24.1", - "resolved": "https://registry.npmjs.org/lightningcss/-/lightningcss-1.24.1.tgz", - "integrity": "sha512-kUpHOLiH5GB0ERSv4pxqlL0RYKnOXtgGtVe7shDGfhS0AZ4D1ouKFYAcLcZhql8aMspDNzaUCumGHZ78tb2fTg==", + "version": "1.25.0", + "resolved": "https://registry.npmjs.org/lightningcss/-/lightningcss-1.25.0.tgz", + "integrity": "sha512-B08o6QQikGaY4rPuQohtFVE+X2++mm/QemwAJ/1sgnMgTwwUnafJbTmSSBWC8Tv4JPfhelXZB6sWA0Y/6eYJmQ==", "dev": true, "dependencies": { "detect-libc": "^1.0.3" @@ -4311,21 +4311,21 @@ "url": "https://opencollective.com/parcel" }, "optionalDependencies": { - "lightningcss-darwin-arm64": "1.24.1", - "lightningcss-darwin-x64": "1.24.1", - "lightningcss-freebsd-x64": "1.24.1", - "lightningcss-linux-arm-gnueabihf": "1.24.1", - "lightningcss-linux-arm64-gnu": "1.24.1", - "lightningcss-linux-arm64-musl": "1.24.1", - "lightningcss-linux-x64-gnu": "1.24.1", - "lightningcss-linux-x64-musl": "1.24.1", - "lightningcss-win32-x64-msvc": "1.24.1" + "lightningcss-darwin-arm64": "1.25.0", + "lightningcss-darwin-x64": "1.25.0", + "lightningcss-freebsd-x64": "1.25.0", + "lightningcss-linux-arm-gnueabihf": "1.25.0", + "lightningcss-linux-arm64-gnu": "1.25.0", + "lightningcss-linux-arm64-musl": "1.25.0", + "lightningcss-linux-x64-gnu": "1.25.0", + "lightningcss-linux-x64-musl": "1.25.0", + "lightningcss-win32-x64-msvc": "1.25.0" } }, "node_modules/lightningcss-darwin-arm64": { - "version": "1.24.1", - "resolved": "https://registry.npmjs.org/lightningcss-darwin-arm64/-/lightningcss-darwin-arm64-1.24.1.tgz", - "integrity": "sha512-1jQ12jBy+AE/73uGQWGSafK5GoWgmSiIQOGhSEXiFJSZxzV+OXIx+a9h2EYHxdJfX864M+2TAxWPWb0Vv+8y4w==", + "version": "1.25.0", + "resolved": "https://registry.npmjs.org/lightningcss-darwin-arm64/-/lightningcss-darwin-arm64-1.25.0.tgz", + "integrity": "sha512-neCU5PrQUAec/b2mpXv13rrBWObQVaG/y0yhGKzAqN9cj7lOv13Wegnpiro0M66XAxx/cIkZfmJstRfriOR2SQ==", "cpu": [ "arm64" ], @@ -4343,9 +4343,9 @@ } }, "node_modules/lightningcss-darwin-x64": { - "version": "1.24.1", - "resolved": "https://registry.npmjs.org/lightningcss-darwin-x64/-/lightningcss-darwin-x64-1.24.1.tgz", - "integrity": "sha512-R4R1d7VVdq2mG4igMU+Di8GPf0b64ZLnYVkubYnGG0Qxq1KaXQtAzcLI43EkpnoWvB/kUg8JKCWH4S13NfiLcQ==", + "version": "1.25.0", + "resolved": "https://registry.npmjs.org/lightningcss-darwin-x64/-/lightningcss-darwin-x64-1.25.0.tgz", + "integrity": "sha512-h1XBxDHdED7TY4/1V30UNjiqXceGbcL8ARhUfbf8CWAEhD7wMKK/4UqMHi94RDl31ko4LTmt9fS2u1uyeWYE6g==", "cpu": [ "x64" ], @@ -4363,9 +4363,9 @@ } }, "node_modules/lightningcss-freebsd-x64": { - "version": "1.24.1", - "resolved": "https://registry.npmjs.org/lightningcss-freebsd-x64/-/lightningcss-freebsd-x64-1.24.1.tgz", - "integrity": "sha512-z6NberUUw5ALES6Ixn2shmjRRrM1cmEn1ZQPiM5IrZ6xHHL5a1lPin9pRv+w6eWfcrEo+qGG6R9XfJrpuY3e4g==", + "version": "1.25.0", + "resolved": "https://registry.npmjs.org/lightningcss-freebsd-x64/-/lightningcss-freebsd-x64-1.25.0.tgz", + "integrity": "sha512-f7v6QwrqCFtQOG1Y7iZ4P1/EAmMsyUyRBrYbSmDxihMzdsL7xyTM753H2138/oCpam+maw2RZrXe/NA1r/I5cQ==", "cpu": [ "x64" ], @@ -4383,9 +4383,9 @@ } }, "node_modules/lightningcss-linux-arm-gnueabihf": { - "version": "1.24.1", - "resolved": "https://registry.npmjs.org/lightningcss-linux-arm-gnueabihf/-/lightningcss-linux-arm-gnueabihf-1.24.1.tgz", - "integrity": "sha512-NLQLnBQW/0sSg74qLNI8F8QKQXkNg4/ukSTa+XhtkO7v3BnK19TS1MfCbDHt+TTdSgNEBv0tubRuapcKho2EWw==", + "version": "1.25.0", + "resolved": "https://registry.npmjs.org/lightningcss-linux-arm-gnueabihf/-/lightningcss-linux-arm-gnueabihf-1.25.0.tgz", + "integrity": "sha512-7KSVcjci9apHxUKNjiLKXn8hVQJqCtwFg5YNvTeKi/BM91A9lQTuO57RpmpPbRIb20Qm8vR7fZtL1iL5Yo3j9A==", "cpu": [ "arm" ], @@ -4403,9 +4403,9 @@ } }, "node_modules/lightningcss-linux-arm64-gnu": { - "version": "1.24.1", - "resolved": "https://registry.npmjs.org/lightningcss-linux-arm64-gnu/-/lightningcss-linux-arm64-gnu-1.24.1.tgz", - "integrity": "sha512-AQxWU8c9E9JAjAi4Qw9CvX2tDIPjgzCTrZCSXKELfs4mCwzxRkHh2RCxX8sFK19RyJoJAjA/Kw8+LMNRHS5qEg==", + "version": "1.25.0", + "resolved": "https://registry.npmjs.org/lightningcss-linux-arm64-gnu/-/lightningcss-linux-arm64-gnu-1.25.0.tgz", + "integrity": "sha512-1+6tuAsUyMVG5N2rzgwaOOf84yEU+Gjl71b+wLcz26lyM/ohgFgeqPWeB/Dor0wyUnq7vg184l8goGT26cRxoQ==", "cpu": [ "arm64" ], @@ -4423,9 +4423,9 @@ } }, "node_modules/lightningcss-linux-arm64-musl": { - "version": "1.24.1", - "resolved": "https://registry.npmjs.org/lightningcss-linux-arm64-musl/-/lightningcss-linux-arm64-musl-1.24.1.tgz", - "integrity": "sha512-JCgH/SrNrhqsguUA0uJUM1PvN5+dVuzPIlXcoWDHSv2OU/BWlj2dUYr3XNzEw748SmNZPfl2NjQrAdzaPOn1lA==", + "version": "1.25.0", + "resolved": "https://registry.npmjs.org/lightningcss-linux-arm64-musl/-/lightningcss-linux-arm64-musl-1.25.0.tgz", + "integrity": "sha512-4kw3ZnGQzxD8KkaB4doqfi32hP5h3o04OlrdfZ7T9VLTbUxeh3YZUKcJmhINV2rdMOOmVODqaRw1kuvvF16Q+Q==", "cpu": [ "arm64" ], @@ -4443,9 +4443,9 @@ } }, "node_modules/lightningcss-linux-x64-gnu": { - "version": "1.24.1", - "resolved": "https://registry.npmjs.org/lightningcss-linux-x64-gnu/-/lightningcss-linux-x64-gnu-1.24.1.tgz", - "integrity": "sha512-TYdEsC63bHV0h47aNRGN3RiK7aIeco3/keN4NkoSQ5T8xk09KHuBdySltWAvKLgT8JvR+ayzq8ZHnL1wKWY0rw==", + "version": "1.25.0", + "resolved": "https://registry.npmjs.org/lightningcss-linux-x64-gnu/-/lightningcss-linux-x64-gnu-1.25.0.tgz", + "integrity": "sha512-oVEP5rBrFQB5V7fRIPYkDxKLmd2fAbz9VagKWIRu1TlYDUFWXK4F3KztAtAKuD7tLMBSGGi1LMUueFzVe+cZbw==", "cpu": [ "x64" ], @@ -4463,9 +4463,9 @@ } }, "node_modules/lightningcss-linux-x64-musl": { - "version": "1.24.1", - "resolved": "https://registry.npmjs.org/lightningcss-linux-x64-musl/-/lightningcss-linux-x64-musl-1.24.1.tgz", - "integrity": "sha512-HLfzVik3RToot6pQ2Rgc3JhfZkGi01hFetHt40HrUMoeKitLoqUUT5owM6yTZPTytTUW9ukLBJ1pc3XNMSvlLw==", + "version": "1.25.0", + "resolved": "https://registry.npmjs.org/lightningcss-linux-x64-musl/-/lightningcss-linux-x64-musl-1.25.0.tgz", + "integrity": "sha512-7ssY6HwCvmPDohqtXuZG2Mh9q32LbVBhiF/SS/VMj2jUcXcsBilUEviq/zFDzhZMxl5f1lXi5/+mCuSGrMir1A==", "cpu": [ "x64" ], @@ -4483,9 +4483,9 @@ } }, "node_modules/lightningcss-win32-x64-msvc": { - "version": "1.24.1", - "resolved": "https://registry.npmjs.org/lightningcss-win32-x64-msvc/-/lightningcss-win32-x64-msvc-1.24.1.tgz", - "integrity": "sha512-joEupPjYJ7PjZtDsS5lzALtlAudAbgIBMGJPNeFe5HfdmJXFd13ECmEM+5rXNxYVMRHua2w8132R6ab5Z6K9Ow==", + "version": "1.25.0", + "resolved": "https://registry.npmjs.org/lightningcss-win32-x64-msvc/-/lightningcss-win32-x64-msvc-1.25.0.tgz", + "integrity": "sha512-DUVxj1S6dCQkixQ5qiHcYojamxE02bgmSpc4p6lejPwW7WRd/pvDPDAr+BvZWAkX5MRphxB7ei6+93+42ZtvmQ==", "cpu": [ "x64" ], diff --git a/package.json b/package.json index 8a353c7c..7e291376 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "coryd.dev", - "version": "15.3.0", + "version": "15.4.0", "description": "The source for my personal site. Built using 11ty.", "type": "module", "scripts": { diff --git a/src/_data/books.js b/src/_data/books.js index 0fae9471..6b00263c 100644 --- a/src/_data/books.js +++ b/src/_data/books.js @@ -22,6 +22,7 @@ export default async function () { status: book['status'], tags: book['tags'], categories: book['categories']?.length > 1 ? book['categories'].join(', ') : book['categories']?.[0], + rating: book['rating'] !== 'unrated' ? book['rating'] : '', type: 'book', } }) diff --git a/src/_data/json/read.json b/src/_data/json/read.json index e587c820..3a7cf5ef 100644 --- a/src/_data/json/read.json +++ b/src/_data/json/read.json @@ -10308,7 +10308,7 @@ "isbn": "9781501182891", "dateAdded": "2024-05-03", "status": "finished", - "rating": "unrated", + "rating": "⭐️⭐️⭐️⭐️", "tags": [ "\"politics\"", "\"economics\"", diff --git a/src/_data/movies.js b/src/_data/movies.js index afe4a88e..af07c44d 100644 --- a/src/_data/movies.js +++ b/src/_data/movies.js @@ -22,7 +22,8 @@ const fetchAllMovies = async () => { year, collected, plays, - favorite + favorite, + rating `) .order('last_watched', { ascending: false }) .range(rangeStart, rangeStart + PAGE_SIZE - 1) @@ -51,12 +52,13 @@ export default async function () { year: item['year'], url: `https://www.themoviedb.org/movie/${item['tmdb_id']}`, description: `

${item['title']} (${item['year']})

Watched at: ${DateTime.fromISO(item['last_watched'], { zone: 'utc' }).setZone('America/Los_Angeles').toFormat('MMMM d, yyyy, h:mma')}

`, - type: 'movie', image: `https://coryd.dev/media/movies/poster-${item['tmdb_id']}.jpg`, backdrop: `https://coryd.dev/media/movies/backdrops/backdrop-${item['tmdb_id']}.jpg`, plays: item['plays'], collected: item['collected'], favorite: item['favorite'], + rating: item['rating'], + type: 'movie' } return movie }).filter(movie => watched ? movie['lastWatched'] : !movie['lastWatched']) diff --git a/src/_includes/book-year.liquid b/src/_includes/book-year.liquid index 62350f46..3c734229 100644 --- a/src/_includes/book-year.liquid +++ b/src/_includes/book-year.liquid @@ -1,7 +1,7 @@ --- layout: default --- -{%- assign bookData = books | bookStatus: 'finished' | bookFinishedYear: year -%} +{%- assign bookData = books | bookStatus: 'finished' | bookFinishedYear: year | bookSortDescending -%} {%- capture currentYear -%}{% currentYear %}{%- endcapture -%} {%- assign yearString = year | append: '' -%} {%- assign currentYearString = currentYear | append: '' -%} diff --git a/src/_includes/partials/feeds/rss.liquid b/src/_includes/partials/feeds/rss.liquid index 0c803c82..8958657b 100644 --- a/src/_includes/partials/feeds/rss.liquid +++ b/src/_includes/partials/feeds/rss.liquid @@ -16,8 +16,13 @@ {% for entry in entries limit: 20 -%} {% assign author = entry.url | stripUtm | authorLookup %} + {% assign rating = entry.rating %} - {{ entry.title | escape }}{% if author %} via {{ author }}{% endif %} + + {{ entry.title | escape }} + {% if author %} via {{ author }}{% endif %} + {% if rating %} ({{ rating }}){% endif %} + {{ entry.url | stripUtm | encodeAmp }} {{ entry.date | stringToRFC822Date }} {{ entry.url | stripUtm | encodeAmp }} diff --git a/src/_includes/partials/now/media-grid.liquid b/src/_includes/partials/now/media-grid.liquid index 75c76338..fc1e9d41 100644 --- a/src/_includes/partials/now/media-grid.liquid +++ b/src/_includes/partials/now/media-grid.liquid @@ -3,7 +3,7 @@
{% for item in media limit: count %} {% assign alt = item.alt | strip | escape %} - {% assign hasMeta = item.type != 'book' and item.type != 'movie' %} + {% assign hasMeta = item.type != 'book' %}
{% if hasMeta %} diff --git a/src/_includes/partials/watching/hero.liquid b/src/_includes/partials/watching/hero.liquid index b3482fb2..a338435f 100644 --- a/src/_includes/partials/watching/hero.liquid +++ b/src/_includes/partials/watching/hero.liquid @@ -1,7 +1,10 @@ {% capture alt %}{{ movie.title | escape }} ({{ movie.year }}){% endcapture %}
- {{ movie.title }} ({{ movie.year }}) +
+
{{ movie.title }} ({{ movie.year }})
+
Last watched @ {{ movie.dateAdded | date: "%B %e, %Y" }}
+
{{ alt }}
\ No newline at end of file diff --git a/src/assets/styles/pages/watching.css b/src/assets/styles/pages/watching.css index 1733dd47..66f8990f 100644 --- a/src/assets/styles/pages/watching.css +++ b/src/assets/styles/pages/watching.css @@ -7,13 +7,28 @@ position: relative; overflow: hidden; - span { - color: white; - font-weight: var(--font-weight-bold); - position: absolute; - left: var(--sizing-sm); - bottom: var(--sizing-md); - z-index: 2; + div { + &.meta-text{ + color: white; + position: absolute; + left: var(--sizing-sm); + bottom: var(--sizing-lg); + z-index: 2; + + & .header { + font-weight: var(--font-weight-bold); + } + + & .subheader { + font-size: var(--font-size-sm); + } + + & .header, + & .subheader { + line-height: 1.5; + text-shadow: rgba(0, 0, 0, 0.7) 0px 0px 10px; + } + } } & img { diff --git a/src/feeds/books.liquid b/src/feeds/books.liquid index 08612498..cd77ca7a 100644 --- a/src/feeds/books.liquid +++ b/src/feeds/books.liquid @@ -3,7 +3,7 @@ layout: null eleventyExcludeFromCollections: true permalink: /feeds/books --- -{%- assign bookData = books | bookStatus: 'started' | reverse -%} +{%- assign bookData = books | bookStatus: 'finished' | bookSortDescending -%} {% render "partials/feeds/rss.liquid" permalink:"/feeds/books" title:"Books • Cory Dransfeldt"