Skip to content

Commit 0de57d8

Browse files
committed
重构文档配置:删除旧的 objectdocs.json 文件,新增 docs.site.json 文件并更新相关路径
1 parent 1526dc2 commit 0de57d8

6 files changed

Lines changed: 76 additions & 7 deletions

File tree

packages/cli/src/commands/build.mjs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,10 +25,10 @@ export function registerBuildCommand(cli) {
2525
}
2626

2727
// Copy user config and assets to nextAppDir
28-
const userConfigPath = path.resolve(process.cwd(), 'content/objectdocs.json');
28+
const userConfigPath = path.resolve(process.cwd(), 'content/docs.site.json');
2929
if (fs.existsSync(userConfigPath)) {
3030
console.log(` Copying config from ${userConfigPath}`);
31-
fs.cpSync(userConfigPath, path.join(nextAppDir, 'objectdocs.json'));
31+
fs.cpSync(userConfigPath, path.join(nextAppDir, 'docs.site.json'));
3232
}
3333

3434
const userPublicPath = path.resolve(process.cwd(), 'public');

packages/cli/src/commands/dev.mjs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -44,9 +44,9 @@ export function registerDevCommand(cli) {
4444

4545
const startServer = () => {
4646
// Sync config and assets before starting
47-
const userConfigPath = path.resolve(process.cwd(), 'content/objectdocs.json');
47+
const userConfigPath = path.resolve(process.cwd(), 'content/docs.site.json');
4848
if (fs.existsSync(userConfigPath)) {
49-
fs.cpSync(userConfigPath, path.join(nextAppDir, 'objectdocs.json'));
49+
fs.cpSync(userConfigPath, path.join(nextAppDir, 'docs.site.json'));
5050
}
5151

5252
const userPublicPath = path.resolve(process.cwd(), 'public');
@@ -79,7 +79,7 @@ export function registerDevCommand(cli) {
7979
startServer();
8080

8181
// Watch for config changes
82-
const configFile = path.resolve(process.cwd(), 'content/objectdocs.json');
82+
const configFile = path.resolve(process.cwd(), 'content/docs.site.json');
8383
if (fs.existsSync(configFile)) {
8484
console.log(`Watching config: ${configFile}`);
8585
fs.watch(configFile, (eventType) => {

packages/cli/src/commands/start.mjs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ export function registerStartCommand(cli) {
2222
// 2. Check config
2323
let isStatic = false;
2424
try {
25-
const configPath = path.resolve(process.cwd(), 'content/objectdocs.json');
25+
const configPath = path.resolve(process.cwd(), 'content/docs.site.json');
2626
if (fs.existsSync(configPath)) {
2727
const config = JSON.parse(fs.readFileSync(configPath, 'utf-8'));
2828
if (config.build?.output === 'export') {

packages/site/docs.site.json

Lines changed: 69 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,69 @@
1+
{
2+
"meta": {
3+
"title": "ObjectStack Docs",
4+
"description": "Enterprise-grade low-code platform documentation",
5+
"url": "https://docs.objectstack.ai",
6+
"favicon": "/favicon.ico"
7+
},
8+
"i18n": {
9+
"enabled": true,
10+
"defaultLanguage": "en",
11+
"languages": ["en", "cn"
12+
]
13+
},
14+
"branding": {
15+
"logo": {
16+
"text": "ObjectStack",
17+
"light": "/logo.svg",
18+
"dark": "/logo.svg"
19+
},
20+
"theme": {
21+
"accentColor": "blue",
22+
"radius": "0.5rem"
23+
}
24+
},
25+
"layout": {
26+
"navbar": {
27+
"enabled": true,
28+
"transparentMode": "top",
29+
"links": [
30+
{
31+
"text": "Home",
32+
"url": "https://www.objectstack.ai",
33+
"external": true
34+
}
35+
],
36+
"socials": [
37+
{ "platform": "github", "url": "https://github.com/objectstack-ai/" }
38+
]
39+
},
40+
"sidebar": {
41+
"enabled": true,
42+
"prefetch": true,
43+
"defaultOpenLevel": 1,
44+
"collapsible": true,
45+
"tabs": []
46+
},
47+
"toc": {
48+
"enabled": true,
49+
"depth": 3
50+
},
51+
"footer": {
52+
"enabled": false,
53+
"copyright": "© 2026 ObjectStack Inc."
54+
}
55+
},
56+
"page": {
57+
"showLastUpdate": true,
58+
"showEditLink": true,
59+
"repoBaseUrl": "https://github.com/objectstack-ai/docs"
60+
},
61+
"content": {
62+
"math": false,
63+
"imageZoom": true,
64+
"codeBlock": {
65+
"theme": "vesper",
66+
"showLineNumbers": true
67+
}
68+
}
69+
}

packages/site/lib/site-config.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { deepMerge } from './deep-merge';
2-
import objectDocsConfig from '@/objectdocs.json';
2+
import objectDocsConfig from '@/docs.site.json';
33

44
export interface SiteConfig {
55
meta: {

0 commit comments

Comments
 (0)