Skip to content

Commit 300c6c7

Browse files
authored
Merge pull request #45 from BetterDiscord/feat/restructure
Restructure Plugin and Theme docs
2 parents bd53d3a + 546cda4 commit 300c6c7

File tree

152 files changed

+1456
-1230
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

152 files changed

+1456
-1230
lines changed

.vitepress/config.ts

Lines changed: 28 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import {DefaultTheme, defineConfig, UserConfig} from "vitepress";
2-
import {VitePressSidebarOptions, withSidebar} from "vitepress-sidebar";
2+
import {withSidebar, generateSidebar} from "vitepress-sidebar";
33
import {bundledLanguages, LanguageRegistration} from "shiki";
44
import {groupIconMdPlugin, groupIconVitePlugin, localIconLoader} from "vitepress-plugin-group-icons";
55

@@ -41,11 +41,11 @@ const VITEPRESS_CONFIG: UserConfig<DefaultTheme.Config> = {
4141
{
4242
text: "Developer Guides",
4343
items: [
44-
{text: "General", link: "/developers/", activeMatch: "/developers/"},
44+
// {text: "General", link: "/developers/", activeMatch: "/developers/"},
4545
{text: "Plugins", link: "/plugins/", activeMatch: "/plugins/"},
4646
{text: "Themes", link: "/themes/", activeMatch: "/themes/"},
4747
],
48-
activeMatch: "/(?:developers|plugins|themes)/"
48+
activeMatch: "/(?:plugins|themes)/"
4949
},
5050
{
5151
text: "Reference",
@@ -94,6 +94,7 @@ const VITEPRESS_CONFIG: UserConfig<DefaultTheme.Config> = {
9494
outline: "deep",
9595
},
9696

97+
// base: "/docs/",
9798
sitemap: {
9899
hostname: "https://docs.betterdiscord.app"
99100
},
@@ -181,7 +182,7 @@ const VITEPRESS_CONFIG: UserConfig<DefaultTheme.Config> = {
181182
};
182183

183184

184-
const SIDEBARS: VitePressSidebarOptions[] = [
185+
const SIDEBARS: Parameters<typeof generateSidebar>[0] = [
185186
{
186187
documentRootPath: "docs",
187188
scanStartPath: "api",
@@ -191,7 +192,8 @@ const SIDEBARS: VitePressSidebarOptions[] = [
191192
// useTitleFromFileHeading: true,
192193
includeRootIndexFile: true,
193194
capitalizeEachWords: true,
194-
collapsed: false,
195+
collapsed: true,
196+
collapseDepth: 1,
195197
sortFolderTo: "bottom",
196198
sortMenusByFrontmatterOrder: true,
197199
frontmatterOrderDefaultValue: 1,
@@ -226,17 +228,17 @@ const SIDEBARS: VitePressSidebarOptions[] = [
226228
frontmatterOrderDefaultValue: 1,
227229
manualSortFileNameByPriority: ["getting-started", "guides"],
228230
},
229-
{
230-
documentRootPath: "docs",
231-
scanStartPath: "developers",
232-
basePath: "/developers/",
233-
resolvePath: "/developers/",
234-
useTitleFromFileHeading: true,
235-
includeRootIndexFile: true,
236-
sortFolderTo: "bottom",
237-
sortMenusByFrontmatterOrder: true,
238-
frontmatterOrderDefaultValue: 1,
239-
},
231+
// {
232+
// documentRootPath: "docs",
233+
// scanStartPath: "developers",
234+
// basePath: "/developers/",
235+
// resolvePath: "/developers/",
236+
// useTitleFromFileHeading: true,
237+
// includeRootIndexFile: true,
238+
// sortFolderTo: "bottom",
239+
// sortMenusByFrontmatterOrder: true,
240+
// frontmatterOrderDefaultValue: 1,
241+
// },
240242
{
241243
documentRootPath: "docs",
242244
scanStartPath: "plugins",
@@ -245,11 +247,15 @@ const SIDEBARS: VitePressSidebarOptions[] = [
245247
useTitleFromFileHeading: true,
246248
includeRootIndexFile: true,
247249
capitalizeEachWords: true,
248-
collapsed: false,
250+
followSymlinks: true,
251+
useFolderTitleFromIndexFile: true,
252+
excludeFilesByFrontmatterFieldName: "hide",
253+
collapsed: true,
254+
collapseDepth: 2,
249255
sortFolderTo: "bottom",
250256
sortMenusByFrontmatterOrder: true,
251257
frontmatterOrderDefaultValue: 1,
252-
manualSortFileNameByPriority: ["introduction", "basics", "intermediate", "advanced"],
258+
manualSortFileNameByPriority: ["introduction", "tutorials", "ui", "concepts", "publishing"],
253259
},
254260
{
255261
documentRootPath: "docs",
@@ -259,11 +265,14 @@ const SIDEBARS: VitePressSidebarOptions[] = [
259265
useTitleFromFileHeading: true,
260266
includeRootIndexFile: true,
261267
capitalizeEachWords: true,
268+
followSymlinks: true,
269+
useFolderTitleFromIndexFile: true,
270+
excludeFilesByFrontmatterFieldName: "hide",
262271
collapsed: false,
263272
sortFolderTo: "bottom",
264273
sortMenusByFrontmatterOrder: true,
265274
frontmatterOrderDefaultValue: 1,
266-
manualSortFileNameByPriority: ["introduction", "basics", "intermediate", "advanced"],
275+
manualSortFileNameByPriority: ["introduction", "tutorials", "concepts", "publishing"],
267276
},
268277
];
269278

bun.lock

Lines changed: 99 additions & 388 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

docs/developers/addons.md

Lines changed: 0 additions & 68 deletions
This file was deleted.

docs/developers/environment.md

Lines changed: 0 additions & 38 deletions
This file was deleted.

docs/developers/index.md

Lines changed: 0 additions & 22 deletions
This file was deleted.

docs/discord/modules/index.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,4 +12,4 @@ Discord uses Webpack as their bundler and through [`BdApi.Webpack`](/api/classes
1212

1313
## Data Stores
1414

15-
This common type of modules holds data that is used throughout the entire app by Discord. This includes local caches of information about users, guilds, roles, or anything else that may otherwise need to be pulled from the server. Having access to these can greatly enhance any plugin you may be working on. You can take a look at a mostly comprehensive list on the next page, or you can check out the [plugin guide](/plugins/advanced/webpack.md) for a walkthrough and tips on reverse engineering individual methods.
15+
This common type of modules holds data that is used throughout the entire app by Discord. This includes local caches of information about users, guilds, roles, or anything else that may otherwise need to be pulled from the server. Having access to these can greatly enhance any plugin you may be working on. You can take a look at a mostly comprehensive list on the next page, or you can check out the [plugin guide](../../plugins/concepts/webpack.md) for a walkthrough and tips on reverse engineering individual methods.

0 commit comments

Comments
 (0)