-
Notifications
You must be signed in to change notification settings - Fork 37
/
docusaurus.config.js
64 lines (61 loc) · 1.56 KB
/
docusaurus.config.js
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
/** @type {import('@docusaurus/types').DocusaurusConfig} */
const navbar = require('./config/navbar');
const footer = require('./config/footer');
const config = {
title: '飞冰',
tagline: '基于 React 的研发解决方案',
url: 'https://ice.work',
baseUrl: '/',
onBrokenLinks: 'throw',
onBrokenMarkdownLinks: 'throw',
favicon: 'img/favicon.ico',
organizationName: 'alibaba',
projectName: 'ice',
themeConfig: {
// announcementBar: {
// id: 'announcementBar-2',
// content: 'icejs 2.0 版本已发布,支持 Webpack 5 和 Vite 两种构建模式,点击 <a href="/docs/guide/upgrade">快速升级</a>',
// isCloseable: true,
// },
navbar,
footer,
algolia: {
apiKey: '9f94c7d8e513c03a12532232800728e1',
indexName: 'ice',
appId: 'X14VR8TBX5',
},
},
presets: [
[
'@docusaurus/preset-classic',
{
docs: {
sidebarPath: require.resolve('./config/sidebars.js'),
editUrl:
'https://github.com/ice-lab/site/edit/master/',
},
theme: {
customCss: require.resolve('./src/css/custom.css'),
},
gtag: {
trackingID: 'G-QZ0FEKY38G',
},
},
],
],
plugins: [
require.resolve("./plugins/redirect.js")
]
};
if (process.env.USE_LOCAL_SEARCH) {
// 内部站点无法使用 algolia
delete config.themeConfig.algolia;
config.plugins.push([
require.resolve("@easyops-cn/docusaurus-search-local"),
{
hashed: true,
language: ["en", "zh"],
},
]);
}
module.exports = config;