diff --git a/src/components/Stream.astro b/src/components/Stream.astro index dfac7032804a9fb..20f08e4dfe027df 100644 --- a/src/components/Stream.astro +++ b/src/components/Stream.astro @@ -2,6 +2,7 @@ import { z } from "astro:schema"; import { Badge } from "@astrojs/starlight/components"; import parse from "parse-duration"; +import Details from "./Details.astro"; type Props = z.input; @@ -12,12 +13,12 @@ const props = z thumbnail: z.string().optional(), chapters: z.record(z.string(), z.string()).optional(), showMoreVideos: z.boolean().default(false), + expandChapters: z.boolean().default(false), }) .strict(); -const { id, title, thumbnail, chapters, showMoreVideos } = props.parse( - Astro.props, -); +const { id, title, thumbnail, chapters, showMoreVideos, expandChapters } = + props.parse(Astro.props); const BASE_URL = `https://customer-1mwganm1ma0xgnmj.cloudflarestream.com/`; @@ -53,42 +54,43 @@ if (thumbnail) { { chapters && ( -

- Chapters -

-

+
+

+

+

+
) } diff --git a/src/content/docs/cache/index.mdx b/src/content/docs/cache/index.mdx index 3060b7c1e6115fe..cdc5b7182dea792 100644 --- a/src/content/docs/cache/index.mdx +++ b/src/content/docs/cache/index.mdx @@ -20,7 +20,7 @@ Cache content across Cloudflare's global server network. Cache stores copies of frequently accessed content (such as images, videos, or webpages) in geographically distributed data centers that are located closer to end users than origin servers, reducing server load and improving website performance. - + ## Features diff --git a/src/content/docs/learning-paths/r2-intro/series/r2-4.mdx b/src/content/docs/learning-paths/r2-intro/series/r2-4.mdx index 113dac21aa44139..2a720cb1a3d7e25 100644 --- a/src/content/docs/learning-paths/r2-intro/series/r2-4.mdx +++ b/src/content/docs/learning-paths/r2-intro/series/r2-4.mdx @@ -15,7 +15,7 @@ import { Render, Tabs, TabItem, Stream, Card } from "~/components"; In this video, you will learn how to use Cloudflare R2's data migration tools to transfer data from other cloud providers such as Amazon S3 and Google Cloud Storage to R2. The video will demonstrate the step-by-step process of setting up and executing a data migration. - + ` to add a collapsible container. ```mdx live -import { Details } from "~/components" +import { Details } from "~/components"; -
- Hello, world! -
+
Hello, world!
``` You can specify the default configuration of each instance of the `
` component (that is, whether it is open or closed by default). ```mdx live -import { Details } from "~/components" +import { Details } from "~/components"; -
- Long piece of code example. +
+ Long piece of code example.
``` + +## Properties + +- `header` +- `id` + + Adds a specific `id` to the HTML element + +- `open` diff --git a/src/content/docs/style-guide/components/stream.mdx b/src/content/docs/style-guide/components/stream.mdx index f2a7564feee7978..b5231af049cfc79 100644 --- a/src/content/docs/style-guide/components/stream.mdx +++ b/src/content/docs/style-guide/components/stream.mdx @@ -72,6 +72,14 @@ Either a timestamp (i.e `2.5s` or `1m35s`) or a URL to an image. Optional chapters displayed as cards below the video. +### `expandChapters` + +**type:** `boolean` + +**default:** `false` + +If `chapters` is present, is passed through to the `open` property of the [Details component](/style-guide/components/details/). + ### `showMoreVideos` **type:** `boolean`