@alauda/doom 1.13.2 → 1.13.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/lib/cli/index.js
CHANGED
|
@@ -46,6 +46,7 @@ program
|
|
|
46
46
|
.option('-a, --algolia [boolean|alauda]', 'Whether to enable or use the alauda (docs.alauda.io) preset for Algolia search', parseBooleanOrString, false)
|
|
47
47
|
.option('-S, --site-url', 'Whether to enable the siteUrl for sitemap generation', parseBoolean, false)
|
|
48
48
|
.option('-n, --no-open', 'Do not open the browser after starting the server')
|
|
49
|
+
.option('--lang <language>', 'Specify the language of the documentation')
|
|
49
50
|
.command('dev', { isDefault: true })
|
|
50
51
|
.description('Start the development server')
|
|
51
52
|
.argument('[root]', 'Root directory of the documentation')
|
package/lib/cli/load-config.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { type UserConfig } from '@rspress/core';
|
|
2
2
|
import type { GlobalCliOptions } from '../types.ts';
|
|
3
|
-
export declare function loadConfig(root?: string | URL, { config: configFile, base, prefix, v: version, download, export: export_, ignore, force, open, lazy, include, exclude, outDir, redirect, editRepo, algolia, siteUrl, }?: GlobalCliOptions): Promise<{
|
|
3
|
+
export declare function loadConfig(root?: string | URL, { config: configFile, base, prefix, v: version, download, export: export_, ignore, force, open, lazy, include, exclude, outDir, redirect, editRepo, algolia, siteUrl, lang, }?: GlobalCliOptions): Promise<{
|
|
4
4
|
config: UserConfig;
|
|
5
5
|
configFilePath: string;
|
|
6
6
|
}>;
|
package/lib/cli/load-config.js
CHANGED
|
@@ -64,7 +64,10 @@ const ALAUDA_RU_ALGOLIA_OPTIONS = {
|
|
|
64
64
|
apiKey: '786fa6da36fe76777d688387c0520c5b',
|
|
65
65
|
indexName: 'docs_alauda_io_gbnijigq50_pages',
|
|
66
66
|
};
|
|
67
|
-
const getCommonConfig = async ({ config, root, configFilePath, base, version, download, export: export_, ignore, force, open, lazy, include, exclude, redirect, editRepo, algolia, siteUrl, }) => {
|
|
67
|
+
const getCommonConfig = async ({ config, root, configFilePath, base, version, download, export: export_, ignore, force, open, lazy, include, exclude, redirect, editRepo, algolia, siteUrl, lang, }) => {
|
|
68
|
+
if (lang != null) {
|
|
69
|
+
config.lang = lang;
|
|
70
|
+
}
|
|
68
71
|
const fallbackToZh = 'lang' in config && !config.lang;
|
|
69
72
|
root = resolveDocRoot(root, config.root);
|
|
70
73
|
const localBasePath = configFilePath ? path.dirname(configFilePath) : root;
|
|
@@ -272,7 +275,7 @@ const findConfig = async (basePath) => {
|
|
|
272
275
|
}
|
|
273
276
|
}
|
|
274
277
|
};
|
|
275
|
-
export async function loadConfig(root, { config: configFile, base, prefix, v: version, download, export: export_, ignore, force, open, lazy, include, exclude, outDir, redirect, editRepo, algolia, siteUrl, } = {}) {
|
|
278
|
+
export async function loadConfig(root, { config: configFile, base, prefix, v: version, download, export: export_, ignore, force, open, lazy, include, exclude, outDir, redirect, editRepo, algolia, siteUrl, lang, } = {}) {
|
|
276
279
|
let configFilePath;
|
|
277
280
|
if (configFile) {
|
|
278
281
|
configFilePath = path.resolve(configFile);
|
|
@@ -344,6 +347,7 @@ export async function loadConfig(root, { config: configFile, base, prefix, v: ve
|
|
|
344
347
|
editRepo,
|
|
345
348
|
algolia,
|
|
346
349
|
siteUrl,
|
|
350
|
+
lang,
|
|
347
351
|
});
|
|
348
352
|
base = commonConfig.base;
|
|
349
353
|
const mergedConfig = mergeRsbuildConfig(commonConfig, config, {
|
|
@@ -17,12 +17,12 @@ const getNavMenu = () => {
|
|
|
17
17
|
}
|
|
18
18
|
return document.querySelector('.rspress-nav-menu');
|
|
19
19
|
};
|
|
20
|
-
const LEGACY_VERSIONS = ['
|
|
20
|
+
const LEGACY_VERSIONS = ['3.18.1', '3.18.0', '3.16', '3.14'];
|
|
21
21
|
const LEGACY_NAV_ITEMS = LEGACY_VERSIONS.map((v) => ({
|
|
22
22
|
text: v,
|
|
23
|
-
link: `https://
|
|
23
|
+
link: `https://cloud.alauda.cn/v3/document/navigation?version=v${v}&language=true`,
|
|
24
24
|
}));
|
|
25
|
-
const ALLOWED_LEGACY_DOMAINS = new Set(['docs.alauda.cn'
|
|
25
|
+
const ALLOWED_LEGACY_DOMAINS = new Set(['docs.alauda.cn']);
|
|
26
26
|
if (!isProduction()) {
|
|
27
27
|
ALLOWED_LEGACY_DOMAINS.add('localhost');
|
|
28
28
|
}
|
package/lib/types.d.ts
CHANGED