From 115c6fb78fe6f965df8266577e08fee86d83f7ab Mon Sep 17 00:00:00 2001 From: chloe Date: Fri, 20 Mar 2026 23:03:17 +0000 Subject: [PATCH] rough image preview for sharing --- Seasoned.Frontend/app/pages/recipe/[id].vue | 8 +++++++- Seasoned.Frontend/nuxt.config.ts | 2 +- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/Seasoned.Frontend/app/pages/recipe/[id].vue b/Seasoned.Frontend/app/pages/recipe/[id].vue index 3011fda..f41e54c 100644 --- a/Seasoned.Frontend/app/pages/recipe/[id].vue +++ b/Seasoned.Frontend/app/pages/recipe/[id].vue @@ -17,8 +17,14 @@ import { computed } from 'vue' definePageMeta({ auth: false }) + const route = useRoute(); const config = useRuntimeConfig(); +const imageUrl = normalizedRecipe.value.imageUrl; + +const absoluteOgImage = imageUrl?.startsWith('http') + ? imageUrl + : `${config.public.apiBase}${imageUrl || '/images/seasoned-logo.png'}`; const { data: rawRecipe, error } = await useAsyncData(`recipe-${route.params.id}`, () => { const baseUrl = config.public.apiBase.endsWith('/') @@ -49,7 +55,7 @@ useSeoMeta({ title: `${normalizedRecipe.value.title} | Seasoned`, ogTitle: `Chef's Choice: ${normalizedRecipe.value.title}`, description: `Check out this delicious recipe for ${normalizedRecipe.value.title} on Seasoned.`, - ogImage: normalizedRecipe.value.imageUrl || '/images/seasoned-logo.png', + ogImage: absoluteOgImage, twitterCard: 'summary_large_image', ogType: 'article', }) diff --git a/Seasoned.Frontend/nuxt.config.ts b/Seasoned.Frontend/nuxt.config.ts index 75345ce..90ded5d 100644 --- a/Seasoned.Frontend/nuxt.config.ts +++ b/Seasoned.Frontend/nuxt.config.ts @@ -2,7 +2,7 @@ export default defineNuxtConfig({ future: { compatibilityVersion: 4, }, - ssr: false, + ssr: true, srcDir: 'app/', dir: { public: 'public/'