-
Notifications
You must be signed in to change notification settings - Fork 4.2k
/
Copy pathdocusaurus.config.js
191 lines (178 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
const { themes } = require("prism-react-renderer");
// List of projects/orgs using your project for the users page.
const users = [
{
caption: "Docusaurus",
image: "https://docusaurus.io/img/docusaurus.svg",
infoLink: "https://docusaurus.io/",
pinned: true,
},
];
const setupDoc = "docs/basic/setup";
module.exports = {
favicon: "img/icon.png",
title: "React TypeScript Cheatsheets", // Title for your website.
tagline:
"Cheatsheets for experienced React developers getting started with TypeScript",
url: "https://react-typescript-cheatsheet.netlify.app", // Your website URL
baseUrl: "/",
projectName: "react-typescript-cheatsheet",
organizationName: "typescript-cheatsheets",
presets: [
[
"@docusaurus/preset-classic",
{
theme: {
customCss: require.resolve("./src/css/custom.css"),
},
docs: {
// Docs folder path relative to website dir.
path: "../docs",
// Sidebars file relative to website dir.
sidebarPath: require.resolve("./sidebars.json"),
editUrl:
"https://github.com/typescript-cheatsheets/react/tree/main/docs",
},
// ...
},
],
],
themeConfig: {
colorMode: {
defaultMode: "dark",
},
image:
"https://user-images.githubusercontent.com/6764957/53868378-2b51fc80-3fb3-11e9-9cee-0277efe8a927.png",
// Equivalent to `docsSideNavCollapsible`.
// sidebarCollapsible: false,
prism: {
defaultLanguage: "typescript",
theme: themes.github,
darkTheme: themes.dracula,
},
navbar: {
title: "React TypeScript Cheatsheet",
logo: {
alt: "Logo",
src: "img/icon.png",
},
items: [
{
to: setupDoc,
label: "Docs",
position: "right",
},
{
to: "help",
label: "Help",
position: "right",
},
{
to: "https://discord.gg/wTGS5z9",
label: "Discord",
position: "right",
},
// {to: 'blog', label: 'Blog', position: 'right'},
],
},
footer: {
style: "dark",
logo: {
alt: "TypeScript Cheatsheets Logo",
src: "img/icon.png",
// maxWidth: 128,
// style: { maxWidth: 128, maxHeight: 128 },
},
copyright: `Copyright © ${new Date().getFullYear()} TypeScript Cheatsheets`,
links: [
{
title: "Docs",
items: [
{
label: "Introduction",
to: setupDoc,
},
{
label: "High Order Component (HOC)",
to: "docs/hoc",
},
{
label: "Advanced Guides",
to: "docs/advanced",
},
{
label: "Migrating",
to: "docs/migration",
},
],
},
{
title: "Community",
items: [
{
label: "Stack Overflow",
href: "https://stackoverflow.com/questions/tagged/typescript",
},
{
label: "User Showcase",
to: "users",
},
{
label: "Help",
to: "help",
},
{
label: "Contributors",
to: "contributors",
},
{
label: "Contributing",
to: "contributing",
},
],
},
{
title: "More",
items: [
{
label: "GitHub",
href: "https://github.com/typescript-cheatsheets/react",
},
{
html: `<a class="footer__link-item" href="https://github.com/typescript-cheatsheets/react">
<img src="https://img.shields.io/github/stars/typescript-cheatsheets/react-typescript-cheatsheet.svg?style=social&label=Star&maxAge=2592000" alt="GitHub stars" data-canonical-src="https://img.shields.io/github/stars/typescript-cheatsheets/react-typescript-cheatsheet.svg?style=social&label=Star&maxAge=2592000" style="max-width:100%;">
</a>`,
},
{
// label: "Discord",
html: `<a class="footer__link-item" href="https://discord.gg/wTGS5z9">
<img src="https://img.shields.io/discord/508357248330760243.svg?label=&logo=discord&logoColor=ffffff&color=7389D8&labelColor=6A7EC2" style="max-width:100%;" alt="Discord">
</a>`,
},
{
// label: "Spread the word",
html: `<a class="footer__link-item" href="http://twitter.com/home?status=Awesome%20%40Reactjs%20%2B%20%40TypeScript%20cheatsheet%20by%20%40ferdaber%2C%20%40sebsilbermann%2C%20%40swyx%20%26%20others!%20https%3A%2F%2Fgithub.com%2Ftypescript-cheatsheets%2Freact">
<img src="https://img.shields.io/twitter/url?label=Help%20spread%20the%20word%21&style=social&url=https%3A%2F%2Fgithub.com%2Ftypescript-cheatsheets%2Freact" style="max-width:100%;" alt="X">
</a>`,
},
],
},
],
},
algolia: {
apiKey: "9a22585d1841d2fa758da919cd08a764",
indexName: "react-typescript-cheatsheet",
appId: "J65EL4UPXZ",
algoliaOptions: {
//... },
},
},
},
customFields: {
firstDoc: setupDoc,
// TODO useless user showcase page ?
users,
addUserUrl:
"https://github.com/typescript-cheatsheets/react/blob/main/website/docusaurus.config.js",
},
};