nonebot2/docs/.vuepress/config.js

274 lines
7.3 KiB
JavaScript
Raw Normal View History

2020-08-23 09:03:59 +00:00
const path = require("path");
2021-07-14 02:42:47 +00:00
module.exports = (context) => ({
2020-11-21 17:51:23 +00:00
base: process.env.VUEPRESS_BASE || "/",
2020-06-30 04:10:57 +00:00
title: "NoneBot",
2021-02-02 13:55:18 +00:00
description: "跨平台 Python 异步 QQ 机器人框架",
2020-06-30 04:10:57 +00:00
markdown: {
2021-07-14 02:42:47 +00:00
lineNumbers: true,
2020-06-30 04:10:57 +00:00
},
/**
* Extra tags to be injected to the page HTML `<head>`
*
* refhttps://v1.vuepress.vuejs.org/config/#head
*/
head: [
["link", { rel: "icon", href: "/logo.png" }],
["link", { rel: "manifest", href: "/manifest.json" }],
["meta", { name: "theme-color", content: "#ea5252" }],
2020-06-30 04:10:57 +00:00
["meta", { name: "application-name", content: "NoneBot" }],
["meta", { name: "apple-mobile-web-app-title", content: "NoneBot" }],
["meta", { name: "apple-mobile-web-app-capable", content: "yes" }],
[
"meta",
2021-07-14 02:42:47 +00:00
{ name: "apple-mobile-web-app-status-bar-style", content: "black" },
2020-09-17 05:12:48 +00:00
],
[
"link",
2021-07-14 02:42:47 +00:00
{ rel: "apple-touch-icon", href: "/icons/apple-touch-icon-180x180.png" },
],
[
"link",
{
rel: "mask-icon",
href: "/icons/safari-pinned-tab.svg",
2021-07-14 02:42:47 +00:00
color: "#ea5252",
},
],
[
"meta",
{
name: "msapplication-TileImage",
2021-07-14 02:42:47 +00:00
content: "/icons/mstile-150x150.png",
},
],
["meta", { name: "msapplication-TileColor", content: "#ea5252" }],
2020-09-17 05:12:48 +00:00
[
"link",
{
rel: "stylesheet",
2021-07-14 02:42:47 +00:00
href: "https://cdn.jsdelivr.net/npm/@fortawesome/fontawesome-free@5/css/all.min.css",
},
],
2020-06-30 04:10:57 +00:00
],
2020-08-23 09:03:59 +00:00
locales: {
"/": {
lang: "zh-CN",
title: "NoneBot",
2021-07-14 02:42:47 +00:00
description: "跨平台 Python 异步 QQ 机器人框架",
},
2020-08-23 09:03:59 +00:00
},
2020-06-30 04:10:57 +00:00
2020-10-17 17:39:34 +00:00
theme: "nonebot",
2020-06-30 04:10:57 +00:00
themeConfig: {
2020-08-23 09:03:59 +00:00
logo: "/logo.png",
2020-10-11 06:51:37 +00:00
repo: "nonebot/nonebot2",
2020-08-20 08:34:07 +00:00
docsDir: "docs",
2020-10-11 06:51:37 +00:00
docsBranch: "dev",
2020-08-23 09:03:59 +00:00
docsDirVersioned: "archive",
docsDirPages: "pages",
2020-06-30 04:10:57 +00:00
editLinks: true,
2020-08-20 08:34:07 +00:00
smoothScroll: true,
2020-08-23 09:03:59 +00:00
locales: {
"/": {
label: "简体中文",
selectText: "Languages",
editLinkText: "在 GitHub 上编辑此页",
lastUpdated: "上次更新",
2020-09-12 05:45:03 +00:00
nav: [
{ text: "主页", link: "/" },
{ text: "指南", link: "/guide/" },
2020-11-18 00:48:23 +00:00
{ text: "进阶", link: "/advanced/" },
2020-10-20 16:55:23 +00:00
{ text: "API", link: "/api/" },
2021-03-05 08:27:43 +00:00
{ text: "商店", link: "/store" },
2021-07-14 02:42:47 +00:00
{ text: "更新日志", link: "/changelog" },
2020-09-12 05:45:03 +00:00
],
2020-09-22 07:41:56 +00:00
sidebarDepth: 2,
2020-08-23 09:03:59 +00:00
sidebar: {
2020-09-12 05:45:03 +00:00
"/guide/": [
{
2020-11-07 04:36:47 +00:00
title: "开始",
2020-09-12 05:45:03 +00:00
collapsable: false,
sidebar: "auto",
2020-09-17 05:12:48 +00:00
children: [
"",
"installation",
"getting-started",
2020-09-17 10:23:41 +00:00
"creating-a-project",
2021-07-14 02:42:47 +00:00
"basic-configuration",
],
2020-11-07 04:36:47 +00:00
},
{
title: "编写插件",
collapsable: false,
sidebar: "auto",
children: [
"loading-a-plugin",
2020-11-09 04:47:59 +00:00
"creating-a-plugin",
2020-11-10 06:30:18 +00:00
"creating-a-matcher",
2020-11-12 01:32:35 +00:00
"creating-a-handler",
2021-07-14 02:42:47 +00:00
"end-or-start",
],
2020-12-31 09:58:09 +00:00
},
{
title: "协议适配",
collapsable: false,
sidebar: "auto",
2021-07-14 02:42:47 +00:00
children: [
"cqhttp-guide",
"ding-guide",
"mirai-guide",
"feishu-guide",
],
},
2020-09-12 05:45:03 +00:00
],
2020-11-18 00:48:23 +00:00
"/advanced/": [
{
title: "进阶",
collapsable: false,
sidebar: "auto",
2020-11-23 05:41:57 +00:00
children: [
"",
"scheduler",
"permission",
"runtime-hook",
2020-12-22 01:59:48 +00:00
"export-and-require",
2021-07-14 02:42:47 +00:00
"overloaded-handlers",
],
2020-11-23 05:46:36 +00:00
},
{
title: "发布",
collapsable: false,
sidebar: "auto",
2021-07-14 02:42:47 +00:00
children: ["publish-plugin"],
},
2020-11-18 00:48:23 +00:00
],
2020-08-23 09:03:59 +00:00
"/api/": [
2020-08-20 07:07:05 +00:00
{
2020-08-23 09:03:59 +00:00
title: "NoneBot Api Reference",
path: "",
collapsable: false,
children: [
{
title: "nonebot 模块",
2021-07-14 02:42:47 +00:00
path: "nonebot",
2020-08-23 09:03:59 +00:00
},
2020-09-12 16:18:31 +00:00
{
title: "nonebot.config 模块",
2021-07-14 02:42:47 +00:00
path: "config",
2020-09-12 16:18:31 +00:00
},
2020-10-18 07:04:45 +00:00
{
title: "nonebot.plugin 模块",
2021-07-14 02:42:47 +00:00
path: "plugin",
2020-10-18 07:04:45 +00:00
},
2020-11-13 09:15:45 +00:00
{
title: "nonebot.message 模块",
2021-07-14 02:42:47 +00:00
path: "message",
2020-11-13 09:15:45 +00:00
},
2020-09-12 16:18:31 +00:00
{
title: "nonebot.matcher 模块",
2021-07-14 02:42:47 +00:00
path: "matcher",
2020-08-23 09:03:59 +00:00
},
2021-03-20 07:41:50 +00:00
{
title: "nonebot.handler 模块",
2021-07-14 02:42:47 +00:00
path: "handler",
2021-03-20 07:41:50 +00:00
},
2020-09-13 05:01:23 +00:00
{
title: "nonebot.rule 模块",
2021-07-14 02:42:47 +00:00
path: "rule",
2020-09-13 05:01:23 +00:00
},
2020-09-14 12:48:03 +00:00
{
title: "nonebot.permission 模块",
2021-07-14 02:42:47 +00:00
path: "permission",
2020-09-14 12:48:03 +00:00
},
{
title: "nonebot.log 模块",
2021-07-14 02:42:47 +00:00
path: "log",
},
2020-09-12 16:43:31 +00:00
{
title: "nonebot.utils 模块",
2021-07-14 02:42:47 +00:00
path: "utils",
2020-09-12 16:43:31 +00:00
},
2020-08-23 09:03:59 +00:00
{
title: "nonebot.typing 模块",
2021-07-14 02:42:47 +00:00
path: "typing",
},
{
2020-08-23 09:03:59 +00:00
title: "nonebot.exception 模块",
2021-07-14 02:42:47 +00:00
path: "exception",
2020-09-29 14:33:08 +00:00
},
2020-10-11 05:17:40 +00:00
{
title: "nonebot.drivers 模块",
2021-07-14 02:42:47 +00:00
path: "drivers/",
2020-10-11 05:17:40 +00:00
},
{
title: "nonebot.drivers.fastapi 模块",
2021-07-14 02:42:47 +00:00
path: "drivers/fastapi",
2020-10-11 05:17:40 +00:00
},
{
title: "nonebot.drivers.quart 模块",
2021-07-14 02:42:47 +00:00
path: "drivers/quart",
},
2020-09-29 15:10:29 +00:00
{
title: "nonebot.adapters 模块",
2021-07-14 02:42:47 +00:00
path: "adapters/",
2020-09-29 15:10:29 +00:00
},
2020-09-29 14:33:08 +00:00
{
title: "nonebot.adapters.cqhttp 模块",
2021-07-14 02:42:47 +00:00
path: "adapters/cqhttp",
2020-12-03 08:04:14 +00:00
},
{
title: "nonebot.adapters.ding 模块",
2021-07-14 02:42:47 +00:00
path: "adapters/ding",
},
{
title: "nonebot.adapters.mirai 模块",
2021-07-14 02:42:47 +00:00
path: "adapters/mirai",
},
{
title: "nonebot.adapters.feishu 模块",
path: "adapters/feishu",
},
],
},
],
},
},
},
2020-06-30 04:10:57 +00:00
},
2020-08-23 09:03:59 +00:00
plugins: [
"@vuepress/plugin-back-to-top",
"@vuepress/plugin-medium-zoom",
[
"@vuepress/pwa",
{
serviceWorker: true,
updatePopup: {
message: "发现新内容",
2021-07-14 02:42:47 +00:00
buttonText: "刷新",
},
},
],
2020-08-23 09:03:59 +00:00
[
"versioning",
{
versionedSourceDir: path.resolve(context.sourceDir, "..", "archive"),
pagesSourceDir: path.resolve(context.sourceDir, "..", "pages"),
onNewVersion(version, versionDestPath) {
console.log(`Created version ${version} in ${versionDestPath}`);
2021-07-14 02:42:47 +00:00
},
},
2020-09-17 05:12:48 +00:00
],
[
"container",
{
type: "vue",
before: '<pre class="vue-container"><code>',
2021-07-14 02:42:47 +00:00
after: "</code></pre>",
},
],
],
2020-08-23 09:03:59 +00:00
});