forked from iotaledger/iota-wiki
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdocusaurus.config.js
63 lines (57 loc) · 1.4 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
const { glob, merge } = require('./src/utils/config');
const path = require('path');
const {
ENVIRONMENT = 'iota',
EXTERNAL = '',
MODE = 'development',
} = process.env;
if (!['iota', 'shimmer', 'next'].includes(ENVIRONMENT)) {
throw "Set ENVIRONMENT to 'iota', 'shimmer', or 'next'";
}
if (!['development', 'production'].includes(MODE)) {
throw "Set MODE to 'development', or 'production'";
}
const isProduction = MODE === 'production';
const external = glob(EXTERNAL, path.join(ENVIRONMENT, 'external'));
const tutorials = require('./tutorials/docusaurus.config');
const common = require('./common/docusaurus.config');
const environment = require(`./${ENVIRONMENT}/docusaurus.config`);
const search = {
themeConfig: {
algolia: {
appId: 'YTLE56KAO4',
apiKey: '75358d60d302f7f93f630d63128abb03',
indexName: 'iota',
contextualSearch: true,
searchParameters: {
facetFilters: [`environment:${ENVIRONMENT}`],
},
},
},
};
const production = {
themeConfig: {
matomo: {
matomoUrl: 'https://matomo.iota-community.org/',
siteId: '13',
},
},
plugins: [
'docusaurus-plugin-matomo',
[
'@docusaurus/plugin-google-gtag',
{
trackingID: 'G-KVB88SVNF8',
anonymizeIP: true,
},
],
],
};
module.exports = merge(
...external,
tutorials,
common,
environment,
search,
isProduction ? production : {},
);