From 277c5beddae33792c96137c1a89e951d5bcc817e Mon Sep 17 00:00:00 2001 From: Jeff Date: Sun, 10 Dec 2023 11:07:49 -0700 Subject: [PATCH] Fix og:url tags on gallery pages --- www/src/routes/photos/[slug]/+page.server.js | 3 ++- www/src/routes/photos/[slug]/+page.svelte | 2 +- www/src/routes/photos/item.svelte | 6 ++++++ www/src/routes/photos/screen-shots/[slug]/+page.server.js | 3 ++- www/src/routes/photos/screen-shots/[slug]/+page.svelte | 2 +- 5 files changed, 12 insertions(+), 4 deletions(-) diff --git a/www/src/routes/photos/[slug]/+page.server.js b/www/src/routes/photos/[slug]/+page.server.js index 76f1e5b7..da19beac 100644 --- a/www/src/routes/photos/[slug]/+page.server.js +++ b/www/src/routes/photos/[slug]/+page.server.js @@ -11,6 +11,7 @@ export const load = async ({ params }) => { /** @todo Get optimal OG image height and include .height() */ post.coverImage = urlFor(post.coverImage) .width(1200) + .height(630) .format('jpg') .url() @@ -32,7 +33,7 @@ export const load = async ({ params }) => { return image }) - return { post } + return { post, slug: params.slug } } throw error(404, 'Not found.') diff --git a/www/src/routes/photos/[slug]/+page.svelte b/www/src/routes/photos/[slug]/+page.svelte index e7dfcc73..97c4ba27 100644 --- a/www/src/routes/photos/[slug]/+page.svelte +++ b/www/src/routes/photos/[slug]/+page.svelte @@ -5,4 +5,4 @@ import Item from '../item.svelte' export let data - + diff --git a/www/src/routes/photos/item.svelte b/www/src/routes/photos/item.svelte index 14d55a5e..5f11a07e 100644 --- a/www/src/routes/photos/item.svelte +++ b/www/src/routes/photos/item.svelte @@ -11,6 +11,9 @@ import TextLede from '$lib/components/text-lede.svelte' /** @type {'screen-shots' | undefined} */ export let collection = undefined +/** @type {string} */ +export let slug + /** @type {import('./[slug]/$types').PageData} */ export let data $: ({ post } = data) @@ -27,6 +30,8 @@ $: ({ if (collection === 'screen-shots') fullTitle += ' — Screen Shots' +let url = ['https://tidaltheory.io/photos', collection, slug].join('/') + let isCarouselOpen = false let initialIndex = 0 @@ -49,6 +54,7 @@ function handleCloseCarousel() { + diff --git a/www/src/routes/photos/screen-shots/[slug]/+page.server.js b/www/src/routes/photos/screen-shots/[slug]/+page.server.js index 76f1e5b7..da19beac 100644 --- a/www/src/routes/photos/screen-shots/[slug]/+page.server.js +++ b/www/src/routes/photos/screen-shots/[slug]/+page.server.js @@ -11,6 +11,7 @@ export const load = async ({ params }) => { /** @todo Get optimal OG image height and include .height() */ post.coverImage = urlFor(post.coverImage) .width(1200) + .height(630) .format('jpg') .url() @@ -32,7 +33,7 @@ export const load = async ({ params }) => { return image }) - return { post } + return { post, slug: params.slug } } throw error(404, 'Not found.') diff --git a/www/src/routes/photos/screen-shots/[slug]/+page.svelte b/www/src/routes/photos/screen-shots/[slug]/+page.svelte index 7d4d3dce..27154e9e 100644 --- a/www/src/routes/photos/screen-shots/[slug]/+page.svelte +++ b/www/src/routes/photos/screen-shots/[slug]/+page.svelte @@ -5,4 +5,4 @@ import Item from '../../item.svelte' export let data - +