Skip to content

Commit

Permalink
docs: vuepress构建文档
Browse files Browse the repository at this point in the history
  • Loading branch information
snowykami committed Mar 28, 2024
1 parent fafdbea commit f3e45c8
Show file tree
Hide file tree
Showing 20 changed files with 255 additions and 269 deletions.
5 changes: 4 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -23,4 +23,7 @@ main.exe
main.cmdY
docs/.vuepress/.cache/
docs/.vuepress/.temp/
docs/.vuepress/dist/
docs/.vuepress/dist/
package.json
pnpm-lock.yaml
tsconfig.json
22 changes: 14 additions & 8 deletions docs/.vuepress/config.ts
Original file line number Diff line number Diff line change
@@ -1,15 +1,21 @@
import { defineUserConfig } from "vuepress";
import {defineUserConfig} from "vuepress";
import theme from "./theme.js";

export default defineUserConfig({
base: "/",
base: "/",

lang: "zh-CN",
title: "LiteyukiBot",
description: "vuepress-theme-hope 的文档演示",
lang: "zh-CN",
title: "LiteyukiBot",
description: "An OneBot Standard ChatBot",
head: [
// 设置 favor.ico,.vuepress/public 下
[
'link', {rel: 'icon', href: 'https://cdn.liteyuki.icu/favicon.ico'}
]
],

theme,
theme,

// 和 PWA 一起启用
// shouldPrefetch: false,
// 和 PWA 一起启用
// shouldPrefetch: false,
});
3 changes: 2 additions & 1 deletion docs/.vuepress/navbar.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,6 @@ import { navbar } from "vuepress-theme-hope";

export default navbar([
"/",
"/demo/",
"/deployment/",
"/usage/",
]);
Binary file modified docs/.vuepress/public/favicon.ico
Binary file not shown.
18 changes: 7 additions & 11 deletions docs/.vuepress/sidebar.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,22 +4,18 @@ export default sidebar({
"/": [
"",
{
text: "案例",
text: "项目部署",
icon: "laptop-code",
prefix: "demo/",
link: "demo/",
prefix: "deployment/",
link: "deployment/",
children: "structure",
},
{
text: "文档",
icon: "book",
prefix: "guide/",
text: "使用手册",
icon: "laptop-code",
prefix: "usage/",
link: "usage/",
children: "structure",
},
{
text: "幻灯片",
icon: "person-chalkboard",
link: "https://plugin-md-enhance.vuejs.press/zh/guide/content/revealjs/demo.html",
},
],
});
187 changes: 187 additions & 0 deletions docs/.vuepress/theme.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,187 @@
import {hopeTheme} from "vuepress-theme-hope";
import navbar from "./navbar.js";
import sidebar from "./sidebar.js";

export default hopeTheme({
hostname: "https://vuepress-theme-hope-docs-demo.netlify.app",

author: {
name: "SnowyKami",
url: "https://snowykami.me",
},

iconAssets: "fontawesome-with-brands",

logo: "https://cdn.liteyuki.icu/static/img/logo.png",

repo: "https://github.com/snowykami/LiteyukiBot",

docsDir: "src",

// 导航栏
navbar,

// 侧边栏
sidebar,

// 页脚
footer: "LiteyukiBot",
displayFooter: true,

// 加密配置
encrypt: {
config: {
"/demo/encrypt.html": ["1234"],
},
},

// 多语言配置
metaLocales: {
editLink: "在 GitHub 上编辑此页",
},

// 如果想要实时查看任何改变,启用它。注: 这对更新性能有很大负面影响
// hotReload: true,

// 在这里配置主题提供的插件
plugins: {
// 你应该自行生成自己的评论服务
comment: {
provider: "Giscus",
repo: "vuepress-theme-hope/giscus-discussions",
repoId: "R_kgDOG_Pt2A",
category: "Announcements",
categoryId: "DIC_kwDOG_Pt2M4COD69",
},

components: {
components: ["Badge", "VPCard"],
},

// 此处开启了很多功能用于演示,你应仅保留用到的功能。
mdEnhance: {
align: true,
attrs: true,
codetabs: true,
component: true,
demo: true,
figure: true,
imgLazyload: true,
imgSize: true,
include: true,
mark: true,
stylize: [
{
matcher: "Recommended",
replacer: ({tag}) => {
if (tag === "em")
return {
tag: "Badge",
attrs: {type: "tip"},
content: "Recommended",
};
},
},
],
sub: true,
sup: true,
tabs: true,
vPre: true,

// 在启用之前安装 chart.js
// chart: true,

// insert component easily

// 在启用之前安装 echarts
// echarts: true,

// 在启用之前安装 flowchart.ts
// flowchart: true,

// gfm requires mathjax-full to provide tex support
// gfm: true,

// 在启用之前安装 katex
// katex: true,

// 在启用之前安装 mathjax-full
// mathjax: true,

// 在启用之前安装 mermaid
// mermaid: true,

// playground: {
// presets: ["ts", "vue"],
// },

// 在启用之前安装 reveal.js
// revealJs: {
// plugins: ["highlight", "math", "search", "notes", "zoom"],
// },

// 在启用之前安装 @vue/repl
// vuePlayground: true,

// install sandpack-vue3 before enabling it
// sandpack: true,
},

// 如果你需要 PWA。安装 @vuepress/plugin-pwa 并取消下方注释
// pwa: {
// favicon: "/favicon.ico",
// cacheHTML: true,
// cachePic: true,
// appendBase: true,
// apple: {
// icon: "/assets/icon/apple-icon-152.png",
// statusBarColor: "black",
// },
// msTile: {
// image: "/assets/icon/ms-icon-144.png",
// color: "#ffffff",
// },
// manifest: {
// icons: [
// {
// src: "/assets/icon/chrome-mask-512.png",
// sizes: "512x512",
// purpose: "maskable",
// type: "image/png",
// },
// {
// src: "/assets/icon/chrome-mask-192.png",
// sizes: "192x192",
// purpose: "maskable",
// type: "image/png",
// },
// {
// src: "/assets/icon/chrome-512.png",
// sizes: "512x512",
// type: "image/png",
// },
// {
// src: "/assets/icon/chrome-192.png",
// sizes: "192x192",
// type: "image/png",
// },
// ],
// shortcuts: [
// {
// name: "Demo",
// short_name: "Demo",
// url: "/demo/",
// icons: [
// {
// src: "/assets/icon/guide-maskable.png",
// sizes: "192x192",
// purpose: "maskable",
// type: "image/png",
// },
// ],
// },
// ],
// },
// },
},
});
Loading

0 comments on commit f3e45c8

Please sign in to comment.