Skip to content

Commit a7f0bf6

Browse files
committed
[Docs Site] Create videos pages
1 parent 529e6d6 commit a7f0bf6

File tree

1 file changed

+42
-0
lines changed

1 file changed

+42
-0
lines changed

src/pages/videos/[...slug].astro

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
---
2+
import type { GetStaticPaths } from "astro";
3+
import { getCollection } from "astro:content";
4+
import StarlightPage, {
5+
type StarlightPageProps,
6+
} from "@astrojs/starlight/components/StarlightPage.astro";
7+
8+
import { Stream, Width } from "~/components";
9+
10+
export const getStaticPaths = (async () => {
11+
const entries = await getCollection("stream");
12+
13+
return entries.map(({ data }) => {
14+
return {
15+
params: {
16+
slug: data.url,
17+
},
18+
props: {
19+
entry: data,
20+
},
21+
};
22+
});
23+
}) satisfies GetStaticPaths;
24+
25+
const { entry } = Astro.props;
26+
27+
const props = {
28+
frontmatter: {
29+
title: entry.title,
30+
description: entry.description,
31+
template: "splash",
32+
noindex: true,
33+
},
34+
hideBreadcrumbs: true,
35+
} as StarlightPageProps;
36+
---
37+
38+
<StarlightPage {...props}>
39+
<Width size="large" center={true}>
40+
<Stream id={entry.id} title={entry.title} chapters={entry.chapters} />
41+
</Width>
42+
</StarlightPage>

0 commit comments

Comments
 (0)