diff --git a/packages/marketing/content-collections.ts b/packages/marketing/content-collections.ts index 95d7337..1935135 100644 --- a/packages/marketing/content-collections.ts +++ b/packages/marketing/content-collections.ts @@ -30,6 +30,33 @@ function transformWikiLinks(content: string): string { }); } +const pages = defineCollection({ + name: "pages", + directory: "./src/pages", + include: "**/*.mdx", + schema: z.object({ + title: z.string(), + description: z.string().optional(), + content: z.string(), + }), + transform: async (document, context) => { + const mdx = await compileMDX(context, document, { + remarkPlugins: [remarkGfm], + rehypePlugins: [ + rehypeSlug, + [rehypeAutolinkHeadings, { behavior: "wrap" }], + [rehypePrettyCode, { theme: "github-dark" }], + ], + }); + + return { + ...document, + slug: document._meta.path, + mdx, + }; + }, +}); + const posts = defineCollection({ name: "posts", directory: "./src/content", @@ -81,5 +108,5 @@ const posts = defineCollection({ }); export default defineConfig({ - collections: [posts], + collections: [pages, posts], }); diff --git a/packages/marketing/src/components/ui/navbar.tsx b/packages/marketing/src/components/ui/navbar.tsx index 353b01c..34503db 100644 --- a/packages/marketing/src/components/ui/navbar.tsx +++ b/packages/marketing/src/components/ui/navbar.tsx @@ -24,6 +24,9 @@ export function NavBar() { LaxDB