diff --git a/src/pages/posts/[slug].astro b/src/pages/posts/[slug].astro new file mode 100644 index 0000000..8d9ff80 --- /dev/null +++ b/src/pages/posts/[slug].astro @@ -0,0 +1,50 @@ +--- +import Header from "@components/Header.astro"; +import Layout from "@layouts/Layout.astro"; +import type { MarkdownInstance } from "astro"; + +export interface Props { + post: MarkdownInstance>; +} + +export async function getStaticPaths() { + const posts = await Astro.glob("../../contents/*.md"); + + return posts.map((post) => { + return { + params: { + slug: post.frontmatter.slug, + }, + props: { + post, + frontmatter: post.frontmatter, + }, + }; + }); +} + +const { Content, frontmatter } = Astro.props.post; +--- + + +
+
+

{frontmatter.title}

+
+ +
+
+ + +