Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
关联 issue
#45
新增 API
doc.locales
Array<string, string>
[['en-US', 'EN'], ['zh-CN', '中文']]
该配置为二维数组,第一项配置会作为站点默认的 locale;
每一项配置是一个长度为 2 的数组,数组的第一个值代表该 locale 的 name,会用于拼接路由前缀和检测文件名属于什么 locale,第二个值代表该 locale 的 label,会用作语言切换时的选项显示。
运行逻辑
如果目录树结构为:
. └── src/ ├── index.en-US.md ├── index.zh-CN.md
在
en-US
为默认语言的情况下,生成的路由配置会变成:menu 的内容也会随语言的切换而变化。
预览效果