-
Notifications
You must be signed in to change notification settings - Fork 209
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
5f3ab97
commit 0c86469
Showing
6 changed files
with
77 additions
and
18 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
import { EmbedVideo } from "../_components/EmbedVideo.tsx"; | ||
import { ExampleFromFileSystem } from "../types.ts"; | ||
|
||
type Props = { example: ExampleFromFileSystem }; | ||
|
||
export default function VideoPage({ example }: Props) { | ||
return ( | ||
<> | ||
<EmbedVideo id={example.externalURL} /> | ||
<div className="my-12"> | ||
Find more videos in the <a href="/learn/">Learning Hub</a> and on our | ||
{" "}<a href="https://www.youtube.com/@deno_land">YouTube channel</a>. | ||
</div> | ||
</> | ||
); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
import { walkSync } from "@std/fs/walk"; | ||
import ExamplePage from "./_pages/ExamplePage.tsx"; | ||
import VideoPage from "./_pages/VideoPage.tsx"; | ||
import { ExampleFromFileSystem } from "./types.ts"; | ||
import { parseExample } from "./utils/parseExample.ts"; | ||
import { sidebar as sidebar_ } from "./tutorials/_data.ts"; | ||
|
||
export const layout = "doc.tsx"; | ||
// export const layout = "raw_with_sidebar.tsx"; | ||
|
||
export const sidebar = sidebar_; | ||
export const toc = []; | ||
|
||
export default function* (_data: Lume.Data, helpers: Lume.Helpers) { | ||
// flatten the sidebar object into a single array of items | ||
const flattenedVideos = sidebar.flatMap((item) => item.items); | ||
const videos = flattenedVideos.filter((item) => item.type === "video"); | ||
|
||
// Generate a page for each item listed in the data | ||
for (const video of videos) { | ||
yield { | ||
url: `${video.id}/index.html`, | ||
title: `${video.label}`, | ||
content: <VideoPage example={video} />, | ||
}; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters