forked from PolkadotStudy/polkadot.study
-
Notifications
You must be signed in to change notification settings - Fork 0
/
docusaurus.config.js
216 lines (206 loc) · 7.33 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
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
// @ts-check
// Note: type annotations allow type checking and IDEs autocompletion
const lightCodeTheme = require("prism-react-renderer/themes/github");
const darkCodeTheme = require("prism-react-renderer/themes/dracula");
/** @type {import('@docusaurus/types').Config} */
const config = {
title: "Polkadot Study",
tagline: "Educational Resources for developers",
favicon:
"data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 1340 1410.3' xml:space='preserve'%3E%3Cellipse fill='%23E6007A' cx='663' cy='147.9' rx='254.3' ry='147.9'/%3E%3Cellipse fill='%23E6007A' cx='663' cy='1262.3' rx='254.3' ry='147.9'/%3E%3Cellipse transform='rotate(-60 180.499 426.56)' fill='%23E6007A' cx='180.5' cy='426.5' rx='254.3' ry='148'/%3E%3Cellipse transform='rotate(-60 1145.575 983.768)' fill='%23E6007A' cx='1145.6' cy='983.7' rx='254.3' ry='147.9'/%3E%3Cellipse transform='rotate(-30 180.45 983.72)' fill='%23E6007A' cx='180.5' cy='983.7' rx='148' ry='254.3'/%3E%3Cellipse transform='rotate(-30 1145.522 426.601)' fill='%23E6007A' cx='1145.6' cy='426.6' rx='147.9' ry='254.3'/%3E%3C/svg%3E",
// Set the production url of your site here
url: "https://polkadot.study",
// Set the /<baseUrl>/ pathname under which your site is served
// For GitHub pages deployment, it is often '/<projectName>/'
baseUrl: "/",
// GitHub pages deployment config.
// If you aren't using GitHub pages, you don't need these.
organizationName: "PolkadotStudy ", // Usually your GitHub org/user name.
projectName: "website", // Usually your repo name.
onBrokenLinks: "warn",
onBrokenMarkdownLinks: "warn",
// Even if you don't use internalization, 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"],
},
plugins: [
"docusaurus-plugin-sass",
[
"@docusaurus/plugin-ideal-image",
{
quality: 70,
max: 1030, // max resized image's size.
min: 640, // min resized image's size. if original is lower, use that size.
steps: 2, // the max number of images generated between min and max (inclusive)
disableInDev: false,
},
],
[
"@niklasp/docusaurus-plugin-content-tutorials",
{
id: "tutorials",
path: "tutorials",
showLastUpdateAuthor: true,
showLastUpdateTime: true,
sidebarPath: require.resolve("./sidebars.js"),
editUrl: "https://github.com/PolkadotStudy/website/tree/staging/",
},
],
// [
// "@docusaurus/plugin-client-redirects",
// {
// // fromExtensions: ["html", "htm"], // /myPage.html -> /myPage
// // toExtensions: ["exe", "zip"], // /myAsset -> /myAsset.zip (if latter exists)
// // redirects: [
// // // /docs/oldDoc -> /docs/newDoc
// // {
// // to: "/docs/newDoc",
// // from: "/docs/oldDoc",
// // },
// // // Redirect from multiple old paths to the new path
// // {
// // to: "/docs/newDoc2",
// // from: ["/docs/oldDocFrom2019", "/docs/legacyDocFrom2016"],
// // },
// // ],
// createRedirects(existingPath) {
// if (existingPath.includes("/tutorials/substrate-in-bits/docs/")) {
// // Redirect from /docs/team/X to /community/X and /docs/support/X to /community/X
// return [
// existingPath.replace(
// "/tutorials/substrate-in-bits/docs/",
// "/substrate-in-bits/"
// ),
// ];
// }
// return undefined; // Return a falsy value: no redirect created
// },
// },
// ],
],
presets: [
[
"@docusaurus/preset-classic",
/** @type {import('@docusaurus/preset-classic').Options} */
{
docs: {
sidebarPath: require.resolve("./docs/docs-sidebars.js"),
editUrl: "https://github.com/PolkadotStudy/website/tree/staging/",
showLastUpdateAuthor: true,
showLastUpdateTime: true,
},
blog: {
showReadingTime: true,
editUrl: "https://github.com/PolkadotStudy/website/tree/staging/",
},
theme: {
customCss: require.resolve("./src/css/custom.scss"),
},
gtag: {
trackingID: "G-SDWBSJ1B4F",
anonymizeIP: true,
},
},
],
],
themeConfig:
/** @type {import('@docusaurus/preset-classic').ThemeConfig} */
({
// Replace with your project's social card
image: "polkadot-study.png",
navbar: {
title: "Polkadot Study",
logo: {
alt: "Polkadot Study Logo",
src: "img/polkadot_pink.svg",
},
items: [
// {
// href: "/tutorials",
// docId: "intro",
// position: "left",
// label: "Tutorials",
// },
{
href: "/docs/authors/new-tutorial-on-polkadot-study/intro",
docId: "authors/new-tutorial-on-polkadot-study/intro",
position: "left",
label: "For Authors",
},
{
to: "/tutorials/substrate-in-bits/",
position: "left",
label: "Substrate in Bits",
},
{
to: "/blog",
label: "Blog",
position: "right",
},
{
href: "/about",
label: "About",
position: "right",
},
{
href: "https://github.com/PolkadotStudy/website",
className: "header-github-link",
"aria-label": "GitHub repository",
position: "right",
},
],
},
docs: {
sidebar: {
hideable: true,
autoCollapseCategories: true,
},
},
tutorials: {
path: "/tutorials",
showLastUpdateAuthor: true,
showLastUpdateTime: true,
sidebarPath: require.resolve("./sidebars.js"),
editUrl: "https://github.com/PolkadotStudy/website/tree/staging/",
sidebar: {
hideable: true,
autoCollapseCategories: true,
},
},
announcementBar: {
id: "support_us",
content:
'We are looking for payed authors to write Polkadot developer tutorials<br><a rel="noopener noreferrer" href="/blog/looking-for-authors">Learn More</a>',
backgroundColor: "var(--polkadot-pink)",
textColor: "#eee",
isCloseable: true,
},
showLastUpdateAuthor: true,
showLastUpdateTime: true,
footer: {
style: "dark",
copyright: `Copyleft ${new Date().getFullYear()} Polkadot.study - Built with Docusaurus - This is a community site and in no way incorporated with Parity or Polkadot`,
},
colorMode: {
// defaultMode: "light",
disableSwitch: false,
respectPrefersColorScheme: true,
},
prism: {
theme: lightCodeTheme,
darkTheme: darkCodeTheme,
additionalLanguages: ["rust"],
magicComments: [
{
className: "theme-code-block-highlighted-line",
line: "highlight-next-line",
block: { start: "highlight-start", end: "highlight-end" },
},
],
},
}),
};
module.exports = config;