|
| 1 | +import { defineConfig } from "vitepress"; |
| 2 | +import pkg from '../../../package.json' with { type: 'json' } |
| 3 | + |
| 4 | +export const zh = defineConfig({ |
| 5 | + lang: "zh-Hans", |
| 6 | + description: "观测你的包裹大小", |
| 7 | + |
| 8 | + themeConfig: { |
| 9 | + nav: nav(), |
| 10 | + |
| 11 | + sidebar: { |
| 12 | + "/zh/guide/": { base: "/zh/guide/", items: sidebarGuide() }, |
| 13 | + "/zh/reference/": { |
| 14 | + base: "/zh/reference/", |
| 15 | + items: sidebarReference(), |
| 16 | + }, |
| 17 | + }, |
| 18 | + |
| 19 | + editLink: { |
| 20 | + pattern: |
| 21 | + "https://github.com/bundlewatch/bundlewatch.io/edit/master/docs/:path", |
| 22 | + text: "在GitHub上编辑此页面", |
| 23 | + }, |
| 24 | + |
| 25 | + outline: { |
| 26 | + level: "deep", |
| 27 | + }, |
| 28 | + |
| 29 | + footer: { |
| 30 | + message: "根据 MIT 许可证发布。", |
| 31 | + copyright: `版权所有 © 2018-至今 BundleWatch`, |
| 32 | + }, |
| 33 | + }, |
| 34 | +}); |
| 35 | + |
| 36 | +function nav() { |
| 37 | + return [ |
| 38 | + { |
| 39 | + text: "指南", |
| 40 | + link: "/zh/guide/what-is-it", |
| 41 | + activeMatch: "/zh/guide/", |
| 42 | + }, |
| 43 | + { |
| 44 | + text: "参考", |
| 45 | + link: "/zh/reference/configuration", |
| 46 | + activeMatch: "/zh/reference/", |
| 47 | + }, |
| 48 | + { |
| 49 | + text: pkg.bundlewatch.version, |
| 50 | + items: [ |
| 51 | + { |
| 52 | + text: "Release Notes", |
| 53 | + link: "https://github.com/bundlewatch/bundlewatch/releases/tag/v0.4.1", |
| 54 | + target: "_blank", |
| 55 | + }, |
| 56 | + { |
| 57 | + text: "Contributing", |
| 58 | + link: "https://github.com/bundlewatch/bundlewatch/blob/master/CONTRIBUTING.md", |
| 59 | + target: "_blank", |
| 60 | + }, |
| 61 | + ], |
| 62 | + }, |
| 63 | + ]; |
| 64 | +} |
| 65 | + |
| 66 | +function sidebarGuide() { |
| 67 | + return [ |
| 68 | + { |
| 69 | + text: "介绍", |
| 70 | + items: [ |
| 71 | + { text: "这是什么?", link: "what-is-it" }, |
| 72 | + { text: "快速开始", link: "getting-started" }, |
| 73 | + ], |
| 74 | + }, |
| 75 | + { |
| 76 | + text: "如何使用", |
| 77 | + items: [ |
| 78 | + { text: "使用 BundleWatch", link: "using-bundlewatch" }, |
| 79 | + { text: "使用配置文件", link: "using-a-config-file" }, |
| 80 | + { |
| 81 | + text: "对比非主分支的构建差异", |
| 82 | + link: "diffing-against-branches-other-than-master", |
| 83 | + }, |
| 84 | + { text: "使用自定义服务器", link: "using-a-custom-server" }, |
| 85 | + ], |
| 86 | + }, |
| 87 | + { |
| 88 | + text: "配置、API 和 CLI 参考", |
| 89 | + base: "/zh/reference/", |
| 90 | + link: "/configuration", |
| 91 | + }, |
| 92 | + ]; |
| 93 | +} |
| 94 | + |
| 95 | +function sidebarReference() { |
| 96 | + return [ |
| 97 | + { |
| 98 | + text: "参考", |
| 99 | + items: [ |
| 100 | + { text: "配置项", link: "configuration" }, |
| 101 | + { text: "NodeJS API", link: "nodejs" }, |
| 102 | + { text: "CLI 参数", link: "cli" }, |
| 103 | + ], |
| 104 | + }, |
| 105 | + ]; |
| 106 | +} |
0 commit comments