rough image preview for sharing

This commit is contained in:
2026-03-20 23:03:17 +00:00
parent ac46e4106f
commit 115c6fb78f
2 changed files with 8 additions and 2 deletions

View File

@@ -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',
})

View File

@@ -2,7 +2,7 @@ export default defineNuxtConfig({
future: {
compatibilityVersion: 4,
},
ssr: false,
ssr: true,
srcDir: 'app/',
dir: {
public: 'public/'