diff --git a/src/components/VideoHeader.astro b/src/components/VideoHeader.astro new file mode 100644 index 000000000..e6efc49f1 --- /dev/null +++ b/src/components/VideoHeader.astro @@ -0,0 +1,36 @@ +--- +import type { VideoFileType } from '../lib/video'; + +export interface Props { + video: VideoFileType; +} + +const { video } = Astro.props; +const { frontmatter } = video; +const { author } = frontmatter; +--- + +
+
+ +

+ {frontmatter.title} +

+ +
+
diff --git a/src/pages/videos/[videoId].astro b/src/pages/videos/[videoId].astro new file mode 100644 index 000000000..47cde47fe --- /dev/null +++ b/src/pages/videos/[videoId].astro @@ -0,0 +1,32 @@ +--- +import VideoHeader from '../../components/VideoHeader.astro'; +import BaseLayout from '../../layouts/BaseLayout.astro'; +import { getAllVideos, VideoFileType } from '../../lib/video'; +import '../../styles/prism.css'; + +export interface Props { + video: VideoFileType; +} + +export async function getStaticPaths() { + const videos = await getAllVideos(); + + return videos.map((video) => ({ + params: { videoId: video.id }, + props: { video }, + })); +} + +const { videoId } = Astro.params; +const { video } = Astro.props; +--- + + + + +
+
+ +
+
+