From 077c54d5fb528b39e165b5a2ecbc431c81f82bf8 Mon Sep 17 00:00:00 2001
From: Cory Dransfeldt
Date: Sat, 24 Aug 2024 22:37:36 -0700
Subject: [PATCH] feat: everything is related
---
config/filters/index.js | 36 +++++++---
package-lock.json | 12 ++--
package.json | 4 +-
src/assets/styles/base/index.css | 53 +++++++++++++++
src/assets/styles/components/text-toggle.css | 2 +-
src/assets/styles/pages/books.css | 25 ++-----
src/assets/styles/pages/music.css | 46 +------------
src/assets/styles/pages/watching.css | 25 ++-----
src/data/books.js | 15 ++++-
src/data/genres.js | 21 +++++-
src/data/movies.js | 14 +++-
src/data/tv.js | 19 +++++-
.../partials/blocks/associated-media.liquid | 65 +++++++++++++++++++
.../partials/blocks/badge-grid.liquid | 28 ++++----
src/includes/partials/feeds/json.liquid | 58 ++++++++---------
src/pages/dynamic/books/book.html | 56 ++++------------
src/pages/dynamic/music/artists/artist.html | 34 +---------
src/pages/dynamic/music/genre.html | 21 +++---
src/pages/dynamic/watching/movie.html | 49 ++++----------
src/pages/dynamic/watching/show.html | 16 +++--
20 files changed, 325 insertions(+), 274 deletions(-)
create mode 100644 src/includes/partials/blocks/associated-media.liquid
diff --git a/config/filters/index.js b/config/filters/index.js
index 9b6301bd..c4c021bc 100644
--- a/config/filters/index.js
+++ b/config/filters/index.js
@@ -243,11 +243,23 @@ export default {
sortByPlaysDescending: (data, key) => data.sort((a, b) => b[key] - a[key]),
genreStrings: (genres, key) => genres.map(genre => genre[key]),
mediaLinks: (data, type, count = 10) => {
+ if (!data || !type) return ''
+
const dataSlice = data.slice(0, count)
- let last;
if (dataSlice.length === 0) return null
- if (dataSlice.length === 1) return type === 'genre' ? dataSlice[0] : dataSlice[0]['artist_name']
+ if (dataSlice.length === 1) {
+ const item = dataSlice[0]
+ if (type === 'genre') {
+ return `${item} `
+ } else if (type === 'artist') {
+ return `${item['name_string']} `
+ } else if (type === 'book') {
+ return `${item['title']} `
+ } else if (type === 'movie') {
+ return `${item['title']} `
+ }
+ }
const allButLast = dataSlice.slice(0, -1).map(item => {
if (type === 'genre') {
@@ -256,17 +268,23 @@ export default {
return `${item['name_string']} `
} else if (type === 'book') {
return `${item['title']} `
+ } else if (type === 'movie') {
+ return `${item['title']} `
}
}).join(', ')
- if (type === 'genre') {
- last = `${dataSlice[dataSlice.length - 1]} `
- } else if (type === 'artist') {
- last = `${dataSlice[dataSlice.length - 1]['name_string']} `
- } else if (type === 'book') {
- last = `${dataSlice[dataSlice.length - 1]['title']} `
- }
+ let last
+ const lastItem = dataSlice[dataSlice.length - 1]
+ if (type === 'genre') {
+ last = `${lastItem} `
+ } else if (type === 'artist') {
+ last = `${lastItem['name_string']} `
+ } else if (type === 'book') {
+ last = `${lastItem['title']} `
+ } else if (type === 'movie') {
+ last = `${lastItem['title']} `
+ }
return `${allButLast} and ${last}`
},
formatVenue: (venue) => venue.split(',')[0].trim(),
diff --git a/package-lock.json b/package-lock.json
index cbbb8a57..d715d12c 100644
--- a/package-lock.json
+++ b/package-lock.json
@@ -1,12 +1,12 @@
{
"name": "coryd.dev",
- "version": "22.8.0",
+ "version": "23.0.0",
"lockfileVersion": 3,
"requires": true,
"packages": {
"": {
"name": "coryd.dev",
- "version": "22.8.0",
+ "version": "23.0.0",
"license": "MIT",
"dependencies": {
"@cdransf/api-text": "^1.5.0",
@@ -26,7 +26,7 @@
"liquidjs": "^10.16.4",
"luxon": "^3.5.0",
"markdown-it": "^14.1.0",
- "markdown-it-anchor": "^9.0.1",
+ "markdown-it-anchor": "^9.1.0",
"markdown-it-footnote": "^4.0.0",
"sanitize-html": "^2.13.0",
"slugify": "^1.6.6"
@@ -2216,9 +2216,9 @@
}
},
"node_modules/markdown-it-anchor": {
- "version": "9.0.1",
- "resolved": "https://registry.npmjs.org/markdown-it-anchor/-/markdown-it-anchor-9.0.1.tgz",
- "integrity": "sha512-cBt7aAzmkfX8X7FqAe8EBryiKmToXgMQEEMqkXzWCm0toDtfDYIGboKeTKd8cpNJArJtutrf+977wFJTsvNGmQ==",
+ "version": "9.1.0",
+ "resolved": "https://registry.npmjs.org/markdown-it-anchor/-/markdown-it-anchor-9.1.0.tgz",
+ "integrity": "sha512-a5WqArGkkLQZUEdC9cpkWvrdLJyS45r+28nE4jxiQynFLZ6VXdX4+hulCRzxmS+hi9+Dwfi5zTFIz3dY1YA6xQ==",
"dev": true,
"license": "Unlicense",
"peerDependencies": {
diff --git a/package.json b/package.json
index 370ed429..92279a2b 100644
--- a/package.json
+++ b/package.json
@@ -1,6 +1,6 @@
{
"name": "coryd.dev",
- "version": "22.8.0",
+ "version": "23.0.0",
"description": "The source for my personal site. Built using 11ty (and other tools).",
"type": "module",
"scripts": {
@@ -41,7 +41,7 @@
"liquidjs": "^10.16.4",
"luxon": "^3.5.0",
"markdown-it": "^14.1.0",
- "markdown-it-anchor": "^9.0.1",
+ "markdown-it-anchor": "^9.1.0",
"markdown-it-footnote": "^4.0.0",
"sanitize-html": "^2.13.0",
"slugify": "^1.6.6"
diff --git a/src/assets/styles/base/index.css b/src/assets/styles/base/index.css
index fadc3c5d..6e2db3ec 100644
--- a/src/assets/styles/base/index.css
+++ b/src/assets/styles/base/index.css
@@ -100,6 +100,59 @@ code {
&.search > svg { stroke: var(--search); }
}
+p.books {
+ color: var(--books);
+
+ & svg {
+ stroke: var(--books);
+ }
+}
+
+p.concerts {
+ color: var(--concerts);
+
+ & svg {
+ stroke: var(--concerts);
+ }
+}
+
+p.favorite {
+ color: var(--favorite);
+
+ & svg {
+ stroke: var(--favorite);
+ }
+}
+
+p.movies,
+p.tv {
+ color: var(--tv);
+
+ & svg {
+ stroke: var(--tv);
+ }
+}
+
+p.music {
+ color: var(--music);
+
+ & svg {
+ stroke: var(--music);
+ }
+}
+
+p.tattoo {
+ color: var(--tattoo);
+
+ & svg {
+ stroke: var(--tattoo);
+ }
+}
+
+p:not(.flex-centered):not(.banner p) > svg {
+ margin-bottom: var(--inline-margin-bottom);
+}
+
:is(h1, h2, h3, h4, h5, h6) svg {
stroke-width: var(--stroke-width-bold);
}
diff --git a/src/assets/styles/components/text-toggle.css b/src/assets/styles/components/text-toggle.css
index 35cbed17..55942ed4 100644
--- a/src/assets/styles/components/text-toggle.css
+++ b/src/assets/styles/components/text-toggle.css
@@ -3,7 +3,7 @@
position: relative;
height: 500px;
overflow: hidden;
- margin-bottom: var(--sizing-base);
+ margin: var(--sizing-base) 0;
& p:first-of-type {
margin-top: 0;
diff --git a/src/assets/styles/pages/books.css b/src/assets/styles/pages/books.css
index 2cbf2959..5175cde2 100644
--- a/src/assets/styles/pages/books.css
+++ b/src/assets/styles/pages/books.css
@@ -75,6 +75,11 @@
&.sub-meta {
font-size: var(--font-size-sm);
line-height: var(--line-height-sm);
+
+ & svg {
+ width: var(--sizing-svg-sm);
+ height: var(--sizing-svg-sm);
+ }
}
&.title,
@@ -112,26 +117,6 @@
p {
margin: var(--sizing-base) 0;
-
- & svg {
- margin-bottom: var(--inline-margin-bottom);
- }
-
- &.music {
- color: var(--music);
-
- & svg {
- stroke: var(--music);
- }
- }
-
- &.movies {
- color: var(--tv);
-
- & svg {
- stroke: var(--tv);
- }
- }
}
}
diff --git a/src/assets/styles/pages/music.css b/src/assets/styles/pages/music.css
index 6f6a24b8..263aab97 100644
--- a/src/assets/styles/pages/music.css
+++ b/src/assets/styles/pages/music.css
@@ -17,34 +17,6 @@
aspect-ratio: var(--aspect-ratio-square);
}
- & p.concerts {
- color: var(--concerts);
-
- & svg {
- stroke: var(--concerts);
- }
- }
-
- & p.books {
- color: var(--books);
-
- & svg {
- stroke: var(--books);
- }
- }
-
- & p.movies {
- color: var(--tv);
-
- & svg {
- stroke: var(--tv);
- }
- }
-
- & p > svg {
- margin-bottom: var(--inline-margin-bottom);
- }
-
& .artist-display {
display: flex;
flex-direction: column;
@@ -69,28 +41,12 @@
font-size: var(--font-size-sm);
line-height: var(--line-height-sm);
- svg {
+ & svg {
width: var(--sizing-svg-sm);
height: var(--sizing-svg-sm);
}
}
- &.favorite {
- color: var(--favorite);
-
- & svg {
- stroke: var(--favorite);
- }
- }
-
- &.tattoo {
- color: var(--tattoo);
-
- & svg {
- stroke: var(--tattoo);
- }
- }
-
& .brain {
outline: 0;
diff --git a/src/assets/styles/pages/watching.css b/src/assets/styles/pages/watching.css
index b8844c80..c268b062 100644
--- a/src/assets/styles/pages/watching.css
+++ b/src/assets/styles/pages/watching.css
@@ -139,26 +139,6 @@
aspect-ratio: var(--aspect-ratio-banner);
}
- & p > svg {
- margin-bottom: var(--inline-margin-bottom);
- }
-
- & p.music {
- color: var(--music);
-
- & svg {
- stroke: var(--music);
- }
- }
-
- & p.books {
- color: var(--books);
-
- & svg {
- stroke: var(--books);
- }
- }
-
& .watching-meta {
display: flex;
flex-direction: column;
@@ -176,6 +156,11 @@
&.sub-meta {
font-size: var(--font-size-sm);
line-height: var(--line-height-sm);
+
+ & svg {
+ width: var(--sizing-svg-sm);
+ height: var(--sizing-svg-sm);
+ }
}
}
}
diff --git a/src/data/books.js b/src/data/books.js
index 8ff8ab79..9d601387 100644
--- a/src/data/books.js
+++ b/src/data/books.js
@@ -1,4 +1,5 @@
import { createClient } from '@supabase/supabase-js'
+import slugify from 'slugify'
import { sanitizeMediaString, parseCountryField } from '../../config/utilities/index.js'
const SUPABASE_URL = process.env.SUPABASE_URL
@@ -26,9 +27,12 @@ const fetchAllBooks = async () => {
review,
art,
favorite,
+ tattoo,
tags,
artists,
- movies
+ movies,
+ genres,
+ shows
`)
.order('date_finished', { ascending: false })
.range(rangeStart, rangeStart + PAGE_SIZE - 1)
@@ -57,6 +61,7 @@ const processBooks = (books) => {
review: book['review'],
rating: book['star_rating'] !== 'unrated' ? book['star_rating'] : '',
favorite: book['favorite'],
+ tattoo: book['tattoo'],
description: book['description'],
image: `/${book['art']}`,
url: `/books/${book['isbn']}`,
@@ -74,6 +79,14 @@ const processBooks = (books) => {
movie['url'] =`/watching/movies/${movie['tmdb_id']}`
return movie
}).sort((a, b) => b['year'] - a['year']) : null,
+ genres: book['genres']?.[0]?.['id'] ? book['genres'].map(genre => {
+ genre['url'] = `/music/genres/${slugify(genre['name'].replace('/', '-').toLowerCase())}`
+ return genre
+ }).sort((a, b) => a['name'].localeCompare(b['name'])) : null,
+ shows: book['shows']?.[0]?.['id'] ? book['shows'].map(show => {
+ show['url'] = `/watching/shows/${show['tmdb_id']}`
+ return show
+ }).sort((a, b) => b['year'] - a['year']) : null,
year,
}
})
diff --git a/src/data/genres.js b/src/data/genres.js
index ae5f1113..5d5eba4d 100644
--- a/src/data/genres.js
+++ b/src/data/genres.js
@@ -8,7 +8,7 @@ const supabase = createClient(SUPABASE_URL, SUPABASE_KEY)
const fetchGenresWithArtists = async () => {
const { data, error } = await supabase
- .from('genres')
+ .from('optimized_genres')
.select(`
name,
description,
@@ -21,7 +21,9 @@ const fetchGenresWithArtists = async () => {
country,
description,
favorite
- )
+ ),
+ books,
+ movies
`)
.order('id', { ascending: true })
@@ -36,7 +38,20 @@ const fetchGenresWithArtists = async () => {
...artist,
country: parseCountryField(artist['country'])
})),
- url: `/music/genres/${slugify(genre['name'].replace('/', '-').toLowerCase())}`
+ url: `/music/genres/${slugify(genre['name'].replace('/', '-').toLowerCase())}`,
+ books: genre['books']?.[0]?.['id'] ? genre['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,
+ movies: genre['movies']?.[0]?.['id'] ? genre['movies'].map(movie => ({
+ title: movie['title'],
+ year: movie['year'],
+ tmdb_id: movie['tmdb_id'],
+ url: `/watching/movies/${movie['tmdb_id']}`,
+ })).sort((a, b) => b['year'] - a['year']) : null,
}))
}
diff --git a/src/data/movies.js b/src/data/movies.js
index f9d69484..8fe0af75 100644
--- a/src/data/movies.js
+++ b/src/data/movies.js
@@ -1,5 +1,6 @@
import { createClient } from '@supabase/supabase-js'
import { DateTime } from 'luxon'
+import slugify from 'slugify'
import { sanitizeMediaString, parseCountryField } from '../../config/utilities/index.js'
const SUPABASE_URL = process.env.SUPABASE_URL
@@ -23,6 +24,7 @@ const fetchAllMovies = async () => {
collected,
plays,
favorite,
+ tattoo,
star_rating,
description,
review,
@@ -30,7 +32,9 @@ const fetchAllMovies = async () => {
backdrop,
tags,
artists,
- books
+ books,
+ genres,
+ shows
`)
.order('last_watched', { ascending: false })
.range(rangeStart, rangeStart + PAGE_SIZE - 1)
@@ -75,6 +79,14 @@ const processMovies = (movies) => {
book['url'] = `/books/${book['isbn']}`
return book
}).sort((a, b) => a['title'].localeCompare(b['title'])) : null,
+ genres: item['genres']?.[0]?.['id'] ? item['genres'].map(genre => {
+ genre['url'] = `/music/genres/${slugify(genre['name'].replace('/', '-').toLowerCase())}`
+ return genre
+ }).sort((a, b) => a['title'].localeCompare(b['title'])) : null,
+ shows: item['shows']?.[0]?.['id'] ? item['shows'].map(show => {
+ show['url'] = `/watching/shows/${show['tmdb_id']}`
+ return show
+ }).sort((a, b) => b['year'] - a['year']) : null,
}))
}
diff --git a/src/data/tv.js b/src/data/tv.js
index 9896666f..fb5d3da4 100644
--- a/src/data/tv.js
+++ b/src/data/tv.js
@@ -20,11 +20,14 @@ const fetchAllShows = async () => {
year,
collected,
favorite,
+ tattoo,
description,
review,
art,
backdrop,
- episodes
+ episodes,
+ movies,
+ books
`)
.range(rangeStart, rangeStart + PAGE_SIZE - 1)
@@ -46,7 +49,19 @@ const prepareShowData = (show) => ({
image: show['art'] ? `/${show['art']}` : '',
backdrop: show['backdrop'] ? `/${show['backdrop']}` : '',
url: `/watching/shows/${show['tmdb_id']}`,
- episodes: show['episodes'] || []
+ episodes: show['episodes'] || [],
+ tattoo: show['tattoo'],
+ movies: show['movies']?.[0]?.['id'] ? show['movies'].map(movie => {
+ movie['url'] = `/watching/movies/${movie['tmdb_id']}`
+ return movie
+ }).sort((a, b) => b['year'] - a['year']) : null,
+ books: show['books']?.[0]?.['id'] ? show['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,
})
const prepareEpisodeData = (show) => show['episodes'].map(episode => ({
diff --git a/src/includes/partials/blocks/associated-media.liquid b/src/includes/partials/blocks/associated-media.liquid
new file mode 100644
index 00000000..c6ece33a
--- /dev/null
+++ b/src/includes/partials/blocks/associated-media.liquid
@@ -0,0 +1,65 @@
+{% comment %} render related artists {% endcomment %}
+{%- if artists -%}
+
+ {% tablericon "headphones" "Related artist(s)" %}
+ Related artist(s)
+
+
+ {% for artist in artists %}
+ {{ artist.name }} {%- if artist.total_plays > 0 -%}: {{ artist.total_plays }} plays {%- endif -%}
+ {% endfor %}
+
+
+{%- endif -%}
+{% comment %} render related books {% endcomment %}
+{%- if books -%}
+
+ {% tablericon "books" "Related book(s)" %}
+ Related book(s)
+
+
+ {% for book in books %}
+ {{ book.title }} by {{ book.author }}
+ {% endfor %}
+
+
+{%- endif -%}
+{% comment %} render related genres {% endcomment %}
+{%- if genres -%}
+
+ {% tablericon "headphones" "Genre(s)" %}
+ Related genre(s)
+
+
+
+{%- endif -%}
+{% comment %} render related movies {% endcomment %}
+{%- if movies -%}
+
+ {% tablericon "movie" "Related movie(s)" %}
+ Related movie(s)
+
+
+
+{%- endif -%}
+{% comment %} render related shows {% endcomment %}
+{%- if shows -%}
+
+ {% tablericon "device-tv-old" "Related show(s)" %}
+ Related show(s)
+
+
+
+{%- endif -%}
\ No newline at end of file
diff --git a/src/includes/partials/blocks/badge-grid.liquid b/src/includes/partials/blocks/badge-grid.liquid
index 748875c0..984ea861 100644
--- a/src/includes/partials/blocks/badge-grid.liquid
+++ b/src/includes/partials/blocks/badge-grid.liquid
@@ -1,18 +1,18 @@
{%- for badge in badges limit: 8 -%}
-
-
-
+
+
+
{%- endfor -%}
\ No newline at end of file
diff --git a/src/includes/partials/feeds/json.liquid b/src/includes/partials/feeds/json.liquid
index 5ffe354a..493dac3b 100644
--- a/src/includes/partials/feeds/json.liquid
+++ b/src/includes/partials/feeds/json.liquid
@@ -14,35 +14,35 @@
"items": [
{%- assign entries = data | normalizeEntries: 20 -%}
{%- for entry in entries -%}
- {%- assign summary = entry.content | strip_html | normalize_whitespace | escape -%}
- {%- assign utm_parameters = "utm_source=rss&utm_medium=feed&utm_campaign=" | append: utm_campaign -%}
- {
- "id": "{{ entry.url | encodeAmp | escape }}",
- "title": "{{ entry.title | escape }}{% if entry.authors %} via {{ entry.authors.name | escape }}{% endif %}{% if entry.rating %} ({{ entry.rating | escape }}){% endif %}",
- {%- if utm_campaign -%}
- "url": "{{ entry.url | append: '?' | append: utm_parameters }}",
- {%- else -%}
- "url": "{{ entry.url | encodeAmp }}",
- {%- endif -%}
- "content_html": "{{ summary }}",
- "summary": "{{ summary }}",
- {%- if entry.author -%}
- "external_url": "{{ entry.url | encodeAmp | escape }}",
- "authors": [{
- "name": "{{ entry.author.name | escape }}",
- "url": "{{ entry.author.url | escape }}",
- "mastodon": "{{ entry.author.mastodon | escape }}",
- "rss": "{{ entry.author.feed | escape }}"
- }],
- {%- endif %}
- "date_published": "{{ entry.date | date: '%Y-%m-%dT%H:%M:%S%:z' }}"{%- if entry.tags -%},
- "tags": [
- {%- for tag in entry.tags -%}
- "{{ tag | escape }}"{%- unless forloop.last -%}, {% endunless -%}
- {%- endfor -%}
- ]
- {%- endif -%}
- }{%- if forloop.last == false -%},{%- endif -%}
+ {%- assign summary = entry.content | strip_html | normalize_whitespace | escape -%}
+ {%- assign utm_parameters = "utm_source=rss&utm_medium=feed&utm_campaign=" | append: utm_campaign -%}
+ {
+ "id": "{{ entry.url | encodeAmp | escape }}",
+ "title": "{{ entry.title | escape }}{% if entry.authors %} via {{ entry.authors.name | escape }}{% endif %}{% if entry.rating %} ({{ entry.rating | escape }}){% endif %}",
+ {%- if utm_campaign -%}
+ "url": "{{ entry.url | append: '?' | append: utm_parameters }}",
+ {%- else -%}
+ "url": "{{ entry.url | encodeAmp }}",
+ {%- endif -%}
+ "content_html": "{{ summary }}",
+ "summary": "{{ summary }}",
+ {%- if entry.author -%}
+ "external_url": "{{ entry.url | encodeAmp | escape }}",
+ "authors": [{
+ "name": "{{ entry.author.name | escape }}",
+ "url": "{{ entry.author.url | escape }}",
+ "mastodon": "{{ entry.author.mastodon | escape }}",
+ "rss": "{{ entry.author.feed | escape }}"
+ }],
+ {%- endif %}
+ "date_published": "{{ entry.date | date: '%Y-%m-%dT%H:%M:%S%:z' }}"{%- if entry.tags -%},
+ "tags": [
+ {%- for tag in entry.tags -%}
+ "{{ tag | escape }}"{%- unless forloop.last -%}, {% endunless -%}
+ {%- endfor -%}
+ ]
+ {%- endif -%}
+ }{%- if forloop.last == false -%},{%- endif -%}
{%- endfor -%}
]
}
\ No newline at end of file
diff --git a/src/pages/dynamic/books/book.html b/src/pages/dynamic/books/book.html
index 0dd45d31..cbf84e09 100644
--- a/src/pages/dynamic/books/book.html
+++ b/src/pages/dynamic/books/book.html
@@ -38,6 +38,12 @@ schema: book
{% if book.author %}
By {{ book.author }}
{% endif %}
+ {%- if book.favorite -%}
+ {% tablericon "heart" "Favorite" %} This is one of my favorite books!
+ {%- endif -%}
+ {%- if book.tattoo -%}
+ {% tablericon "needle" "Tattoo" %} I have a tattoo inspired by this book!
+ {%- endif -%}
{% if book.status == 'finished' %}
Finished on: {{ book.date | date: "%B %e, %Y" }}
{% endif %}
@@ -49,49 +55,15 @@ schema: book
{% if book.review %}
- {% render "partials/blocks/banners/warning.liquid", text: "There are probably spoilers after this banner — this is a warning about them." %}
- My thoughts
- {{ book.review | markdown }}
-
+ {% render "partials/blocks/banners/warning.liquid", text: "There are probably spoilers after this banner — this is a warning about them." %}
+ My thoughts
+ {{ 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 }}
-
-
- {% for artist in book.artists %}
- {{ artist.name }} {%- if artist.total_plays > 0 -%}: {{ artist.total_plays }} plays {%- endif -%}
- {% endfor %}
-
-
- {%- endif -%}
- {%- if book.movies -%}
- {%- capture sectionTitle -%}
- {% if book.movies.size > 1 %}
- I've watched movies related to this book!
- {% else %}
- I've watched a movie related to this book!
- {%- endif -%}
- {%- endcapture -%}
-
-
- {% tablericon "device-tv-old" "Movies" %}
- {{ sectionTitle }}
-
-
- {% for movie in book.movies %}
- {{ movie.title }} ({{ movie.year }})
- {% endfor %}
-
- {%- endif -%}
+ {% render "partials/blocks/associated-media.liquid", artists:book.artists %}
+ {% render "partials/blocks/associated-media.liquid", movies:book.movies %}
+ {% render "partials/blocks/associated-media.liquid", shows:book.shows %}
+ {% render "partials/blocks/associated-media.liquid", genres:book.genres %}
{% if book.description %}
Overview
{{ book.description | markdown }}
diff --git a/src/pages/dynamic/music/artists/artist.html b/src/pages/dynamic/music/artists/artist.html
index b9f45a72..e6950942 100644
--- a/src/pages/dynamic/music/artists/artist.html
+++ b/src/pages/dynamic/music/artists/artist.html
@@ -58,7 +58,10 @@ schema: artist
+ {% render "partials/blocks/associated-media.liquid", books:artist.books %}
+ {% render "partials/blocks/associated-media.liquid", movies:artist.movies %}
{%- if artist.description -%}
+ Overview
{{ artist.description | markdown }}
Show more
{%- endif -%}
@@ -90,37 +93,6 @@ schema: artist
{% endfor %}
{%- endif -%}
- {%- if artist.books -%}
-
-
- {% tablericon "books" "Books" %}
- I've read about this artist!
-
-
- {% for book in artist.books %}
- {{ book.title }} by {{ book.author }}
- {% endfor %}
-
- {%- endif -%}
- {%- if artist.movies -%}
- {%- capture sectionTitle -%}
- {% if artist.movies.size > 1 %}
- I've watched movies about this artist!
- {% else %}
- I've watched a movie about this artist!
- {%- endif -%}
- {%- endcapture -%}
-
-
- {% tablericon "device-tv-old" "Movies" %}
- {{ sectionTitle}}
-
-
- {% for movie in artist.movies %}
- {{ movie.title }} ({{ movie.year }})
- {% endfor %}
-
- {%- endif -%}
{%- if artist.books or artist.concerts or artist.movies -%} {%- endif -%}
diff --git a/src/pages/dynamic/music/genre.html b/src/pages/dynamic/music/genre.html
index 00bc431f..ee18106c 100644
--- a/src/pages/dynamic/music/genre.html
+++ b/src/pages/dynamic/music/genre.html
@@ -26,15 +26,18 @@ schema: genre
{{ genre.name }}
{%- if mediaLinks -%}
- My top {{ genre.name }} artists {{ connectingWord }} {{ mediaLinks }}. I've listened to {{ genre.total_plays | formatNumber }} tracks form this genre.
-
- {% endif %}
+ My top {{ genre.name }} artists {{ connectingWord }} {{ mediaLinks }}. I've listened to {{ genre.total_plays | formatNumber }} tracks form this genre.
+
+ {%- endif -%}
+ {% render "partials/blocks/associated-media.liquid", books:genre.books %}
+ {% render "partials/blocks/associated-media.liquid", movies:genre.movies %}
{%- if genre.description -%}
-
- {{ genre.description | markdown }}
-
Continue reading at Wikipedia.
-
Wikipedia content provided under the terms of the Creative Commons BY-SA license
-
- Show more
+ Overview
+
+ {{ genre.description | markdown }}
+
Continue reading at Wikipedia.
+
Wikipedia content provided under the terms of the Creative Commons BY-SA license
+
+ Show more
{%- endif -%}
\ No newline at end of file
diff --git a/src/pages/dynamic/watching/movie.html b/src/pages/dynamic/watching/movie.html
index 8f7fbff3..b221d886 100644
--- a/src/pages/dynamic/watching/movie.html
+++ b/src/pages/dynamic/watching/movie.html
@@ -41,46 +41,25 @@ schema: movie
{%- endif -%}
{% endif -%}
+ {%- if movie.favorite -%}
+ {% tablericon "heart" "Favorite" %} This is one of my favorite movies!
+ {%- endif -%}
+ {%- if movie.tattoo -%}
+ {% tablericon "needle" "Tattoo" %} I have a tattoo inspired by this movie!
+ {%- endif -%}
{% if movie.lastWatched %}Last watched on {{ movie.lastWatched | date: "%B %e, %Y" }}.
{% endif %}
View on TMDB
{% if movie.review %}
- {% render "partials/blocks/banners/warning.liquid", text: "There are probably spoilers after this banner — this is a warning about them." %}
- My thoughts
- {{ movie.review | markdown }}
-
+ {% render "partials/blocks/banners/warning.liquid", text: "There are probably spoilers after this banner — this is a warning about them." %}
+ My thoughts
+ {{ movie.review | markdown }}
+
{% endif %}
- {%- if movie.artists -%}
- {%- capture sectionTitle -%}
- {% if movie.artists.size > 1 %}
- I listen to artists featured in this movie!
- {% else %}
- I listen to the artist featured in this movie!
- {%- endif -%}
- {%- endcapture -%}
-
- {% tablericon "headphones" "Music" %}
- {{ sectionTitle }}
-
-
- {% for artist in movie.artists %}
- {{ artist.name }} {%- if artist.total_plays > 0 -%}: {{ artist.total_plays }} plays {%- endif -%}
- {% endfor %}
-
-
- {%- endif -%}
- {%- if movie.books -%}
-
- {% tablericon "books" "Books" %}
- I've read about this movie!
-
-
- {% for book in movie.books %}
- {{ book.title }} by {{ book.author }}
- {% endfor %}
-
-
- {%- endif -%}
+ {% render "partials/blocks/associated-media.liquid", shows:movie.shows %}
+ {% render "partials/blocks/associated-media.liquid", artists:movie.artists %}
+ {% render "partials/blocks/associated-media.liquid", books:movie.books %}
+ {% render "partials/blocks/associated-media.liquid", genres:movie.genres %}
{% if movie.description %}
Overview
{{ movie.description | markdown }}
diff --git a/src/pages/dynamic/watching/show.html b/src/pages/dynamic/watching/show.html
index 9be83716..d47396ce 100644
--- a/src/pages/dynamic/watching/show.html
+++ b/src/pages/dynamic/watching/show.html
@@ -34,6 +34,12 @@ schema: show
/>
{% if show.review %}
- {% render "partials/blocks/banners/warning.liquid", text: "There are probably spoilers after this banner — this is a warning about them." %}
- My thoughts
- {{ show.review | markdown }}
-
+ {% render "partials/blocks/banners/warning.liquid", text: "There are probably spoilers after this banner — this is a warning about them." %}
+ My thoughts
+ {{ show.review | markdown }}
+
{% endif %}
+ {% render "partials/blocks/associated-media.liquid", movies:show.movies %}
+ {% render "partials/blocks/associated-media.liquid", books:show.books %}
{% if show.description %}
Overview
{{ show.description | markdown }}