Oops probably should've committed, not even sure what's changed. Set up MDX, set up cv and print, set up dark mode, look at react query
This commit is contained in:
32
src/app/(root)/posts/[...slug]/page.tsx
Normal file
32
src/app/(root)/posts/[...slug]/page.tsx
Normal file
@@ -0,0 +1,32 @@
|
||||
import { glob } from "glob";
|
||||
|
||||
// type postMdx = {
|
||||
// metadata: {
|
||||
// title: string,
|
||||
// date: string,
|
||||
// coverImage: string,
|
||||
// blurb: string,
|
||||
// shortBlurb: string,
|
||||
// tags: string[]
|
||||
// }
|
||||
// }
|
||||
|
||||
export async function generateStaticParams(): Promise<{slug: string[]}[]> {
|
||||
const posts = await glob(`src/markdown/posts/[...slug]/**/*.mdx`, {
|
||||
nodir: true,
|
||||
});
|
||||
|
||||
const slugs = posts.map((post) => ({
|
||||
slug: post.replace('src/markdown/posts/[...slug]/', '').replace(/\.mdx$/, '').split('/')
|
||||
}));
|
||||
|
||||
return slugs;
|
||||
}
|
||||
|
||||
export default function Post({params}: {params: { slug: string[] }}): React.JSX.Element {
|
||||
return (
|
||||
<>
|
||||
{params.slug}
|
||||
</>
|
||||
);
|
||||
}
|
||||
Reference in New Issue
Block a user