Add posts dyno route

This commit is contained in:
Cassidy Williams
2022-08-25 23:59:55 -05:00
parent f22b6158cb
commit 463ee505e8

14
src/pages/[post].astro Normal file
View File

@@ -0,0 +1,14 @@
---
// Credit to @rachsmithcodes for this function
export async function getStaticPaths() {
let posts = await Astro.glob(`./posts/*.md`);
return posts.map((post) => ({
params: { slug: post.frontmatter.slug },
props: { post: post },
}));
}
---
hey