-
Notifications
You must be signed in to change notification settings - Fork 1
/
docusaurus.config.ts
193 lines (182 loc) · 4.87 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
import { themes as prismThemes } from 'prism-react-renderer';
import type { Config } from '@docusaurus/types';
import type * as Preset from '@docusaurus/preset-classic';
import { ProvidePlugin } from "webpack";
const gtag = process.env.GOOGLE_ANALYTICS_TAG
? {
gtag: {
trackingID: process.env.GOOGLE_ANALYTICS_TAG,
anonymizeIP: false,
}
}
: {};
const config: Config = {
title: 'Texture Documentation',
tagline: 'Explore our guides, examples, and API reference to begin building on the Texture platform',
favicon: 'img/favicon.ico',
// Set the production url of your site here
url: 'https://docs.texturehq.com',
// Set the /<baseUrl>/ pathname under which your site is served
// For GitHub pages deployment, it is often '/<projectName>/'
baseUrl: '/',
onBrokenLinks: 'throw',
onBrokenMarkdownLinks: 'warn',
// Even if you don't use internationalization, you can use this field to set
// useful metadata like html lang. For example, if your site is Chinese, you
// may want to replace "en" with "zh-Hans".
i18n: {
defaultLocale: 'en',
locales: ['en'],
},
customFields: {
API_BASE_URL: process.env.API_BASE_URL,
},
plugins: [
[
'@docusaurus/plugin-client-redirects',
{
redirects: [
{
to: '/docs/sources/supported-devices',
from: '/docs/devices-1',
},
{
to: '/docs/sources/supported-devices',
from: '/docs/connections/supported-devices',
},
{
to: '/docs/devices/polling',
from: '/docs/platform-concepts/polling',
},
],
},
],
"docusaurus-plugin-sass",
// Add custom webpack config to make @stoplight/elements work
() => ({
name: "custom-webpack-config",
configureWebpack: () => {
return {
module: {
rules: [
{
test: /\.m?js/,
resolve: {
fullySpecified: false,
},
},
],
},
plugins: [
new ProvidePlugin({
process: require.resolve("process/browser"),
}),
],
resolve: {
fallback: {
buffer: require.resolve("buffer"),
stream: false,
path: false,
process: false,
},
},
};
},
}),
],
organizationName: 'texturehq',
projectName: 'docs',
presets: [
[
'classic',
{
docs: {
sidebarPath: './sidebars.ts',
// Add the following lines for the "Edit" functionality
editUrl: 'https://github.com/texturehq/docs/tree/main/',
editLocalizedFiles: true,
},
blog: {
showReadingTime: true,
},
theme: {
customCss: './src/css/custom.css',
},
...gtag,
} satisfies Preset.Options,
],
],
themeConfig: {
algolia: {
appId: 'TS0KK5KXLO',
apiKey: '99a70acfc3fd6c2941528e464a175820',
indexName: 'texturehq',
contextualSearch: false,
},
image: 'img/texture-social-card.png',
navbar: {
logo: {
alt: 'Texture Docs Logo',
src: 'img/docs-logo.svg',
srcDark: 'img/docs-logo__dark.svg',
},
items: [
{
type: 'docSidebar',
sidebarId: 'home',
position: 'left',
label: 'Docs',
},
{ to: '/api', label: 'API Reference', position: 'left' },
{ to: '/docs/sources/supported-devices', label: 'Supported Devices', position: 'left' },
{
href: 'https://dashboard.texturehq.com',
label: 'Dashboard',
position: 'right',
},
{
href: 'https://github.com/texturehq/examples',
label: 'GitHub',
position: 'right',
},
],
},
footer: {
style: 'dark',
links: [
{
title: 'Community',
items: [
{
label: 'Join our Slack Community',
href: 'https://join.slack.com/t/texture-community/shared_invite/zt-2ho02ds2o-pBNH1ZGcopxgIY3BgKcKzg',
},
{
label: 'Twitter',
href: 'https://twitter.com/texturehq',
},
],
},
{
title: 'More',
items: [
{
label: 'Status',
href: 'https://status.texturehq.com',
},
{
label: 'GitHub',
href: 'https://github.com/texturehq/examples',
},
],
},
],
copyright: `Copyright © ${new Date().getFullYear()} Texture Corp. Built with Docusaurus.`,
},
prism: {
theme: prismThemes.github,
darkTheme: prismThemes.dracula,
},
} satisfies Preset.ThemeConfig,
};
export default config;