Skip to content

Commit 39a9d2b

Browse files
authored
Merge pull request #740 from NoiseFan/docs/sidebar
docs(sideBar): Translate sidebar menu and page config
2 parents 5af6b06 + fc6219d commit 39a9d2b

File tree

1 file changed

+26
-9
lines changed

1 file changed

+26
-9
lines changed

.vitepress/config.ts

Lines changed: 26 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -113,15 +113,32 @@ export default ({ mode }: { mode: string }) => {
113113
themeConfig: {
114114
logo: '/logo.svg',
115115

116+
outline: {
117+
label: '页面导航',
118+
},
119+
116120
editLink: {
117-
pattern: 'https://github.com/vitest-dev/vitest/edit/main/docs/:path',
118-
text: 'Suggest changes to this page',
121+
pattern: 'https://github.com/vitest-dev/docs-cn/edit/dev/:path',
122+
text: '在 GitHub 上编辑此页面',
123+
},
124+
125+
lastUpdated: {
126+
text: '最后更新于',
127+
formatOptions: {
128+
dateStyle: 'full',
129+
timeStyle: 'medium',
130+
},
119131
},
120132

121133
search: {
122134
provider: 'local',
123135
},
124136

137+
docFooter: {
138+
prev: '上一页',
139+
next: '下一页',
140+
},
141+
125142
carbonAds: {
126143
code: 'CW7DVKJE',
127144
placement: 'vitestdev',
@@ -386,7 +403,7 @@ export default ({ mode }: { mode: string }) => {
386403
],
387404
},
388405
{
389-
text: 'Guides',
406+
text: '指南',
390407
collapsed: false,
391408
items: [
392409
{
@@ -411,7 +428,7 @@ export default ({ mode }: { mode: string }) => {
411428
'/blog': [],
412429
'/': [
413430
{
414-
text: 'Introduction',
431+
text: '简介',
415432
collapsed: false,
416433
items: introduction(),
417434
},
@@ -421,7 +438,7 @@ export default ({ mode }: { mode: string }) => {
421438
items: api(),
422439
},
423440
{
424-
text: 'Guides',
441+
text: '指南',
425442
collapsed: false,
426443
items: guide(),
427444
},
@@ -465,7 +482,7 @@ function footer(): DefaultTheme.SidebarItem[] {
465482
function introduction(): DefaultTheme.SidebarItem[] {
466483
return [
467484
{
468-
text: '简介',
485+
text: '为什么是vitest?',
469486
link: '/guide/why',
470487
},
471488
{
@@ -498,7 +515,7 @@ function guide(): DefaultTheme.SidebarItem[] {
498515
link: '/guide/projects',
499516
},
500517
{
501-
text: '报告器「Reporters」',
518+
text: '报告器',
502519
link: '/guide/reporters',
503520
},
504521
{
@@ -573,7 +590,7 @@ function guide(): DefaultTheme.SidebarItem[] {
573590
link: '/guide/environment',
574591
},
575592
{
576-
text: '扩展断言(Matchers)',
593+
text: '扩展断言',
577594
link: '/guide/extending-matchers',
578595
},
579596
{
@@ -623,7 +640,7 @@ function guide(): DefaultTheme.SidebarItem[] {
623640
function api(): DefaultTheme.SidebarItem[] {
624641
return [
625642
{
626-
text: 'Test API 索引',
643+
text: 'Test API',
627644
link: '/api/',
628645
},
629646
{

0 commit comments

Comments
 (0)