chore: metadata

This commit is contained in:
Cory Dransfeldt 2024-11-15 05:11:24 -08:00
parent 4df53beb0b
commit c48adf01de
No known key found for this signature in database
6 changed files with 129 additions and 74 deletions

10
package-lock.json generated
View file

@ -1,12 +1,12 @@
{
"name": "coryd.dev",
"version": "3.0.2",
"version": "3.2.0",
"lockfileVersion": 3,
"requires": true,
"packages": {
"": {
"name": "coryd.dev",
"version": "3.0.2",
"version": "3.2.0",
"license": "MIT",
"dependencies": {
"@11ty/eleventy-fetch": "4.0.1",
@ -1674,9 +1674,9 @@
"license": "MIT"
},
"node_modules/electron-to-chromium": {
"version": "1.5.58",
"resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.5.58.tgz",
"integrity": "sha512-al2l4r+24ZFL7WzyPTlyD0fC33LLzvxqLCwurtBibVPghRGO9hSTl+tis8t1kD7biPiH/en4U0I7o/nQbYeoVA==",
"version": "1.5.61",
"resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.5.61.tgz",
"integrity": "sha512-CcRGSBCBB6L9c3PBJWYYrBo6Bzeoi+GZTKvtuRtooJGWsINk+mOInZWcssU35zDTAwreVcrMimc9aMyPpehRNw==",
"dev": true,
"license": "ISC"
},

View file

@ -1,6 +1,6 @@
{
"name": "coryd.dev",
"version": "3.0.2",
"version": "3.2.0",
"description": "The source for my personal site. Built using 11ty (and other tools).",
"type": "module",
"engines": {

View file

@ -9,10 +9,11 @@ SELECT
g.slug AS url,
(
SELECT
json_agg(json_build_object('name', a.name_string, 'url', a.slug, 'total_plays', to_char(a.total_plays, 'FM999,999,999,999'))
json_agg(json_build_object('name', a.name_string, 'url', a.slug, 'image', CONCAT('/', df_artist.filename_disk), 'total_plays', to_char(a.total_plays, 'FM999,999,999,999'))
ORDER BY a.total_plays DESC)
FROM
artists a
LEFT JOIN directus_files df_artist ON a.art = df_artist.id
WHERE
a.genres = g.id) AS artists,
(

View file

@ -1,6 +1,12 @@
<footer{% unless updated %} style="margin-top:var(--spacing-3xl)"{% endunless %}>
{%- if updated -%}
<p class="updated"><em>This page was last updated on {{ updated | strip }}.</em></p>
{%- assign updateTime = "" -%}
{%- if updated == "now" -%}
{%- assign updateTime = 'now' | date: "%B %-d, %l:%M %P", "America/Los_Angeles" -%}
{%- elsif pageUpdated -%}
{%- assign updateTime = page.updated | date: "%B %-d, %l:%M %P", "America/Los_Angeles" -%}
{%- endif -%}
<footer{% unless updateTime %} style="margin-top:var(--spacing-3xl)"{% endunless %}>
{%- if updateTime -%}
<p class="updated"><em>This page was last updated on {{ updateTime | strip }}.</em></p>
{%- endif -%}
<nav aria-label="Social icons" class="social">
{%- for link in nav.footer_icons -%}

View file

@ -1,34 +1,81 @@
{%- assign fullUrl = globals.url | append: page.url -%}
{%- assign pageTitle = title | default: globals.site_name -%}
{%- assign pageDescription = page.description | default: description | default: globals.site_description -%}
{%- assign pageTitle = globals.site_name -%}
{%- assign pageDescription = globals.site_description -%}
{%- assign ogImage = globals.cdn_url | append: globals.avatar -%}
{%- case schema -%}
{%- when 'blog' -%}
{%- assign pageTitle = post.title -%}
{%- assign pageDescription = post.description | markdown | strip_html | default: globals.site_description -%}
{%- when 'books', 'books-year' -%}
{%- assign featuredBook = books.all | filterBooksByStatus: 'started' | reverse | first -%}
{%- assign ogImage = globals.cdn_url | append: featuredBook.grid.image -%}
{%- if schema == 'books-year' -%}
{%- assign pageTitle = year.value | append: ' / Books / ' | append: globals.site_name -%}
{%- endif -%}
{%- when 'music' -%}
{%- assign ogImage = globals.cdn_url | append: page.image -%}
{%- when 'music-index' -%}
{%- assign pageDescription = post.description | markdown | strip_html -%}
{%- assign ogImage = globals.cdn_url | append: post.image -%}
{%- when 'music', 'music-index', 'music-period' -%}
{%- if page.title -%}
{%- assign pageTitle = 'Music / ' | append: page.title -%}
{%- else -%}
{%- assign pageTitle = 'Music / ' | append: globals.site_name -%}
{%- endif -%}
{%- if schema == 'music' -%}
{%- assign ogImage = globals.cdn_url | append: page.image -%}
{%- elsif schema == 'music-index' -%}
{%- assign ogImage = globals.cdn_url | append: music.week.artists[0].grid.image -%}
{%- when 'music-period' -%}
{%- assign pageTitle = 'Music / ' | append: page.title | append: ' / ' | append: globals.site_name -%}
{%- when 'page' -%}
{%- assign pageTitle = page.title | append: ' / ' | append: globals.site_name -%}
{%- when 'watching', 'favorite-movies' -%}
{%- assign featuredMovie = movies.recentlyWatched | first -%}
{%- assign ogImage = globals.cdn_url | append: featuredMovie.grid.backdrop -%}
{%- when 'watching-shows', 'favorite-shows' -%}
{%- assign featuredShow = tv.recentlyWatched | first -%}
{%- assign ogImage = globals.cdn_url | append: featuredShow.grid.backdrop -%}
{%- endcase -%}
{%- elsif schema == 'music-period' -%}
{%- assign ogImage = globals.cdn_url | append: page.image -%}
{%- endif -%}
{%- when 'artist' -%}
{%- assign pageTitle = 'Artists / ' | append: artist.name -%}
{%- assign pageDescription = artist.description | markdown | strip_html | htmlTruncate -%}
{%- assign ogImage = globals.cdn_url | append: artist.image -%}
{%- when 'genre' -%}
{%- assign pageTitle = 'Music / ' | append: genre.name -%}
{%- assign pageDescription = genre.description | markdown | strip_html | htmlTruncate -%}
{%- assign ogImage = globals.cdn_url | append: genre.artists[0].image -%}
{%- when 'book' -%}
{%- assign pageTitle = 'Books / ' | append: book.title | append: ' by ' | append: book.author -%}
{%- assign pageDescription = book.review | markdown | strip_html | default: book.description | htmlTruncate -%}
{%- assign ogImage = globals.cdn_url | append: book.image -%}
{%- when 'books' -%}
{%- assign overviewBook = books.all | filterBooksByStatus: 'started' | reverse | first %}
{%- assign ogImage = globals.cdn_url | append: overviewBook.image -%}
{%- when 'books-year' -%}
{%- assign bookData = year.data | filterBooksByStatus: 'finished' -%}
{%- assign bookYear = bookData | shuffleArray | first -%}
{%- assign ogImage = globals.cdn_url | append: bookYear.image -%}
{%- when 'movie' -%}
{%- assign pageTitle = 'Movies / ' | append: movie.title -%}
{%- if movie.rating -%}
{%- assign pageTitle = pageTitle | append: ' (' | append: movie.rating | append: ')' -%}
{%- endif -%}
{%- assign pageDescription = movie.review | markdown | strip_html | default: movie.description | htmlTruncate -%}
{%- assign ogImage = globals.cdn_url | append: movie.backdrop -%}
{%- when 'favorite-movies' -%}
{%- assign favoriteMovie = movies.favorites | shuffleArray | first %}
{%- assign ogImage = globals.cdn_url | append: favoriteMovie.backdrop -%}
{%- when 'show' -%}
{%- assign pageTitle = 'Shows / ' | append: show.title -%}
{%- assign pageDescription = show.review | markdown | strip_html | default: show.description | htmlTruncate -%}
{%- assign ogImage = globals.cdn_url | append: show.backdrop -%}
{%- when 'favorite-shows' -%}
{%- assign favoriteShow = tv.favorites | shuffleArray | first %}
{%- assign ogImage = globals.cdn_url | append: favoriteShow.backdrop -%}
{%- when 'watching' -%}
{%- assign overviewMovie = movies.recentlyWatched | first %}
{%- assign ogImage = globals.cdn_url | append: overviewMovie.backdrop -%}
{%- else -%}
{%- if title -%}
{%- assign pageTitle = title -%}
{%- elsif page.title -%}
{%- assign pageTitle = page.title -%}
{%- endif -%}
{%- if page.description -%}
{%- assign pageDescription = page.description -%}
{%- elsif description -%}
{%- assign pageDescription = description -%}
{%- endif -%}
{% endcase %}
{%- assign pageTitle = pageTitle | append: ' / ' | append: globals.site_name -%}
{%- assign escapedPageDescription = pageDescription | escape -%}
<title>{{ pageTitle }}</title>
<link rel="canonical" href="{{ fullUrl }}" />
<meta property="og:title" content="{{ pageTitle }}" />

View file

@ -1,9 +1,3 @@
{%- assign updateTime = "" -%}
{%- if updated == "now" -%}
{%- assign updateTime = 'now' | date: "%B %-d, %l:%M %P", "America/Los_Angeles" -%}
{%- elsif page.updated -%}
{%- assign updateTime = page.updated | date: "%B %-d, %l:%M %P", "America/Los_Angeles" -%}
{%- endif -%}
<!doctype html>
<html lang="{{ globals.lang }}">
<head>
@ -14,17 +8,19 @@
<link rel="preload" href="/assets/fonts/mlb.woff2" as="font" type="font/woff2" crossorigin="anonymous" />
<link rel="stylesheet" href="/assets/styles/index.css?v={% appVersion %}" type="text/css" />
{% render "metadata.liquid",
schema: schema,
page: page,
globals:globals,
schema:schema,
title:title,
page:page,
post:post,
year:year,
music:music,
artist:artist,
movie:movie,
movies:movies,
show:show,
tv:tv,
book:book,
books:books,
featuredMovie:featuredMovie,
featuredShow:featuredShow,
featuredBook:featuredBook,
genre:genre,
year:year
%}
<meta name="theme-color" content="{{ globals.theme_color }}" />
<meta name="fediverse:creator" content="{{ globals.mastodon }}" />
@ -35,7 +31,7 @@
<link href="{{ globals.cdn_url }}{{ globals.avatar }}?class=w800&v={% appVersion %}" rel="apple-touch-icon" />
<link type="application/atom+xml" rel="alternate" title="Posts / {{ globals.site_name }}" href="https://coryd.dev/feeds/posts" />
<link rel="alternate" href="https://coryd.dev/feeds/links" title="Links / {{ globals.site_name }}" type="application/rss+xml" />
<link rel="alternate" href="https://coryd.dev/feeds/movies" title="Movies / {{ globals.site_name }}'s movies feed" type="application/rss+xml" />
<link rel="alternate" href="https://coryd.dev/feeds/movies" title="Movies / {{ globals.site_name }}" type="application/rss+xml" />
<link rel="alternate" href="https://coryd.dev/feeds/books" title="Books / {{ globals.site_name }}" type="application/rss+xml" />
<link rel="alternate" href="https://coryd.dev/feeds/album-releases" title="Album releases / {{ globals.site_name }}" type="application/rss+xml" />
<link rel="alternate" href="https://coryd.dev/feeds/all" title="All activity / {{ globals.site_name }}" type="application/rss+xml" />
@ -54,7 +50,12 @@
{{ content }}
</div>
</main>
{% render "footer.liquid", page:page, nav:nav, updated:updateTime %}
{% render "footer.liquid",
page:page,
nav:nav,
updated:updated,
pageUpdated:page.updated
%}
</div>
</body>
</html>