deduplicate opengraph
deploy / build-and-deploy (push) Successful in 43s

This commit is contained in:
bytedream committed 2026-10-31 02:14:46 +01:00
1 parent 45b5af9254
commit e0a0b188ad
3 files changed
+8 -7

No files matched your search

+4 -4
View File
@@ -9,7 +9,7 @@ interface Props {
title: string; title: string;
description?: string; description?: string;
keywords?: string[]; keywords?: string[];
openGraph?: boolean; openGraph?: 'minimal' | 'generic';
viewTransition?: boolean; viewTransition?: boolean;
} }
@@ -29,12 +29,12 @@ const { title, description, keywords, openGraph, viewTransition } = Astro.props;
<meta property="og:title" content={title} /> <meta property="og:title" content={title} />
{description && <meta property="og:description" content={description} />} {description && <meta property="og:description" content={description} />}
<meta property="og:url" content={Astro.url.pathname} /> <meta property="og:url" content={Astro.url.pathname} />
<meta property="og:type" content="website" /> {openGraph == 'generic' && <meta property="og:type" content="website" />}
<meta property="og:image" content={logo512.src} /> {openGraph == 'generic' && <meta property="og:image" content={logo512.src} />}
</> </>
)} )}
<slot name="head" /> <slot name="head" />
<meta name="description" content={description} /> {description && <meta name="description" content={description} />}
{keywords && <meta name="keywords" content={keywords.join(', ')} />} {keywords && <meta name="keywords" content={keywords.join(', ')} />}
<base href=`${BASE_PATH}/` /> <base href=`${BASE_PATH}/` />
</head> </head>
+3 -2
View File
@@ -8,12 +8,13 @@ interface Props {
description?: string; description?: string;
footer?: boolean; footer?: boolean;
openGraph?: 'minimal' | 'generic';
} }
const { title, description, footer = true } = Astro.props; const { title, description, footer = true, openGraph = 'generic' } = Astro.props;
--- ---
<BaseLayout title={title} description={description} openGraph={true} viewTransition> <BaseLayout title={title} description={description} openGraph={openGraph} viewTransition>
{Astro.slots.has('head') && <slot name="head" slot="head" />} {Astro.slots.has('head') && <slot name="head" slot="head" />}
<main class="min-h-[calc(100vh-3.5rem)] h-full w-full relative overflow-y-hidden"> <main class="min-h-[calc(100vh-3.5rem)] h-full w-full relative overflow-y-hidden">
<slot /> <slot />
+1 -1
View File
@@ -16,7 +16,7 @@ const { title, description, width, height, duration } = metadata;
const streamPath = `${BASE_PATH}/video/${encodeURIComponent(video.name)}/stream`; const streamPath = `${BASE_PATH}/video/${encodeURIComponent(video.name)}/stream`;
--- ---
<WebsiteLayout title={`${title} - Video`} description={description ?? undefined}> <WebsiteLayout title={`${title} - Video`} description={description ?? undefined} openGraph="minimal">
<Fragment slot="head"> <Fragment slot="head">
<meta property="og:type" content="video" /> <meta property="og:type" content="video" />
<meta property="og:video" content={streamPath} /> <meta property="og:video" content={streamPath} />