-
Notifications
You must be signed in to change notification settings - Fork 4
/
docusaurus.config.js
159 lines (150 loc) · 4.79 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
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
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
// @ts-check
// Note: type annotations allow type checking and IDEs autocompletion
const path = require('path');
const objectivEnvironment = process.env.OBJECTIV_ENVIRONMENT ?? 'development';
const nodeEnv = process.env.NODE_ENV;
// Ensure that production builds are not run on local machines, and vice versa
if (nodeEnv !== objectivEnvironment) {
throw new Error("WARNING: NODE_ENV ("+nodeEnv+") and OBJECTIV_ENVIRONMENT (" + objectivEnvironment + ") "
+ "are not equal");
}
const isProductionEnv = objectivEnvironment ? objectivEnvironment.startsWith('prod') : false;
const isStagingEnv = objectivEnvironment ? (objectivEnvironment.startsWith('staging')) : false;
const websiteUrl = isStagingEnv ? 'https://staging.objectiv.io/' : 'https://objectiv.io/';
const baseUrl = '/';
const trackerApplicationId = isProductionEnv ? (isStagingEnv? 'objectiv-website-staging' : 'objectiv-website') : 'objectiv-website-dev';
const trackerEndPoint = (isProductionEnv) ? 'https://collector.objectiv.io' : 'http://localhost:5000';
const trackerConsoleEnabled = !isProductionEnv;
const postBuildPlugin = !isStagingEnv ? path.resolve(__dirname, 'src/plugins/post-build/') : (function noPlugin() { return null });
const slackJoinLink = 'https://join.slack.com/t/objectiv-io/shared_invite/zt-u6xma89w-DLDvOB7pQer5QUs5B_~5pg';
/** @type {import('@docusaurus/types').Config} */
const config = {
title: 'Objectiv - creating the ultimate workflow for data scientists',
titleDelimiter: '|',
tagline: 'A data collection & modeling library that puts the data scientist first.', //meta description, and og:description
baseUrl: baseUrl,
url: websiteUrl,
favicon: 'img/favicon/favicon.ico',
organizationName: 'objectiv', // Usually your GitHub org/user name.
projectName: 'objectiv.io', // Usually your repo name.
onBrokenLinks: 'log',
onBrokenMarkdownLinks: 'throw',
trailingSlash: true,
presets: [
[
'@docusaurus/preset-classic',
/** @type {import('@docusaurus/preset-classic').Options} */
({
theme: {
customCss: require.resolve('./src/css/custom.css'),
},
docs: false,
blog: false,
sitemap: {
changefreq: 'weekly',
priority: 0.5,
},
}),
],
],
plugins: [
path.resolve(__dirname, 'src/plugins/favicons/'),
postBuildPlugin,
require.resolve('docusaurus-plugin-image-zoom')
],
scripts: [
{
src: 'https://consent.cookiebot.com/uc.js?cbid=7498452c-872b-431a-9859-21045f83f0a0',
'data-cbid': '7498452c-872b-431a-9859-21045f83f0a0',
'data-blockingmode': 'auto',
id: 'Cookiebot'
},
],
customFields: {
trackerApplicationId: trackerApplicationId,
trackerEndPoint: trackerEndPoint,
slackJoinLink: slackJoinLink,
trackerConsoleEnabled: trackerConsoleEnabled
},
themeConfig:
/** @type {import('@docusaurus/preset-classic').ThemeConfig} */
({
colorMode: {
disableSwitch: true,
},
navbar: {
title: '',
hideOnScroll: false,
logo: {
alt: 'Objectiv Logo',
src: 'img/logo-objectiv.svg',
},
items: [
{
label: 'Docs',
to: websiteUrl + 'docs', // ensure Docusaurus redirects to standalone docs
target: '_self'
},
{
to: 'about',
label: 'About Us',
},
{
href: 'https://github.com/objectiv/objectiv-analytics',
label: 'GitHub',
position: 'right',
className: 'navItem navGitHub',
},
{
href: slackJoinLink,
label: 'Slack',
position: 'right',
className: 'navItem navSlack',
},
{
href: 'https://twitter.com/objectiv_io',
label: 'Twitter',
position: 'right',
className: 'navItem navTwitter',
},
{
href: 'mailto:[email protected]',
label: 'Contact Us',
position: 'right',
className: 'navItem navEmail',
},
],
},
footer: {
style: 'light',
copyright: `Copyright © ${new Date().getFullYear()} Objectiv`,
links: [
{
items: [
{
label: 'Privacy Policy',
to: 'privacy/',
},
{
label: 'Cookies',
to: 'privacy/cookies',
},
],
},
],
},
zoom: {
config: {
background: {
light: 'rgb(255, 255, 255)',
dark: 'rgb(50, 50, 50)'
}
}
}
})
};
module.exports = config;
console.log("OBJECTIV TRACKER APPLICATION ID:", config.customFields.trackerApplicationId);
console.log("OBJECTIV TRACKER ENDPOINT:", config.customFields.trackerEndPoint);
console.log("DOCUSAURUS URL:", config.baseUrl);
console.log("DOCUSAURUS BASEURL:", config.baseUrl);