import { readFile } from "node:fs/promises" import remarkFrontmatter from "remark-frontmatter" import remarkParse from "remark-parse" import type { LoaderFunction } from "remix" import { Link, Outlet } from "remix" import { unified } from "unified" import { SideNav } from "~/components/side-nav" import { SidebarLayout } from "~/components/sidebar-layout" import { linkClass } from "~/styles" export const loader: LoaderFunction = async () => { const glob = await import("fast-glob") const contentFiles = await glob.default(["**/*.mdx", "**/*.md"], { cwd: "content", absolute: true, }) const contentModules = await Promise.all( contentFiles.map(async (filePath) => { const content = await readFile(filePath, "utf8") const result = await unified() .use(remarkParse) .use(remarkFrontmatter) .process(content) return { filePath, result: result.toString() } }), ) console.log(contentModules) return {} } export default function Docs() { return ( Getting Started Embeds Buttons Select Menus } body={
} /> ) }