-
Notifications
You must be signed in to change notification settings - Fork 150
/
docusaurus.config.js
120 lines (118 loc) · 3.66 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
/**
* Copyright (c) Flashbots Ltd. and its affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/
require('dotenv').config()
const { themes: { github: lightCodeTheme } } = require('prism-react-renderer');
const { themes: { dracula: darkCodeTheme } } = require('prism-react-renderer');
const tailwindcss = require('tailwindcss');
const autoprefixer = require('autoprefixer');
/** @returns {Promise<import('@docusaurus/types').Config>} */
module.exports = async function createConfigAsync() {
return {
title: 'Flashbots Docs',
tagline: 'Flashbots repository of knowledge',
baseUrl: process.env.BASE_URL,
onBrokenLinks: 'throw',
onBrokenMarkdownLinks: 'warn',
favicon: 'img/favicon.ico',
organizationName: 'flashbots',
projectName: 'docs',
trailingSlash: false,
url: process.env.TARGET_URL,
stylesheets: [
{
href: 'https://cdn.jsdelivr.net/npm/[email protected]/dist/katex.min.css',
type: 'text/css',
integrity:
'sha384-odtC+0UGzzFL/6PNoE8rX/SPcQDXBJ+uRepguP4QkPCm2LBxH3FA3y+fKSiJ+AmM',
crossorigin: 'anonymous',
},
],
themeConfig:
/** @type {import('@docusaurus/preset-classic').ThemeConfig} */
({
algolia: {
apiKey: process.env.ALGOLIA_SEARCH_API_KEY,
indexName: process.env.ALGOLIA_INDEX_NAME,
appId: process.env.ALGOLIA_APP_ID,
},
prism: {
theme: lightCodeTheme,
darkTheme: darkCodeTheme,
additionalLanguages: ['solidity', 'uri', 'ini', 'rust']
},
docs: {
sidebar: {
hideable: true
}
},
navbar: {
title: 'Flashbots',
logo: {
alt: 'Flashbots Logo',
src: 'img/logo.png',
},
items: [
{
type: 'docSidebar',
label: 'Docs',
sidebarId: 'docs',
position: 'left',
},
{
type: 'docSidebar',
label: 'API',
sidebarId: 'api',
position: 'left',
},
{
href: 'https://github.com/flashbots/docs',
label: 'GitHub',
position: 'right',
},
],
}
}),
presets: [
[
'@docusaurus/preset-classic',
/** @type {import('@docusaurus/preset-classic').Options} */
({
debug: true, // force debug plugin usage
docs: {
sidebarPath: require.resolve('./docs/sidebars.js'),
// Please change this to your repo.
routeBasePath: '/',
editUrl:
'https://github.com/flashbots/flashbots-docs/edit/main/',
showLastUpdateTime: true,
remarkPlugins: [(await import('remark-math')).default],
rehypePlugins: [(await import('rehype-katex')).default],
},
theme: {
customCss: require.resolve('./src/css/custom.css'),
},
}),
],
],
plugins: [
// eslint-disable-next-line @typescript-eslint/no-unused-vars
async function tailwindcssSupport(context, options) {
return {
name: "docusaurus-tailwindcss",
configurePostCss(postcssOptions) {
// Appends TailwindCSS and AutoPrefixer.
postcssOptions.plugins.push('tailwindcss/nesting')
postcssOptions.plugins.push(tailwindcss);
postcssOptions.plugins.push(autoprefixer);
return postcssOptions;
},
};
},
'docusaurus-plugin-sass'
],
}
}