Improve docs

This commit is contained in:
Fuma Nama
2025-11-17 23:38:29 +08:00
parent 92ff4fd9b6
commit 532ef0649e
2 changed files with 14 additions and 1 deletions
+1 -1
View File
@@ -39,7 +39,7 @@ export default async function Page(props: PageProps<'/blog/[slug]'>) {
<p className="text-fd-muted-foreground mb-8">{page.data.description}</p>
<div className="prose min-w-0 flex-1">
<div className="flex flex-row items-center gap-2 mb-8 not-prose">
<div className="flex flex-row gap-2 mb-8 not-prose">
<ShareButton url={page.url} />
<Link
href="/blog"
+13
View File
@@ -41,6 +41,19 @@ import { docs } from 'fumadocs-mdx:collections/dynamic';
import browserCollections from 'fumadocs-mdx:collections/browser';
```
To use `loader()` with doc collections, use the new `toFumadocsSource()` utility instead.
```ts
import { blogPosts } from 'fumadocs-mdx:collections/server';
import { toFumadocsSource } from 'fumadocs-mdx/runtime/server';
import { loader } from 'fumadocs-core/source';
export const blog = loader({
baseUrl: '/blog',
source: toFumadocsSource(blogPosts, []),
});
```
### Async & Dynamic Mode
On Next.js, **Async Mode** now aligns with the behaviour on Vite to generate async imports. This enables server-side chunking to improve memory usage.