Skip to content

Commit 6965e30

Browse files
committed
[Docs Site] Add Stream content collection
1 parent b86d6d8 commit 6965e30

File tree

5 files changed

+78
-0
lines changed

5 files changed

+78
-0
lines changed

src/content.config.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ import {
2121
releaseNotesSchema,
2222
fieldsSchema,
2323
partialsSchema,
24+
streamSchema,
2425
} from "~/schemas";
2526

2627
function contentLoader(name: string) {
@@ -111,4 +112,8 @@ export const collections = {
111112
loader: dataLoader("fields"),
112113
schema: fieldsSchema,
113114
}),
115+
stream: defineCollection({
116+
loader: dataLoader("stream"),
117+
schema: streamSchema,
118+
}),
114119
};
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
id: streamid
2+
title: Example Video
3+
description: A Super cool video
4+
products:
5+
- workers
6+
- workers-ai
7+
chapters:
8+
00:01: Chapter 1
9+
00:02: Chapter 2
10+
thumbnail:
11+
url: https://example.com/foo.png
Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
WEBVTT
2+
3+
00:11.000 --> 00:13.000
4+
<v Roger Bingham>We are in New York City
5+
6+
00:13.000 --> 00:16.000
7+
<v Roger Bingham>We're actually at the Lucern Hotel, just down the street
8+
9+
00:16.000 --> 00:18.000
10+
<v Roger Bingham>from the American Museum of Natural History
11+
12+
00:18.000 --> 00:20.000
13+
<v Roger Bingham>And with me is Neil deGrasse Tyson
14+
15+
00:20.000 --> 00:22.000
16+
<v Roger Bingham>Astrophysicist, Director of the Hayden Planetarium
17+
18+
00:22.000 --> 00:24.000
19+
<v Roger Bingham>at the AMNH.
20+
21+
00:24.000 --> 00:26.000
22+
<v Roger Bingham>Thank you for walking down here.
23+
24+
00:27.000 --> 00:30.000
25+
<v Roger Bingham>And I want to do a follow-up on the last conversation we did.
26+
27+
00:30.000 --> 00:31.500 align:right size:50%
28+
<v Roger Bingham>When we e-mailed—
29+
30+
00:30.500 --> 00:32.500 align:left size:50%
31+
<v Neil deGrasse Tyson>Didn't we talk about enough in that conversation?
32+
33+
00:32.000 --> 00:35.500 align:right size:50%
34+
<v Roger Bingham>No! No no no no; 'cos 'cos obviously 'cos
35+
36+
00:32.500 --> 00:33.500 align:left size:50%
37+
<v Neil deGrasse Tyson><i>Laughs</i>
38+
39+
00:35.500 --> 00:38.000
40+
<v Roger Bingham>You know I'm so excited my glasses are falling off here.

src/schemas/index.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ export * from "./notifications";
1010
export * from "./pages-build-environment";
1111
export * from "./pages-framework-presets";
1212
export * from "./partials";
13+
export * from "./stream";
1314
export * from "./videos";
1415
export * from "./warp-releases";
1516
export * from "./workers-ai-models";

src/schemas/stream.ts

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
import { z } from "astro:schema";
2+
import { reference } from "astro:content";
3+
4+
export const streamSchema = z.object({
5+
id: z.string(),
6+
title: z.string(),
7+
description: z.string(),
8+
products: z.array(reference("products")),
9+
chapters: z.record(z.string(), z.string()).optional(),
10+
tags: z.array(z.string()).optional(),
11+
thumbnail: z
12+
.object({
13+
url: z.string(),
14+
})
15+
.or(
16+
z.object({
17+
timestamp: z.string(),
18+
}),
19+
)
20+
.optional(),
21+
});

0 commit comments

Comments
 (0)