-
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
docs(zh_CN): add Chinese documentation for FriendsOfHyperf (#756)
* docs(zh_CN): add Chinese documentation for FriendsOfHyperf - Create new documentation files for Amqp Job and Cache components - Add guide, reference, and FAQ sections in Chinese - Set up navigation and sidebar menus for Chinese documentation - Configure VitePress for multi-language support * fix
- Loading branch information
Showing
14 changed files
with
357 additions
and
14 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,28 +1,103 @@ | ||
import { defineConfig } from 'vitepress' | ||
import enGetNavs from "./src/en/nav"; | ||
import zhGetNavs from "./src/zh/nav"; | ||
import enGetConfig from "./src/en/config"; | ||
import zhGetConfig from "./src/zh/config"; | ||
import zhGetSidebar from "./src/zh/sidebars"; | ||
import enGetSidebar from "./src/en/sidebars"; | ||
|
||
// https://vitepress.dev/reference/site-config | ||
export default defineConfig({ | ||
title: "FriendsOfHyperf", | ||
description: "A Hyperf component", | ||
ignoreDeadLinks: true, | ||
locales:{ | ||
root:{ | ||
label:"中文", | ||
lang:"zh", | ||
...zhGetConfig, | ||
}, | ||
en:{ | ||
label:"English", | ||
lang:"en", | ||
link:"/en/index", | ||
...enGetConfig, | ||
themeConfig:{ | ||
logo: '/logo.svg', | ||
nav: enGetNavs, | ||
sidebar:enGetSidebar, | ||
outline:{ | ||
level:[2 ,4], | ||
}, | ||
} | ||
} | ||
}, | ||
themeConfig: { | ||
outline:{ | ||
label: '页面导航', | ||
level: [2, 4], | ||
}, | ||
editLink: { | ||
pattern: 'https://github.com/friendsofhyperf/components/edit/main/docs/:path', | ||
text: '在Github上编辑此页面', | ||
}, | ||
lastUpdated: { | ||
text: '最后更新于', | ||
}, | ||
docFooter: { | ||
next: '下一页', | ||
prev: '上一页', | ||
}, | ||
sidebarMenuLabel: '菜单', | ||
returnToTopLabel: '回到顶部', | ||
search:{ | ||
provider:"local", | ||
options:{ | ||
locales: { | ||
zh: { | ||
translations: { | ||
button: { | ||
buttonText: '搜索文档', | ||
buttonAriaLabel: '搜索文档' | ||
}, | ||
modal: { | ||
noResultsText: '无法找到相关结果', | ||
resetButtonTitle: '清除查询条件', | ||
footer: { | ||
selectText: '选择', | ||
navigateText: '切换' | ||
} | ||
} | ||
} | ||
}, | ||
en: { | ||
translations: { | ||
button: { | ||
buttonText: 'Search documents', | ||
buttonAriaLabel: 'Search documents' | ||
}, | ||
modal: { | ||
noResultsText: 'No relevant results found', | ||
resetButtonTitle: 'Clear query conditions', | ||
footer: { | ||
selectText: 'Select', | ||
navigateText: 'Switch' | ||
} | ||
} | ||
} | ||
} | ||
} | ||
} | ||
}, | ||
i18nRouting:false, | ||
// https://vitepress.dev/reference/default-theme-config | ||
nav: [ | ||
{ text: 'Home', link: '/' }, | ||
{ text: 'Examples', link: '/markdown-examples' } | ||
], | ||
|
||
sidebar: [ | ||
{ | ||
text: 'Examples', | ||
items: [ | ||
{ text: 'Markdown Examples', link: '/markdown-examples' }, | ||
{ text: 'Runtime API Examples', link: '/api-examples' } | ||
] | ||
} | ||
], | ||
nav: zhGetNavs, | ||
|
||
sidebar: zhGetSidebar, | ||
|
||
socialLinks: [ | ||
{ icon: 'github', link: 'https://github.com/friendsofhyperf/components' } | ||
{ icon: 'github', link: 'https://github.com/friendsofhyperf/components' }, | ||
] | ||
} | ||
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
export default { | ||
title: "FriendsOfHyperf", | ||
description: "A Hyperf component", | ||
tagline: "Hyperf component", | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
import {DefaultTheme} from "vitepress"; | ||
|
||
const nav:DefaultTheme.NavItem[] = [ | ||
{ text: '指南', link: '/zh/guide/' }, | ||
{ text: '参考', link: '/zh/reference/' }, | ||
{ text: '常见问题', link: '/zh/faq/index' } | ||
] | ||
|
||
export default nav |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
import {DefaultTheme} from "vitepress"; | ||
|
||
const sidebar:DefaultTheme.Sidebar = { | ||
'/zh/guide/': [ | ||
{ | ||
text: '介绍', | ||
items: [ | ||
{ | ||
text: '关于 FriendsOfHyperf', | ||
link: '/zh_CN/guide/introduce/about', | ||
}, | ||
] | ||
}, | ||
{ | ||
text: '开始', | ||
items: [ | ||
{ | ||
text: "组件列表", | ||
link: "/zh_CN/guide/start/components" | ||
} | ||
] | ||
} | ||
] | ||
} | ||
|
||
export default sidebar |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
export default { | ||
title: "FriendsOfHyperf", | ||
description: "A Hyperf component", | ||
tagline: "Hyperf component", | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
import {DefaultTheme} from "vitepress"; | ||
|
||
const nav:DefaultTheme.NavItem[] = [ | ||
{ text: '指南', link: '/zh_CN/guide/' }, | ||
{ text: '参考', link: '/zh_CN/reference/' }, | ||
{ text: '常见问题', link: '/zh_CN/faq/index' } | ||
] | ||
|
||
export default nav |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
import {DefaultTheme} from "vitepress"; | ||
|
||
const sidebar:DefaultTheme.Sidebar = { | ||
'/zh_CN/guide/': [ | ||
{ | ||
text: '介绍', | ||
items: [ | ||
{ | ||
text: '关于 FriendsOfHyperf', | ||
link: '/zh_CN/guide/introduce/about', | ||
}, | ||
] | ||
}, | ||
{ | ||
text: '开始', | ||
items: [ | ||
{ | ||
text: "支持的组件列表", | ||
link: "/zh_CN/guide/start/components" | ||
} | ||
] | ||
} | ||
], | ||
'/zh_CN/reference/':[ | ||
{ | ||
text: 'Amqp Job', | ||
link: '/zh_CN/reference/amqp-job' | ||
}, | ||
{ | ||
text: 'Cache', | ||
link: '/zh_CN/reference/cache' | ||
} | ||
] | ||
} | ||
|
||
export default sidebar |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
# 常见问题 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
# 指南 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
# 关于 FriendsOfHyperf |
Oops, something went wrong.