From 463ee505e89660e9395c96e96144a102fe5b83df Mon Sep 17 00:00:00 2001 From: Cassidy Williams <1454517+cassidoo@users.noreply.github.com> Date: Thu, 25 Aug 2022 23:59:55 -0500 Subject: [PATCH] Add posts dyno route --- src/pages/[post].astro | 14 ++++++++++++++ 1 file changed, 14 insertions(+) create mode 100644 src/pages/[post].astro diff --git a/src/pages/[post].astro b/src/pages/[post].astro new file mode 100644 index 0000000..ebcc8e0 --- /dev/null +++ b/src/pages/[post].astro @@ -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 \ No newline at end of file