Skip to content

Commit eb3fe55

Browse files
committed
chore: added comments
1 parent 08c8431 commit eb3fe55

File tree

2 files changed

+9
-1
lines changed

2 files changed

+9
-1
lines changed

source.config.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,13 @@ import { remarkMdxMermaid } from "fumadocs-core/mdx-plugins";
77
// see https://fumadocs.vercel.app/docs/mdx/collections#define-docs
88
export const docs = defineDocs({
99
dir: "content",
10+
// Async mode - enables runtime compilation for faster dev server startup
1011
docs: {
1112
async: true,
1213
},
14+
// To switch back to sync mode (pre-compilation), comment out the docs config above and uncomment below:
15+
// (sync mode - pre-compiles all content at build time)
16+
// No additional config needed for sync mode - just remove the docs config
1317
});
1418

1519
export default defineConfig({

src/app/(docs)/[...slug]/page.tsx

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,13 @@ export default async function Page(props: {
1616
const page = source.getPage(params.slug);
1717
if (!page) notFound();
1818

19-
// Load the compiled content asynchronously
19+
// Async mode - load the compiled content at runtime
2020
const { body: MDXContent, toc } = await page.data.load();
2121

22+
// To switch back to sync mode, comment out the line above and uncomment below:
23+
// const MDXContent = page.data.body;
24+
// const toc = page.data.toc;
25+
2226
return (
2327
<DocsPage toc={toc} full={page.data.full}>
2428
<DocsTitle>{page.data.title}</DocsTitle>

0 commit comments

Comments
 (0)