Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
39 changes: 25 additions & 14 deletions .vitepress/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -113,16 +113,16 @@ const VITEPRESS_CONFIG: UserConfig<DefaultTheme.Config> = {
const words = ["BdApi"];
options.decorations ||= [];
for (const word of words) {
const indexes = findAllSubstringIndexes(code, word);
for (const index of indexes) {
options.decorations.push({
start: index,
end: index + word.length,
properties: {
"class": "global-bdapi",
},
});
}
const indexes = findAllSubstringIndexes(code, word);
for (const index of indexes) {
options.decorations.push({
start: index,
end: index + word.length,
properties: {
"class": "global-bdapi",
},
});
}
}
},
}
Expand Down Expand Up @@ -170,7 +170,14 @@ const VITEPRESS_CONFIG: UserConfig<DefaultTheme.Config> = {
},
})
]
}
},
transformPageData: (pageData) => {
if (pageData.relativePath.startsWith("api/")) {
pageData.frontmatter.outline = [2, 3];
}

return pageData;
},
};


Expand All @@ -180,8 +187,11 @@ const SIDEBARS: VitePressSidebarOptions[] = [
scanStartPath: "api",
basePath: "/api/",
resolvePath: "/api/",
useTitleFromFileHeading: true,
useTitleFromFrontmatter: true,
// useTitleFromFileHeading: true,
includeRootIndexFile: true,
capitalizeEachWords: true,
collapsed: false,
sortFolderTo: "bottom",
sortMenusByFrontmatterOrder: true,
frontmatterOrderDefaultValue: 1,
Expand Down Expand Up @@ -254,7 +264,8 @@ const SIDEBARS: VitePressSidebarOptions[] = [
sortMenusByFrontmatterOrder: true,
frontmatterOrderDefaultValue: 1,
manualSortFileNameByPriority: ["introduction", "basics", "intermediate", "advanced"],
}
},
];

export default defineConfig(withSidebar(VITEPRESS_CONFIG, SIDEBARS));
const userConfig: Partial<UserConfig> = withSidebar(VITEPRESS_CONFIG, SIDEBARS);
export default defineConfig(userConfig);
1,077 changes: 1,077 additions & 0 deletions bun.lock

Large diffs are not rendered by default.

81 changes: 0 additions & 81 deletions docs/api/addonapi.md

This file was deleted.

Loading