merge BASE_URL and BASE_PASH into ROOT_URL

This commit is contained in:
bytedream committed 2026-10-31 03:18:42 +01:00
1 parent e0a0b188ad
commit e22c664aae
22 files changed
+56 -46

No files matched your search

+4 -4
View File
@@ -2,7 +2,7 @@
import WebsiteLayout from '@layouts/website/WebsiteLayout.astro';
import VideoPlayer from '@app/website/video/VideoPlayer.svelte';
import { getVideoMetadata, resolveVideo } from '@util/video.ts';
import { BASE_PATH } from 'astro:env/server';
import { siteUrl } from '@util/url.ts';
const { name } = Astro.params;
@@ -13,13 +13,13 @@ const metadata = await getVideoMetadata(video);
if (!metadata) return new Response(null, { status: 404 });
const { title, description, width, height, duration } = metadata;
const streamPath = `${BASE_PATH}/video/${encodeURIComponent(video.name)}/stream`;
const streamUrl = siteUrl(`video/${encodeURIComponent(video.name)}/stream`);
---
<WebsiteLayout title={`${title} - Video`} description={description ?? undefined} openGraph="minimal">
<Fragment slot="head">
<meta property="og:type" content="video" />
<meta property="og:video" content={streamPath} />
<meta property="og:video" content={streamUrl} />
<meta property="og:video:type" content={video.contentType} />
{width && <meta property="og:video:width" content={width.toString()} />}
{height && <meta property="og:video:height" content={height.toString()} />}
@@ -32,7 +32,7 @@ const streamPath = `${BASE_PATH}/video/${encodeURIComponent(video.name)}/stream`
<h1 class="mt-1 text-2xl font-semibold break-words lg:text-4xl">{title}</h1>
</div>
<VideoPlayer client:load src={streamPath} type={video.contentType} title={title} />
<VideoPlayer client:load src={streamUrl} type={video.contentType} title={title} />
{description && (
<p class="max-w-3xl text-base leading-relaxed whitespace-pre-line text-base-content/70">{description}</p>