Skip to content

Commit 7848c0c

Browse files
committed
chore: replace contentlayer with fumadocs-mdx in next.config.mjs, update package.json and pnpm-lock.yaml with new dependencies
1 parent 62f8a9c commit 7848c0c

7 files changed

Lines changed: 886 additions & 10 deletions

File tree

.source/index.ts

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
// @ts-nocheck -- skip type checking
2+
import * as docs_7 from "../app/docs/computer-science/data-structures/linked-list/index.mdx?collection=docs&hash=1757698225160"
3+
import * as docs_6 from "../app/docs/computer-science/data-structures/linked-list/01-singly-linked-list.mdx?collection=docs&hash=1757698225160"
4+
import * as docs_5 from "../app/docs/computer-science/data-structures/array/index.mdx?collection=docs&hash=1757698225160"
5+
import * as docs_4 from "../app/docs/computer-science/data-structures/array/02-dynamic-array.mdx?collection=docs&hash=1757698225160"
6+
import * as docs_3 from "../app/docs/computer-science/data-structures/array/01-static-array.mdx?collection=docs&hash=1757698225160"
7+
import * as docs_2 from "../app/docs/computer-science/data-structures/index.mdx?collection=docs&hash=1757698225160"
8+
import * as docs_1 from "../app/docs/guide/HelloWorld.md?collection=docs&hash=1757698225160"
9+
import * as docs_0 from "../app/docs/computer-science/index.mdx?collection=docs&hash=1757698225160"
10+
import { _runtime } from "fumadocs-mdx"
11+
import * as _source from "../source.config"
12+
export const docs = _runtime.docs<typeof _source.docs>([{ info: {"path":"computer-science\\index.mdx","absolutePath":"D:/work/involutionhell.github.io/app/docs/computer-science/index.mdx"}, data: docs_0 }, { info: {"path":"guide\\HelloWorld.md","absolutePath":"D:/work/involutionhell.github.io/app/docs/guide/HelloWorld.md"}, data: docs_1 }, { info: {"path":"computer-science\\data-structures\\index.mdx","absolutePath":"D:/work/involutionhell.github.io/app/docs/computer-science/data-structures/index.mdx"}, data: docs_2 }, { info: {"path":"computer-science\\data-structures\\array\\01-static-array.mdx","absolutePath":"D:/work/involutionhell.github.io/app/docs/computer-science/data-structures/array/01-static-array.mdx"}, data: docs_3 }, { info: {"path":"computer-science\\data-structures\\array\\02-dynamic-array.mdx","absolutePath":"D:/work/involutionhell.github.io/app/docs/computer-science/data-structures/array/02-dynamic-array.mdx"}, data: docs_4 }, { info: {"path":"computer-science\\data-structures\\array\\index.mdx","absolutePath":"D:/work/involutionhell.github.io/app/docs/computer-science/data-structures/array/index.mdx"}, data: docs_5 }, { info: {"path":"computer-science\\data-structures\\linked-list\\01-singly-linked-list.mdx","absolutePath":"D:/work/involutionhell.github.io/app/docs/computer-science/data-structures/linked-list/01-singly-linked-list.mdx"}, data: docs_6 }, { info: {"path":"computer-science\\data-structures\\linked-list\\index.mdx","absolutePath":"D:/work/involutionhell.github.io/app/docs/computer-science/data-structures/linked-list/index.mdx"}, data: docs_7 }], [])

lib/source.ts

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
import { docs } from '@/.source';
2+
import { loader } from 'fumadocs-core/source';
3+
4+
export const source = loader({
5+
baseUrl: '/docs',
6+
source: docs.toFumadocsSource(),
7+
});

next.config.mjs

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,13 @@
11
// next.config.mjs
2-
import { withContentlayer } from 'next-contentlayer'
2+
import { createMDX } from 'fumadocs-mdx/next';
33

4-
export default withContentlayer({
4+
const withMDX = createMDX();
5+
6+
/** @type {import('next').NextConfig} */
7+
const config = {
58
reactStrictMode: true,
69
output: 'export', // 关键:静态导出到 /out
710
images: { unoptimized: true }, // 避免使用 Next Image 优化服务
8-
})
11+
};
12+
13+
export default withMDX(config);

package.json

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,13 +6,15 @@
66
"dev": "next dev",
77
"build": "next build",
88
"start": "next start",
9-
"check:content": "contentlayer build"
9+
"postinstall": "fumadocs-mdx"
1010
},
1111
"dependencies": {
1212
"@types/mdx": "^2.0.13",
1313
"class-variance-authority": "^0.7.1",
1414
"clsx": "^2.1.1",
15+
"fumadocs-core": "^15.7.11",
1516
"fumadocs-mdx": "^11.9.1",
17+
"fumadocs-ui": "^15.7.11",
1618
"lucide-react": "^0.544.0",
1719
"next": "^15.5.3",
1820
"react": "^19.1.1",

0 commit comments

Comments
 (0)