mirror of
https://github.com/nonebot/nonebot2.git
synced 2025-09-06 20:16:47 +00:00
📝 Docs: 升级到 Docusaurus V3 (#2956)
This commit is contained in:
158
website/sidebars.ts
Normal file
158
website/sidebars.ts
Normal file
@ -0,0 +1,158 @@
|
||||
/**
|
||||
* Creating a sidebar enables you to:
|
||||
- create an ordered group of docs
|
||||
- render a sidebar for each doc of that group
|
||||
- provide next/previous navigation
|
||||
|
||||
The sidebars can be generated from the filesystem, or explicitly defined here.
|
||||
|
||||
Create as many sidebars as you want.
|
||||
*/
|
||||
import path from "path";
|
||||
|
||||
import type { SidebarsConfig } from "@docusaurus/plugin-content-docs";
|
||||
import { getChangelogItemsSync } from "@nullbot/docusaurus-plugin-changelog";
|
||||
|
||||
const changelogPath = path.join(__dirname, "src/changelog/changelog.md");
|
||||
const changelogItems = getChangelogItemsSync(changelogPath, 10);
|
||||
|
||||
const sidebars: SidebarsConfig = {
|
||||
tutorial: [
|
||||
{
|
||||
type: "category",
|
||||
label: "开始",
|
||||
collapsible: false,
|
||||
items: ["index", "quick-start", "editor-support"],
|
||||
},
|
||||
{
|
||||
type: "category",
|
||||
label: "指南",
|
||||
items: [
|
||||
{
|
||||
type: "autogenerated",
|
||||
dirName: "tutorial",
|
||||
},
|
||||
],
|
||||
},
|
||||
{
|
||||
type: "category",
|
||||
label: "深入",
|
||||
items: [
|
||||
{
|
||||
type: "autogenerated",
|
||||
dirName: "appendices",
|
||||
},
|
||||
],
|
||||
},
|
||||
{
|
||||
type: "category",
|
||||
label: "进阶",
|
||||
items: [
|
||||
{
|
||||
type: "autogenerated",
|
||||
dirName: "advanced",
|
||||
},
|
||||
],
|
||||
},
|
||||
{
|
||||
type: "category",
|
||||
label: "最佳实践",
|
||||
items: [
|
||||
{
|
||||
type: "autogenerated",
|
||||
dirName: "best-practice",
|
||||
},
|
||||
],
|
||||
},
|
||||
{
|
||||
type: "category",
|
||||
label: "开发者",
|
||||
items: [
|
||||
{
|
||||
type: "autogenerated",
|
||||
dirName: "developer",
|
||||
},
|
||||
],
|
||||
},
|
||||
],
|
||||
api: [{ type: "autogenerated", dirName: "api" }],
|
||||
ecosystem: [
|
||||
{
|
||||
type: "category",
|
||||
label: "关于我们",
|
||||
collapsible: false,
|
||||
items: [
|
||||
{
|
||||
type: "autogenerated",
|
||||
dirName: "community",
|
||||
},
|
||||
],
|
||||
},
|
||||
{
|
||||
type: "category",
|
||||
label: "开源之夏",
|
||||
collapsible: true,
|
||||
items: [
|
||||
{
|
||||
type: "autogenerated",
|
||||
dirName: "ospp",
|
||||
},
|
||||
],
|
||||
},
|
||||
{
|
||||
type: "category",
|
||||
label: "社区资源",
|
||||
collapsible: false,
|
||||
items: [
|
||||
{
|
||||
type: "link",
|
||||
label: "插件商店",
|
||||
href: "/store/plugins",
|
||||
},
|
||||
{
|
||||
type: "link",
|
||||
label: "适配器商店",
|
||||
href: "/store/adapters",
|
||||
},
|
||||
{
|
||||
type: "link",
|
||||
label: "驱动器商店",
|
||||
href: "/store/drivers",
|
||||
},
|
||||
{
|
||||
type: "link",
|
||||
label: "机器人商店",
|
||||
href: "/store/bots",
|
||||
},
|
||||
{
|
||||
type: "link",
|
||||
label: "Awesome NoneBot",
|
||||
href: "https://awesome.nonebot.dev",
|
||||
},
|
||||
{
|
||||
type: "link",
|
||||
label: "论坛",
|
||||
href: "https://discussions.nonebot.dev",
|
||||
},
|
||||
],
|
||||
},
|
||||
],
|
||||
changelog: [
|
||||
{
|
||||
type: "category",
|
||||
label: "更新日志",
|
||||
collapsible: false,
|
||||
items: changelogItems.map<{ type: "link"; label: string; href: string }>(
|
||||
(chunk, index) => ({
|
||||
type: "link",
|
||||
label: chunk[0]!.title,
|
||||
href: `/changelog/${
|
||||
index > 0 ? encodeURIComponent(chunk[0]!.title) : ""
|
||||
}`,
|
||||
})
|
||||
),
|
||||
},
|
||||
],
|
||||
};
|
||||
|
||||
export default sidebars;
|
Reference in New Issue
Block a user