Add posts dyno route

This commit is contained in:
Cassidy Williams committed 2022-08-25 23:59:55 -05:00
1 parent f22b6158cb
commit 463ee505e8
1 file changed
+14
+14
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