forked from facebook/sapling
-
Notifications
You must be signed in to change notification settings - Fork 1
/
docusaurus.config.js
195 lines (184 loc) · 5.52 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
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
/**
* Copyright (c) Meta Platforms, Inc. and affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*
* @format
*/
// @ts-check
// Note: type annotations allow type checking and IDEs autocompletion
const {fbContent} = require('docusaurus-plugin-internaldocs-fb/internal');
// Sapling specific constants
const {gitHubRepo, gitHubRepoName} = require('./constants');
// Footer URLS
const twitter = 'https://twitter.com/MetaOpenSource';
const openSourceWebsite = 'https://opensource.fb.com/';
const watchmanRepo = 'https://github.com/facebook/watchman';
const ghstackRepo = 'https://github.com/ezyang/ghstack';
const vsCodeRepo = 'https://github.com/facebookexperimental/fb-vscode';
const discord = 'https://discord.gg/X6baZ94Vzh';
/** @type {import('@docusaurus/types').Config} */
const config = {
title: 'Sapling',
tagline: 'A Scalable, User-Friendly Source Control System',
url: 'https://sapling-scm.com',
baseUrl: '/',
onBrokenLinks: 'throw',
onBrokenMarkdownLinks: 'warn',
favicon: 'img/Sapling_favicon-light-green-transparent-big.svg',
future: {
experimental_faster: true,
},
// GitHub pages deployment config.
// If you aren't using GitHub pages, you don't need these.
organizationName: 'facebook',
projectName: gitHubRepoName,
presets: [
[
require.resolve('docusaurus-plugin-internaldocs-fb/docusaurus-preset'),
/** @type {import('@docusaurus/preset-classic').Options} */
{
docs: {
sidebarPath: require.resolve('./sidebars.js'),
editUrl: fbContent({
internal: 'https://www.internalfb.com/code/fbsource/fbcode/eden/website/',
// This does not exist yet...
external: 'https://github.com/facebook/sapling/tree/main/website',
}),
remarkPlugins: [
[require('remark-github'), {repository: 'facebook/sapling'}],
require('sapling-output-plugin'),
],
},
staticDocsProject: 'sapling',
trackingFile: 'fbcode/staticdocs/WATCHED_FILES',
'remark-code-snippets': {
baseDir: '..',
},
enableEditor: true,
theme: {
customCss: require.resolve('./src/css/custom.css'),
},
},
],
],
customFields: {
fbRepoName: 'fbsource',
ossRepoPath: 'fbcode/eden',
},
themeConfig:
/** @type {import('@docusaurus/preset-classic').ThemeConfig} */
{
navbar: {
title: 'Sapling',
logo: {
alt: 'Sapling Logo',
src: 'img/Sapling_icon-dark-green.svg',
},
items: [
{
href: '/docs/introduction/',
label: 'Documentation',
position: 'left',
},
// Please keep GitHub link to the right for consistency.
{
href: gitHubRepo,
label: 'GitHub',
position: 'right',
},
],
},
footer: {
style: 'dark',
links: [
{
title: 'Useful Links',
items: [
{
label: 'GitHub',
href: gitHubRepo,
},
{
label: 'Discord',
href: discord,
},
{
label: 'Twitter',
href: twitter,
},
{
label: 'Meta Open Source',
href: openSourceWebsite,
},
],
},
{
title: 'Related Projects',
items: [
{
label: 'ghstack',
href: ghstackRepo,
},
{
label: 'Watchman',
href: watchmanRepo,
},
{
// TODO: Consider changing this to Rocksdb or Buck2 in the future
label: 'VS Code @ Meta',
href: vsCodeRepo,
},
],
},
{
title: 'Legal',
// Please do not remove the privacy and terms, it's a legal requirement.
items: [
{
label: 'Privacy',
href: 'https://opensource.fb.com/legal/privacy/',
},
{
label: 'Terms',
href: 'https://opensource.fb.com/legal/terms/',
},
{
label: 'Data Policy',
href: 'https://opensource.fb.com/legal/data-policy/',
},
{
label: 'Cookie Policy',
href: 'https://opensource.fb.com/legal/cookie-policy/',
},
],
},
],
logo: {
alt: 'Meta Open Source Logo',
// This default includes a positive & negative version, allowing for
// appropriate use depending on your site's style.
src: '/img/meta_opensource_logo_negative.svg',
href: 'https://opensource.fb.com',
},
// Please do not remove the credits, help to publicize Docusaurus :)
copyright: `Copyright © ${new Date().getFullYear()} Meta Platforms, Inc. Built with Docusaurus.`,
},
},
plugins: [
async function webpack_config(context, options) {
return {
name: 'webpack-config',
configureWebpack(config, isServer, utils, content) {
return {
experiments: {
asyncWebAssembly: true,
},
};
},
};
},
],
};
module.exports = config;