diff --git a/src/components/AppLayout/components/Html.astro b/src/components/AppLayout/components/Html.astro index 1422851..e7c289f 100644 --- a/src/components/AppLayout/components/Html.astro +++ b/src/components/AppLayout/components/Html.astro @@ -5,15 +5,16 @@ import "@fontsource-variable/vollkorn"; import "@fontsource-variable/murecho"; import { getI18n } from "src/i18n/i18n"; import AppLayoutSpinner from "./AppLayoutSpinner.astro"; +import type { EndpointAudio, EndpointVideo, PayloadImage } from "src/shared/payload/payload-sdk"; interface Props { openGraph?: | { title?: string | undefined; description?: string | undefined; - thumbnail?: string | undefined; - audio?: string | undefined; - video?: string | undefined; + thumbnail?: PayloadImage | undefined; + audio?: EndpointAudio | undefined; + video?: EndpointVideo | undefined; } | undefined; } @@ -24,13 +25,20 @@ const { t } = await getI18n(currentLocale); const { openGraph = {} } = Astro.props; const { description = t("global.meta.description"), - thumbnail = "/img/default_og.jpg", + thumbnail = { + filename: "default_og.jpg", + filesize: 0, + height: 630, + width: 1200, + mimeType: "image/jpeg", + url: "/img/default_og.jpg", + }, audio, video, } = openGraph; const title = openGraph.title - ? `${t("global.siteName")} – ${openGraph.title}` + ? `${openGraph.title} – ${t("global.siteName")}` : t("global.siteName"); const userAgent = Astro.request.headers.get("user-agent") ?? ""; @@ -69,7 +77,7 @@ const { currentTheme } = Astro.locals; - + @@ -78,26 +86,27 @@ const { currentTheme } = Astro.locals; - - - - + { audio && ( <> - - + + + ) } { video && ( <> - - + + + ) } diff --git a/src/pages/[locale]/collectibles/[slug]/index.astro b/src/pages/[locale]/collectibles/[slug]/index.astro index f10c81b..db75a7b 100644 --- a/src/pages/[locale]/collectibles/[slug]/index.astro +++ b/src/pages/[locale]/collectibles/[slug]/index.astro @@ -52,6 +52,7 @@ const translation = getLocalizedMatch(translations); openGraph={{ title: formatInlineTitle(translation), description: translation.description && formatRichTextToString(translation.description), + thumbnail, }} parentPages={parentPages} backgroundImage={backgroundImage ?? thumbnail}> diff --git a/src/pages/[locale]/pages/[slug].astro b/src/pages/[locale]/pages/[slug].astro index f28a302..a19f0c9 100644 --- a/src/pages/[locale]/pages/[slug].astro +++ b/src/pages/[locale]/pages/[slug].astro @@ -23,7 +23,7 @@ const meta = getLocalizedMatch(page.translations); openGraph={{ title: formatInlineTitle(meta), description: meta.summary && formatRichTextToString(meta.summary), - thumbnail: page.thumbnail?.url, + thumbnail: page.thumbnail, }} parentPages={page.parentPages} backgroundImage={page.backgroundImage ?? page.thumbnail}>