-
-
Notifications
You must be signed in to change notification settings - Fork 49
Expand file tree
/
Copy pathdocusaurus.config.ts
More file actions
94 lines (80 loc) · 2.18 KB
/
docusaurus.config.ts
File metadata and controls
94 lines (80 loc) · 2.18 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
// eslint-disable-next-line import/no-unassigned-import
import 'dotenv/config';
import type { Config } from '@docusaurus/types';
import { yes } from '@silverhand/essentials';
import {
addAliasPlugin,
cfPagesBranch,
classicPresetConfig,
commonConfigs,
commonMarkdown,
commonStylesheets,
createCommonCustomFields,
createCommonThemeConfig,
currentLocale,
defaultLocale,
disableExpensiveBundlerOptimizationPlugin,
getCloudflareSubdomain,
googleOneTapScripts,
injectHeadTagsPlugin,
isCfPagesPreview,
localeConfigs,
mainSiteUrl,
} from './docusaurus-common.config';
import ogImageGenerator from './plugins/og-image-generator';
const getLogtoDocsUrl = () =>
isCfPagesPreview
? `https://${getCloudflareSubdomain(cfPagesBranch)}.logto-docs.pages.dev/`
: mainSiteUrl;
const config: Config = {
...commonConfigs,
url: getLogtoDocsUrl(),
scripts: googleOneTapScripts,
i18n: {
defaultLocale,
locales: ['de', 'en', 'es', 'fr', 'ja', 'ko', 'pt-BR', 'th', 'zh-CN', 'zh-TW'],
localeConfigs,
},
customFields: createCommonCustomFields({
inkeepApiKey: process.env.INKEEP_API_KEY,
logtoApiBaseUrl: process.env.LOGTO_API_BASE_URL,
isDevFeatureEnabled: yes(process.env.IS_DEV_FEATURE_ENABLED),
}),
staticDirectories: ['static', 'static-localized/' + currentLocale],
markdown: commonMarkdown,
trailingSlash: false,
presets: [['classic', classicPresetConfig]],
stylesheets: commonStylesheets,
themeConfig: createCommonThemeConfig('main'),
plugins: [
addAliasPlugin,
injectHeadTagsPlugin,
'docusaurus-plugin-sass',
ogImageGenerator,
disableExpensiveBundlerOptimizationPlugin,
[
'@docusaurus/plugin-content-blog',
{
id: 'terms',
routeBasePath: 'terms',
path: './terms',
blogSidebarCount: 0,
showReadingTime: false,
feedOptions: {},
},
],
[
'@docusaurus/plugin-content-blog',
{
id: 'about',
routeBasePath: 'about',
path: './about',
blogSidebarCount: 0,
showReadingTime: false,
feedOptions: {},
},
],
].filter(Boolean),
themes: ['@docusaurus/theme-mermaid'],
};
export default config;