-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathdocusaurus.config.ts
198 lines (184 loc) · 7.68 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
import {themes as prismThemes} from 'prism-react-renderer';
import type {Config} from '@docusaurus/types';
import type * as Preset from '@docusaurus/preset-classic';
const config: Config = {
title: 'Scrap Docs',
tagline: 'Documentation for Scrap Mechanic',
favicon: 'img/favicon.ico',
markdown: {
mermaid: true,
},
themes: ['@docusaurus/theme-mermaid'],
trailingSlash: true,
// Set the production url of your site here
url: 'https://docs.scrapmods.io',
// 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: 'Scrap-Mods', // Usually your GitHub org/user name.
projectName: 'docs', // Usually your repo name.
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'],
},
presets: [
[
'classic',
{
docs: {
sidebarPath: './sidebars.ts',
// Please change this to your repo.
// Remove this to remove the "edit this page" links.
editUrl: 'https://pr.new/github.com/Scrap-Mods/docs/blob/main',
// Leave the packet ids in the URL
numberPrefixParser: false,
sidebarItemsGenerator: async function ({
defaultSidebarItemsGenerator,
...args
}) {
const sidebarItems = await defaultSidebarItemsGenerator(args);
return sidebarItems.map((item) => {
if (item.type === 'category') {
// If the first character is lowercase, split on dashes and convert to PascalCase
const title = item.label;
const isLowercase = title[0] === title[0].toLowerCase();
const label = isLowercase ? title.split('-').map((part) => part[0].toUpperCase() + part.slice(1)).join(' ') : title;
return {
...item,
label,
collapsed: false,
};
}
return item;
});
},
},
blog: {
showReadingTime: true,
// Please change this to your repo.
// Remove this to remove the "edit this page" links.
editUrl: 'https://pr.new/github.com/Scrap-Mods/docs/blob/main',
},
theme: {
customCss: './src/css/custom.css',
},
} satisfies Preset.Options,
],
],
themeConfig: {
colorMode: {
defaultMode: 'dark',
respectPrefersColorScheme: true,
},
// Replace with your project's social card
image: 'img/blue-bearing.png',
navbar: {
title: 'Scrap Docs',
logo: {
alt: 'Scrap Docs Logo',
src: 'img/blue-bearing.png',
},
items: [
{
type: 'docSidebar',
sidebarId: 'luaSidebar',
position: 'left',
label: 'Lua',
},
{
type: 'docSidebar',
sidebarId: 'networkingSidebar',
position: 'left',
label: 'Networking',
},
{
type: 'docSidebar',
sidebarId: 'structuresSidebar',
position: 'left',
label: 'Structures',
},
{
type: 'docSidebar',
sidebarId: 'otherSidebar',
position: 'left',
label: 'Other',
},
{to: '/blog', label: 'Blog', position: 'left'},
{
type: 'html',
position: 'right',
value: '<a href="https://github.com/Scrap-Mods/docs" target="_blank" title="View the documentation on GitHub"><svg height="24" role="img" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path d="M12 .297c-6.63 0-12 5.373-12 12 0 5.303 3.438 9.8 8.205 11.385.6.113.82-.258.82-.577 0-.285-.01-1.04-.015-2.04-3.338.724-4.042-1.61-4.042-1.61C4.422 18.07 3.633 17.7 3.633 17.7c-1.087-.744.084-.729.084-.729 1.205.084 1.838 1.236 1.838 1.236 1.07 1.835 2.809 1.305 3.495.998.108-.776.417-1.305.76-1.605-2.665-.3-5.466-1.332-5.466-5.93 0-1.31.465-2.38 1.235-3.22-.135-.303-.54-1.523.105-3.176 0 0 1.005-.322 3.3 1.23.96-.267 1.98-.399 3-.405 1.02.006 2.04.138 3 .405 2.28-1.552 3.285-1.23 3.285-1.23.645 1.653.24 2.873.12 3.176.765.84 1.23 1.91 1.23 3.22 0 4.61-2.805 5.625-5.475 5.92.42.36.81 1.096.81 2.22 0 1.606-.015 2.896-.015 3.286 0 .315.21.69.825.57C20.565 22.092 24 17.592 24 12.297c0-6.627-5.373-12-12-12"/></svg></a>',
className: "navbar-icon"
},
{
type: 'html',
position: 'right',
value: '<a href="https://discord.gg/ahzyHPn3y2" target="_blank" title="Join our Discord server"><svg height="24" role="img" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path d="M20.317 4.3698a19.7913 19.7913 0 00-4.8851-1.5152.0741.0741 0 00-.0785.0371c-.211.3753-.4447.8648-.6083 1.2495-1.8447-.2762-3.68-.2762-5.4868 0-.1636-.3933-.4058-.8742-.6177-1.2495a.077.077 0 00-.0785-.037 19.7363 19.7363 0 00-4.8852 1.515.0699.0699 0 00-.0321.0277C.5334 9.0458-.319 13.5799.0992 18.0578a.0824.0824 0 00.0312.0561c2.0528 1.5076 4.0413 2.4228 5.9929 3.0294a.0777.0777 0 00.0842-.0276c.4616-.6304.8731-1.2952 1.226-1.9942a.076.076 0 00-.0416-.1057c-.6528-.2476-1.2743-.5495-1.8722-.8923a.077.077 0 01-.0076-.1277c.1258-.0943.2517-.1923.3718-.2914a.0743.0743 0 01.0776-.0105c3.9278 1.7933 8.18 1.7933 12.0614 0a.0739.0739 0 01.0785.0095c.1202.099.246.1981.3728.2924a.077.077 0 01-.0066.1276 12.2986 12.2986 0 01-1.873.8914.0766.0766 0 00-.0407.1067c.3604.698.7719 1.3628 1.225 1.9932a.076.076 0 00.0842.0286c1.961-.6067 3.9495-1.5219 6.0023-3.0294a.077.077 0 00.0313-.0552c.5004-5.177-.8382-9.6739-3.5485-13.6604a.061.061 0 00-.0312-.0286zM8.02 15.3312c-1.1825 0-2.1569-1.0857-2.1569-2.419 0-1.3332.9555-2.4189 2.157-2.4189 1.2108 0 2.1757 1.0952 2.1568 2.419 0 1.3332-.9555 2.4189-2.1569 2.4189zm7.9748 0c-1.1825 0-2.1569-1.0857-2.1569-2.419 0-1.3332.9554-2.4189 2.1569-2.4189 1.2108 0 2.1757 1.0952 2.1568 2.419 0 1.3332-.946 2.4189-2.1568 2.4189Z"/></svg></a>',
className: "navbar-icon"
},
],
},
footer: {
style: 'dark',
links: [
{
title: 'Docs',
items: [
{
label: 'Lua',
to: '/docs/lua/intro',
},
{
label: 'Networking',
to: '/docs/networking/intro',
},
{
label: 'Structures',
to: '/docs/structures/intro',
},
{
label: 'Other',
to: '/docs/other/intro',
},
],
},
{
title: 'Community',
items: [
{
label: 'Discord',
href: 'https://discord.gg/ahzyHPn3y2',
},
],
},
{
title: 'More',
items: [
{
label: 'Blog',
to: '/blog',
},
{
label: 'GitHub',
href: 'https://github.com/Scrap-Mods/docs',
},
],
},
],
copyright: `Copyright © ${new Date().getFullYear()} Scrap Mods. This work is licensed under a <a rel="license" href="http://creativecommons.org/licenses/by-sa/4.0/">Creative Commons Attribution-ShareAlike 4.0 International License</a>.`,
},
prism: {
theme: prismThemes.vsLight,
darkTheme: prismThemes.vsDark,
additionalLanguages: ['lua', 'json'],
},
} satisfies Preset.ThemeConfig,
};
export default config;