-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdocusaurus.config.ts
275 lines (266 loc) · 6.44 KB
/
docusaurus.config.ts
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
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
/* eslint-disable @typescript-eslint/no-explicit-any */
// Note: type annotations allow type checking and IDEs autocompletion
import { Config } from '@docusaurus/types';
import autoprefixer from 'autoprefixer';
import 'dotenv/config';
import { themes } from 'prism-react-renderer';
import tailwindCss from 'tailwindcss';
import gtagPlugin from './config/gtag';
import seoMetadata from './config/seo';
/** @type {import('@docusaurus/types').Config} */
const config: Config = {
title: 'Usher Labs Docs',
tagline:
'Secure Web3 with trusted data: Usher Labs is an R&D firm enhancing user trust in data and digital asset management.',
favicon: 'img/usherlabs/favicon.ico',
url: 'https://docs.usher.so',
// Set the /<baseUrl>/ pathname under which your site is served
// For GitHub pages deployment, it is often '/<projectName>/'
baseUrl: '/',
trailingSlash: false, // Add this to ensure consistent URL format
// GitHub pages deployment config.
// If you aren't using GitHub pages, you don't need these.
organizationName: 'usherlabs',
deploymentBranch: 'master',
onBrokenLinks: 'throw',
onBrokenMarkdownLinks: 'warn',
// Even if you don't use internalization, you can use this field to set useful
// metadata like html lan g. For example, if your site is Chinese, you may want
// to replace "en" with "zh-Hans".
i18n: {
defaultLocale: 'en',
locales: ['en'],
},
plugins: [
'docusaurus-plugin-sass',
'docusaurus-plugin-image-zoom',
// This plugin enables tailwind
async function cssPlugin() {
return {
name: 'docusaurus-tailwindcss',
configurePostCss(postcssOptions: any) {
// Appends TailwindCSS and AutoPrefixer.
postcssOptions.plugins.push(tailwindCss);
postcssOptions.plugins.push(autoprefixer);
return postcssOptions;
},
};
},
gtagPlugin,
[
'@docusaurus/plugin-client-redirects',
{
redirects: [
{
from: [
'/network/overview/paper',
'/network/overview/papers',
'/papers',
],
to: '/research',
},
{
from: [
'/network/overview/lightpaper',
'/papers/logstore/lightpaper',
'/network/sdk/network-verification',
'/network/sdk/client-side-network-verification',
],
to: '/logstore/network/specifics/lightpaper',
},
{
from: [
'/network/overview/use-cases',
'/use-cases',
'/papers/logstore/use-cases',
],
to: '/logstore/network/specifics/overview',
},
{
from: ['/logstore', '/logstore/network'],
to: '/logstore/network/quick-start/guide',
},
{
from: ['/verity'],
to: '/verity/introduction',
},
],
},
],
[
'@easyops-cn/docusaurus-search-local',
{
hashed: true,
docsRouteBasePath: '/',
indexBlog: false,
searchContextByPaths: ['verity', 'logstore'],
useAllContextsWithNoSearchContext: true,
},
],
].filter((p) => typeof p !== 'undefined'),
presets: [
[
'@docusaurus/preset-classic',
{
docs: {
// id: 'default',
path: 'docs',
routeBasePath: '/',
sidebarPath: require.resolve('./config/sidebars.ts'),
// Please change this to your repo.
// Remove this to remove the "edit this page" links.
editUrl:
// INITIAL TODO change this to your repo. This is where a user will be redirected to if they follow the link on "edit this page"
'https://github.com/usherlabs/docs/tree/master/',
},
blog: false,
theme: {
customCss: [
require.resolve(
'./node_modules/modern-normalize/modern-normalize.css',
),
require.resolve('./src/styles/custom.scss'),
],
},
sitemap: {
changefreq: 'weekly',
priority: 0.5,
},
},
],
[
'redocusaurus',
{
// Plugin Options for loading OpenAPI files
specs: [
{
spec: './docs/logstore/node/api/_api.spec.yaml',
route: '/logstore/node/api/reference',
},
],
// Theme Options for modifying how redoc renders them
theme: {
// Change with your site colors
primaryColor: '#100322',
},
},
],
],
themeConfig:
/** @type {import('@docusaurus/preset-classic').ThemeConfig} */
{
metadata: seoMetadata,
navbar: {
hideOnScroll: true,
logo: {
alt: 'Usher Labs Logo',
src: '/img/usherlabs/Logo-Text-500.png',
srcDark: '/img/usherlabs/Logo-Text-White-500.png',
target: '_self',
width: '120',
href: '/',
},
items: [
{
label: '🏠 Home',
position: 'left',
href: '/',
},
{
label: '📄 Research',
position: 'left',
href: '/research',
},
{
type: 'docSidebar',
sidebarId: 'verity',
label: '🧪 Verity',
position: 'left',
},
{
type: 'dropdown',
label: '🧶 Log Store',
position: 'left',
items: [
{
type: 'docSidebar',
sidebarId: 'network',
label: 'Log Store Network',
},
{
type: 'docSidebar',
sidebarId: 'node',
label: 'Log Store Node',
},
],
},
{
type: 'search',
position: 'right',
},
{
label: 'Stay tuned',
position: 'right',
items: [
{
href: 'https://logstore.usher.so',
label: 'Our Homepage',
target: '_blank',
rel: null,
},
{
label: 'Follow us',
href: 'https://twitter.com/usher_web3',
target: '_blank',
rel: null,
},
{
label: 'Join our Discord server',
href: 'https://go.usher.so/discord',
target: '_blank',
rel: null,
},
{
label: 'Discover Usher Labs',
href: 'https://linktr.ee/usher.so',
target: '_blank',
rel: null,
},
],
},
{
type: 'custom-separator',
position: 'right',
},
{
type: 'custom-iconLink',
position: 'right',
icon: {
alt: 'github logo',
src: `/img/github.svg`,
href: 'https://github.com/usherlabs/logstore',
target: '_blank',
},
},
],
},
prism: {
theme: themes.github,
darkTheme: themes.dracula,
},
seo: {
twitterUsername: '@usher_web3',
},
zoom: {
selector: '.markdown .zoom img',
background: {
light: 'rgb(255, 255, 255)',
dark: 'rgb(50, 50, 50)',
},
// config: {
// // options you can specify via https://github.com/francoischalifour/medium-zoom#usage
// },
},
},
};
export default config;