fix: metadata

This commit is contained in:
Cory Dransfeldt 2024-11-15 20:10:40 -08:00
parent 7a4505ab78
commit 4f158f6956
No known key found for this signature in database
6 changed files with 41 additions and 39 deletions

4
package-lock.json generated
View file

@ -1,12 +1,12 @@
{
"name": "coryd.dev",
"version": "3.3.1",
"version": "3.3.3",
"lockfileVersion": 3,
"requires": true,
"packages": {
"": {
"name": "coryd.dev",
"version": "3.3.1",
"version": "3.3.3",
"license": "MIT",
"dependencies": {
"@11ty/eleventy-fetch": "4.0.1",

View file

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

View file

@ -255,7 +255,7 @@ h1 {
h2 {
font-size: var(--font-size-xl);
&.page-header {
&.page-title {
margin-top: 0;
}
}

View file

@ -2,7 +2,6 @@
{%- 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 -%}
@ -12,7 +11,7 @@
{%- if page.title -%}
{%- assign pageTitle = 'Music / ' | append: page.title -%}
{%- else -%}
{%- assign pageTitle = 'Music / ' | append: globals.site_name -%}
{%- assign pageTitle = 'Music' -%}
{%- endif -%}
{%- if schema == 'music' -%}
{%- assign ogImage = globals.cdn_url | append: page.image -%}
@ -34,6 +33,7 @@
{%- assign pageDescription = book.review | markdown | strip_html | default: book.description | htmlTruncate -%}
{%- assign ogImage = globals.cdn_url | append: book.image -%}
{%- when 'books' -%}
{%- assign pageTitle = 'Books' -%}
{%- assign overviewBook = books.all | filterBooksByStatus: 'started' | reverse | first %}
{%- assign ogImage = globals.cdn_url | append: overviewBook.image -%}
{%- when 'books-year' -%}
@ -48,34 +48,38 @@
{%- assign pageDescription = movie.review | markdown | strip_html | default: movie.description | htmlTruncate -%}
{%- assign ogImage = globals.cdn_url | append: movie.backdrop -%}
{%- when 'favorite-movies' -%}
{%- assign pageTitle = '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 pageTitle = 'Show / ' | 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 pageTitle = 'Favorite shows' -%}
{%- assign favoriteShow = tv.favorites | shuffleArray | first %}
{%- assign ogImage = globals.cdn_url | append: favoriteShow.backdrop -%}
{%- when 'watching' -%}
{%- assign pageTitle = '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 -%}
{%- when 'page' -%}
{%- assign pageTitle = page.title -%}
{%- assign pageDescription = page.description -%}
{% endcase %}
{%- assign pageTitle = pageTitle | append: ' / ' | append: globals.site_name -%}
{%- if title -%}
{%- assign pageTitle = title -%}
{%- endif -%}
{%- if description -%}
{%- assign pageDescription = description -%}
{%- endif -%}
{%- if pageTitle != globals.site_name and schema != 'blog' -%}
{%- assign pageTitle = pageTitle | append: ' / ' | append: globals.site_name -%}
{%- endif -%}
{%- assign escapedPageDescription = pageDescription | escape -%}
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<meta name="color-scheme" content="light dark" />
<title>{{ pageTitle }}</title>
<link rel="canonical" href="{{ fullUrl }}" />
<meta property="og:title" content="{{ pageTitle }}" />
@ -83,4 +87,17 @@
<meta property="og:description" content="{{ escapedPageDescription }}" />
<meta property="og:type" content="article" />
<meta property="og:url" content="{{ fullUrl }}" />
<meta property="og:image" content="{{ ogImage }}?class=w800" />
<meta property="og:image" content="{{ ogImage }}?class=w800" />
<meta name="theme-color" content="{{ globals.theme_color }}" />
<meta name="fediverse:creator" content="{{ globals.mastodon }}" />
<meta name="generator" content="Eleventy" />
<meta name="robots" content="noai, noimageai" />
<link href="{{ globals.cdn_url }}{{ globals.avatar_transparent }}?class=w50&v={% appVersion %}" rel="icon" sizes="any" />
<link href="{{ globals.cdn_url }}{{ globals.avatar_transparent }}?class=w50&v={% appVersion %}&type=svg" rel="icon" type="image/svg+xml" />
<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 }}" 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" />

View file

@ -1,9 +1,6 @@
<!doctype html>
<html lang="{{ globals.lang }}">
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<meta name="color-scheme" content="light dark" />
<link rel="preload" href="/assets/fonts/ml.woff2" as="font" type="font/woff2" crossorigin="anonymous" />
<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" />
@ -12,6 +9,8 @@
page: page,
globals:globals,
post:post,
title:title,
description:description,
artist:artist,
movie:movie,
movies:movies,
@ -22,19 +21,6 @@
genre:genre,
year:year
%}
<meta name="theme-color" content="{{ globals.theme_color }}" />
<meta name="fediverse:creator" content="{{ globals.mastodon }}" />
<meta name="generator" content="Eleventy" />
<meta name="robots" content="noai, noimageai" />
<link href="{{ globals.cdn_url }}{{ globals.avatar_transparent }}?class=w50&v={% appVersion %}" rel="icon" sizes="any" />
<link href="{{ globals.cdn_url }}{{ globals.avatar_transparent }}?class=w50&v={% appVersion %}&type=svg" rel="icon" type="image/svg+xml" />
<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 }}" 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" />
<script defer src="/assets/scripts/index.js?v={% appVersion %}"></script>
<script defer data-domain="coryd.dev" src="/js/script.js"></script>
<script>window.plausible = window.plausible || function() { (window.plausible.q = window.plausible.q || []).push(arguments) }</script>

View file

@ -3,7 +3,6 @@ pagination:
data: pages
size: 1
alias: page
description: "{{ page.description }}"
permalink: "{{ page.permalink }}.html"
image: "{{ page.open_graph_image | prepend: globals.cdn_url | default: globals.avatar }}"
updated: "{{ page.updated | default: null }}"