Skip to content

Commit

Permalink
feat: 调整文档链接
Browse files Browse the repository at this point in the history
  • Loading branch information
tuanzisama committed Dec 24, 2024
1 parent 233b3a3 commit bd73f90
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 10 deletions.
23 changes: 15 additions & 8 deletions .vitepress/config.mts
Original file line number Diff line number Diff line change
Expand Up @@ -7,18 +7,20 @@ import { withMermaid } from "vitepress-plugin-mermaid";
export default withMermaid({
title: "NitWikit",
description: "一群笨蛋们写的 Minecraft 开服教程",
lang: "zh-CN",
ignoreDeadLinks: true,
lastUpdated: true,
srcDir: "docs",
srcExclude: ["**/README.md"],
cleanUrls: true,
vite: {
publicDir: "../public",
assetsInclude: ["**/*.JPG", "**/*.PNG"],
plugins: [
{
name: "nitwikit-transformer",
enforce: "pre",
transform(code, id, options) {
transform(code, id) {
if (id.endsWith(".md")) {
return code
.replace(/import ([\s\S]+) from ['"](@theme\/[\s\S]+)['"];/g, "")
Expand All @@ -39,20 +41,25 @@ export default withMermaid({
include: ['@braintree/sanitize-url', 'dayjs', 'debug', 'cytoscape-cose-bilkent', 'cytoscape']
}
},
lang: "zh-CN",
themeConfig: {
nav: [
{ text: "通用", link: "/nitwikit/docs/intro.md" },
{ text: "Java", link: "/nitwikit/docs-java/intro.md" },
{ text: "Bedrock", link: "/nitwikit/docs-bedrock/intro.md" },
{ text: "通用", link: "/intro.md" },
{ text: "Java", link: "/Java/intro.md" },
{ text: "Bedrock", link: "/Bedrock/intro.md" },
],
sidebar: {
"/nitwikit/docs": await getSidebar(resolve(import.meta.dirname, "../docs/nitwikit/docs"), "nitwikit/docs"),
"/nitwikit/docs-java/": await getSidebar(resolve(import.meta.dirname, "../docs/nitwikit/docs-java"), "nitwikit/docs-java"),
"/nitwikit/docs-bedrock/": await getSidebar(resolve(import.meta.dirname, "../docs/nitwikit/docs-bedrock"), "nitwikit/docs-bedrock"),
"/": await getSidebar(resolve(import.meta.dirname, "../docs/nitwikit/docs"), ""),
"/Java/": await getSidebar(resolve(import.meta.dirname, "../docs/nitwikit/docs-java"), "Java"),
"/Bedrock/": await getSidebar(resolve(import.meta.dirname, "../docs/nitwikit/docs-bedrock"), "Bedrock"),
},
...themeConfig,
},
rewrites: {
"nitwikit/docs/(.*)": "(.*)",
"nitwikit/docs-java/(.*)": "Java/(.*)",
"nitwikit/docs-bedrock/(.*)": "Bedrock/(.*)",
"nitwikit/:pkg/(.*)": ":pkg/(.*)",
},
// transformHtml: (code) => {
// return code.replace(/import ([\s\S]+) from '(@theme\/[\s\S]+)'(;)/g, "");
// },
Expand Down
4 changes: 2 additions & 2 deletions docs/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,10 @@ hero:
actions:
- theme: brand
text: 快速开始 🥵
link: /nitwikit/docs/intro
link: /intro
image:
src: /book.png
alt: VitePress
alt: NitWikit (VitePress)

features:
- title: 「简单」
Expand Down

0 comments on commit bd73f90

Please sign in to comment.