From e0a0b188ad6166279fd84aacb77e1568f7063233 Mon Sep 17 00:00:00 2001 From: bytedream Date: Sat, 31 Oct 2026 02:14:46 +0100 Subject: [PATCH] deduplicate opengraph --- src/layouts/BaseLayout.astro | 8 ++++---- src/layouts/website/WebsiteLayout.astro | 5 +++-- src/pages/video/[name].astro | 2 +- 3 files changed, 8 insertions(+), 7 deletions(-) diff --git a/src/layouts/BaseLayout.astro b/src/layouts/BaseLayout.astro index e662f81..56957e7 100644 --- a/src/layouts/BaseLayout.astro +++ b/src/layouts/BaseLayout.astro @@ -9,7 +9,7 @@ interface Props { title: string; description?: string; keywords?: string[]; - openGraph?: boolean; + openGraph?: 'minimal' | 'generic'; viewTransition?: boolean; } @@ -29,12 +29,12 @@ const { title, description, keywords, openGraph, viewTransition } = Astro.props; {description && } - - + {openGraph == 'generic' && } + {openGraph == 'generic' && } )} - + {description && } {keywords && } diff --git a/src/layouts/website/WebsiteLayout.astro b/src/layouts/website/WebsiteLayout.astro index 187d002..e9e4f1a 100644 --- a/src/layouts/website/WebsiteLayout.astro +++ b/src/layouts/website/WebsiteLayout.astro @@ -8,12 +8,13 @@ interface Props { description?: string; footer?: boolean; + openGraph?: 'minimal' | 'generic'; } -const { title, description, footer = true } = Astro.props; +const { title, description, footer = true, openGraph = 'generic' } = Astro.props; --- - + {Astro.slots.has('head') && }
diff --git a/src/pages/video/[name].astro b/src/pages/video/[name].astro index 8f5134a..f7c0f02 100644 --- a/src/pages/video/[name].astro +++ b/src/pages/video/[name].astro @@ -16,7 +16,7 @@ const { title, description, width, height, duration } = metadata; const streamPath = `${BASE_PATH}/video/${encodeURIComponent(video.name)}/stream`; --- - +