11// @ts -check
22
3+ const pkg = require ( '../package.json' )
4+
35/**
46 * @type {import('vitepress').UserConfig }
57 */
68module . exports = {
7- title : 'Vite' ,
8- description : 'Next Generation Frontend Tooling' ,
9- head : [ [ 'link' , { rel : 'icon' , type : 'image/svg+xml' , href : '/logo.svg' } ] ] ,
9+ title : 'Vite 官方中文文档' ,
10+ lang : 'zh-CN' ,
11+ description : '下一代前端开发与构建工具' ,
12+ head : [
13+ [ 'link' , { rel : 'icon' , type : 'image/svg+xml' , href : '/logo.svg' } ] ,
14+ [ 'script' , { src : 'https://cdn.wwads.cn/js/makemoney.js' , async : '' } ]
15+ ] ,
1016 vue : {
1117 reactivityTransform : true
1218 } ,
1319 themeConfig : {
14- repo : 'vitejs/vite' ,
20+ repo : pkg . repository ,
1521 logo : '/logo.svg' ,
16- docsDir : 'docs' ,
1722 docsBranch : 'main' ,
1823 editLinks : true ,
19- editLinkText : 'Suggest changes to this page ' ,
24+ editLinkText : '为此页提供修改建议 ' ,
2025
2126 algolia : {
2227 apiKey : 'b573aa848fd57fb47d693b531297403c' ,
2328 indexName : 'vitejs' ,
2429 searchParameters : {
25- facetFilters : [ 'tags:en ' ]
30+ facetFilters : [ 'tags:cn ' ]
2631 }
2732 } ,
2833
29- carbonAds : {
30- carbon : 'CEBIEK3N' ,
31- placement : 'vitejsdev'
32- } ,
33-
3434 nav : [
35- { text : 'Guide ' , link : '/guide/' } ,
36- { text : 'Config ' , link : '/config/' } ,
37- { text : 'Plugins ' , link : '/plugins/' } ,
35+ { text : '指引 ' , link : '/guide/' } ,
36+ { text : '配置 ' , link : '/config/' } ,
37+ { text : '插件 ' , link : '/plugins/' } ,
3838 {
39- text : 'Links ' ,
39+ text : '相关链接 ' ,
4040 items : [
4141 {
4242 text : 'Twitter' ,
@@ -51,21 +51,21 @@ module.exports = {
5151 link : 'https://github.com/vitejs/awesome-vite'
5252 } ,
5353 {
54- text : 'DEV Community ' ,
54+ text : 'Dev.to 社区 ' ,
5555 link : 'https://dev.to/t/vite'
5656 } ,
5757 {
58- text : 'Rollup Plugins Compat ' ,
58+ text : 'Rollup 插件兼容 ' ,
5959 link : 'https://vite-rollup-plugins.patak.dev/'
6060 } ,
6161 {
62- text : 'Changelog ' ,
62+ text : '更新日志 ' ,
6363 link : 'https://github.com/vitejs/vite/blob/main/packages/vite/CHANGELOG.md'
6464 }
6565 ]
6666 } ,
6767 {
68- text : 'Languages ' ,
68+ text : '多语言 ' ,
6969 items : [
7070 {
7171 text : 'English' ,
@@ -89,67 +89,67 @@ module.exports = {
8989 // catch-all fallback
9090 '/' : [
9191 {
92- text : 'Guide ' ,
92+ text : '指引 ' ,
9393 children : [
9494 {
95- text : 'Why Vite' ,
95+ text : '为什么选 Vite' ,
9696 link : '/guide/why'
9797 } ,
9898 {
99- text : 'Getting Started ' ,
99+ text : '开始 ' ,
100100 link : '/guide/'
101101 } ,
102102 {
103- text : 'Features ' ,
103+ text : '功能 ' ,
104104 link : '/guide/features'
105105 } ,
106106 {
107- text : 'Using Plugins ' ,
107+ text : '使用插件 ' ,
108108 link : '/guide/using-plugins'
109109 } ,
110110 {
111- text : 'Dependency Pre-Bundling ' ,
111+ text : '依赖预构建 ' ,
112112 link : '/guide/dep-pre-bundling'
113113 } ,
114114 {
115- text : 'Static Asset Handling ' ,
115+ text : '静态资源处理 ' ,
116116 link : '/guide/assets'
117117 } ,
118118 {
119- text : 'Building for Production ' ,
119+ text : '构建生产版本 ' ,
120120 link : '/guide/build'
121121 } ,
122122 {
123- text : 'Deploying a Static Site ' ,
123+ text : '部署静态站点 ' ,
124124 link : '/guide/static-deploy'
125125 } ,
126126 {
127- text : 'Env Variables and Modes ' ,
127+ text : '环境变量与模式 ' ,
128128 link : '/guide/env-and-mode'
129129 } ,
130130 {
131- text : 'Server-Side Rendering ( SSR) ' ,
131+ text : '服务端渲染( SSR) ' ,
132132 link : '/guide/ssr'
133133 } ,
134134 {
135- text : 'Backend Integration ' ,
135+ text : '后端集成 ' ,
136136 link : '/guide/backend-integration'
137137 } ,
138138 {
139- text : 'Comparisons ' ,
139+ text : '比较 ' ,
140140 link : '/guide/comparisons'
141141 } ,
142142 {
143- text : 'Migration from v1 ' ,
143+ text : '从 v1 迁移 ' ,
144144 link : '/guide/migration'
145145 }
146146 ]
147147 } ,
148148 {
149- text : 'APIs ' ,
149+ text : 'API ' ,
150150 children : [
151151 {
152- text : 'Plugin API' ,
152+ text : '插件 API' ,
153153 link : '/guide/api-plugin'
154154 } ,
155155 {
@@ -161,12 +161,21 @@ module.exports = {
161161 link : '/guide/api-javascript'
162162 } ,
163163 {
164- text : 'Config Reference ' ,
164+ text : '配置参考 ' ,
165165 link : '/config/'
166166 }
167167 ]
168168 }
169169 ]
170170 }
171+ } ,
172+
173+ markdown : {
174+ anchor : {
175+ renderPermalink : require ( './render-perma-link' )
176+ } ,
177+ config : ( md ) => {
178+ md . use ( require ( './markdown-it-custom-anchor' ) )
179+ }
171180 }
172181}
0 commit comments