File tree Expand file tree Collapse file tree 1 file changed +42
-0
lines changed Expand file tree Collapse file tree 1 file changed +42
-0
lines changed Original file line number Diff line number Diff line change 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 >
You can’t perform that action at this time.
0 commit comments