Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Docs Site] Create YouTubeVideos component #21414

Merged
merged 3 commits into from
Apr 7, 2025
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
109 changes: 109 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,7 @@
"starlight-image-zoom": "0.11.1",
"starlight-links-validator": "0.14.3",
"starlight-package-managers": "0.10.0",
"starlight-showcases": "0.3.0",
"strip-markdown": "6.0.0",
"svgo": "3.3.2",
"tailwindcss": "3.4.17",
Expand Down
16 changes: 16 additions & 0 deletions src/components/YouTubeVideos.astro
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
---
import { getCollection } from "astro:content";
import { ShowcaseYouTube } from "starlight-showcases";

const videos = await getCollection("videos", (entry) => {
return entry.data.link.startsWith("https://youtu");
});

const entries = videos.map((video) => ({
href: video.data.link,
title: video.data.id,
description: video.data.description,
}));
---

<ShowcaseYouTube entries={entries} />
1 change: 1 addition & 0 deletions src/components/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,7 @@ export { default as WorkersArchitectureDiagram } from "./WorkersArchitectureDiag
export { default as WorkersIsolateDiagram } from "./WorkersIsolateDiagram.astro";
export { default as WorkerStarter } from "./WorkerStarter.astro";
export { default as YouTube } from "./YouTube.astro";
export { default as YouTubeVideos } from "./YouTubeVideos.astro";

// Taken from Astro
export { default as ListCard } from "./astro/ListCard.astro";
Expand Down
11 changes: 11 additions & 0 deletions src/content/docs/style-guide/components/youtube-videos.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
---
title: YouTube Videos
styleGuide:
component: YouTubeVideos
---

```mdx live
import { YouTubeVideos } from "~/components";

<YouTubeVideos />
```
Loading