Skip to content
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions src/content.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ import {
releaseNotesSchema,
fieldsSchema,
partialsSchema,
streamSchema,
} from "~/schemas";

function contentLoader(name: string) {
Expand Down Expand Up @@ -111,4 +112,8 @@ export const collections = {
loader: dataLoader("fields"),
schema: fieldsSchema,
}),
stream: defineCollection({
loader: dataLoader("stream"),
schema: streamSchema,
}),
};
11 changes: 11 additions & 0 deletions src/content/stream/example-video/index.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
id: streamid
title: Example Video
description: A Super cool video
products:
- workers
- workers-ai
chapters:
00:01: Chapter 1
00:02: Chapter 2
thumbnail:
url: https://example.com/foo.png
40 changes: 40 additions & 0 deletions src/content/stream/example-video/transcript.vtt
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
WEBVTT

00:11.000 --> 00:13.000
<v Roger Bingham>We are in New York City

00:13.000 --> 00:16.000
<v Roger Bingham>We're actually at the Lucern Hotel, just down the street

00:16.000 --> 00:18.000
<v Roger Bingham>from the American Museum of Natural History

00:18.000 --> 00:20.000
<v Roger Bingham>And with me is Neil deGrasse Tyson

00:20.000 --> 00:22.000
<v Roger Bingham>Astrophysicist, Director of the Hayden Planetarium

00:22.000 --> 00:24.000
<v Roger Bingham>at the AMNH.

00:24.000 --> 00:26.000
<v Roger Bingham>Thank you for walking down here.

00:27.000 --> 00:30.000
<v Roger Bingham>And I want to do a follow-up on the last conversation we did.

00:30.000 --> 00:31.500 align:right size:50%
<v Roger Bingham>When we e-mailed—

00:30.500 --> 00:32.500 align:left size:50%
<v Neil deGrasse Tyson>Didn't we talk about enough in that conversation?

00:32.000 --> 00:35.500 align:right size:50%
<v Roger Bingham>No! No no no no; 'cos 'cos obviously 'cos

00:32.500 --> 00:33.500 align:left size:50%
<v Neil deGrasse Tyson><i>Laughs</i>

00:35.500 --> 00:38.000
<v Roger Bingham>You know I'm so excited my glasses are falling off here.
1 change: 1 addition & 0 deletions src/schemas/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ export * from "./notifications";
export * from "./pages-build-environment";
export * from "./pages-framework-presets";
export * from "./partials";
export * from "./stream";
export * from "./videos";
export * from "./warp-releases";
export * from "./workers-ai-models";
21 changes: 21 additions & 0 deletions src/schemas/stream.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
import { z } from "astro:schema";
import { reference } from "astro:content";

export const streamSchema = z.object({
id: z.string(),
title: z.string(),
description: z.string(),
products: z.array(reference("products")),
chapters: z.record(z.string(), z.string()).optional(),
tags: z.array(z.string()).optional(),
thumbnail: z
.object({
url: z.string(),
})
.or(
z.object({
timestamp: z.string(),
}),
)
.optional(),
});
Loading