Skip to content

Commit c501d38

Browse files
committed
Remove support for Chinese docs source
Eliminates loading and configuration for the Chinese documentation source by removing related environment variable handling, config entries, and source merging. This simplifies the documentation setup to only use the main docs directory.
1 parent f6c0a71 commit c501d38

3 files changed

Lines changed: 10 additions & 16 deletions

File tree

packages/cli/src/commands/start.mjs

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -51,13 +51,18 @@ export function registerStartCommand(cli) {
5151
console.log('Starting Next.js production server...');
5252
console.log(` Engine: ${nextAppDir}`);
5353

54+
const docsDir = path.resolve(process.cwd(), 'content/docs');
55+
56+
const env = {
57+
...process.env,
58+
DOCS_DIR: docsDir
59+
};
60+
61+
5462
const child = spawn('npm', ['start'], {
5563
cwd: nextAppDir,
5664
stdio: 'inherit',
57-
env: {
58-
...process.env,
59-
DOCS_DIR: path.resolve(process.cwd(), 'content/docs')
60-
}
65+
env: env
6166
});
6267
}
6368
});

packages/site/lib/source.ts

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,15 @@
11
import { loader } from 'fumadocs-core/source';
2-
import { docs, meta, docsZh, metaZh } from '@/.source/server';
2+
import { docs, meta } from '@/.source/server';
33
import { toFumadocsSource } from 'fumadocs-mdx/runtime/server';
44
import { i18n } from './i18n';
55

66
const mainSource = toFumadocsSource(docs, meta);
7-
const zhSource = toFumadocsSource(docsZh, metaZh);
87

98
export const source = loader({
109
baseUrl: '/docs',
1110
source: {
1211
files: [
1312
...mainSource.files,
14-
...zhSource.files.map((file) => ({
15-
...file,
16-
locale: 'zh-CN',
17-
})),
1813
],
1914
},
2015
i18n,

packages/site/source.config.ts

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@ import fs from 'node:fs';
55

66
function resolveContentDir(dir: string) {
77
if (process.env.DOCS_DIR && dir === 'content/docs') return process.env.DOCS_DIR;
8-
if (process.env.DOCS_ZH_DIR && dir === 'content/docs-zh-CN') return process.env.DOCS_ZH_DIR;
98

109
// Try local first (Root deployment)
1110
if (fs.existsSync(path.resolve(dir))) return dir;
@@ -18,16 +17,11 @@ function resolveContentDir(dir: string) {
1817
}
1918

2019
const docsDir = resolveContentDir('content/docs');
21-
const docsZhDir = resolveContentDir('content/docs-zh-CN');
2220

2321
export const { docs, meta } = defineDocs({
2422
dir: docsDir,
2523
});
2624

27-
export const { docs: docsZh, meta: metaZh } = defineDocs({
28-
dir: docsZhDir,
29-
});
30-
3125
export default defineConfig({
3226
mdxOptions: {
3327
rehypeCodeOptions: {

0 commit comments

Comments
 (0)