Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion docs/en/start.mdx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
sourceSHA: 166fda7d9b168a1be0333c3b744b7dffb18ccbd32f7f9c6da426ce4c980b4b8a
sourceSHA: fa1b3035de2eb1166334fa4c487575bc32fe4886a888be9b9a5efbf7486044cb
---

# Getting Started \{#start}
Expand Down Expand Up @@ -104,6 +104,7 @@ Options:
-a, --algolia [boolean|alauda] Whether to enable or use the alauda (docs.alauda.io) preset for Algolia search (default: false)
-S, --site-url Whether to enable the siteUrl for sitemap generation (default: false)
-n, --no-open Do not open the browser after starting the server
--lang <language> Specify the language of the documentation
-h, --help display help for command

Commands:
Expand Down
1 change: 1 addition & 0 deletions docs/zh/start.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,7 @@ Options:
-a, --algolia [boolean|alauda] Whether to enable or use the alauda (docs.alauda.io) preset for Algolia search (default: false)
-S, --site-url Whether to enable the siteUrl for sitemap generation (default: false)
-n, --no-open Do not open the browser after starting the server
--lang <language> Specify the language of the documentation
-h, --help display help for command

Commands:
Expand Down
1 change: 1 addition & 0 deletions packages/doom/src/cli/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,7 @@ program
false,
)
.option('-n, --no-open', 'Do not open the browser after starting the server')
.option('--lang <language>', 'Specify the language of the documentation')
.command('dev', { isDefault: true })
.description('Start the development server')
.argument('[root]', 'Root directory of the documentation')
Expand Down
8 changes: 8 additions & 0 deletions packages/doom/src/cli/load-config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -132,6 +132,7 @@ const getCommonConfig = async ({
editRepo,
algolia,
siteUrl,
lang,
}: {
config: UserConfig
configFilePath?: string
Expand All @@ -150,7 +151,12 @@ const getCommonConfig = async ({
editRepo?: boolean | string
algolia?: boolean | 'alauda' | 'alauda-ru'
siteUrl?: boolean
lang?: string
}): Promise<UserConfig> => {
if (lang != null) {
config.lang = lang
}

const fallbackToZh = 'lang' in config && !config.lang
root = resolveDocRoot(root, config.root)
const localBasePath = configFilePath ? path.dirname(configFilePath) : root
Expand Down Expand Up @@ -410,6 +416,7 @@ export async function loadConfig(
editRepo,
algolia,
siteUrl,
lang,
}: GlobalCliOptions = {},
): Promise<{
config: UserConfig
Expand Down Expand Up @@ -495,6 +502,7 @@ export async function loadConfig(
editRepo,
algolia,
siteUrl,
lang,
})

base = commonConfig.base!
Expand Down
1 change: 1 addition & 0 deletions packages/doom/src/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ export interface GlobalCliOptions {
editRepo?: boolean | string
algolia?: boolean | 'alauda'
siteUrl?: boolean
lang?: string
}

export interface TranslateOptions {
Expand Down
Loading