-
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(i18n): add i18n support for vitepress (#49)
* chore(docs): add logo for docs * docs(i18n): add i18n support
- Loading branch information
Showing
7 changed files
with
153 additions
and
32 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
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,37 +1,12 @@ | ||
import { defineConfig } from 'vitepress'; | ||
import { shared } from './shared'; | ||
import { zh } from './zh'; | ||
import { en } from './en'; | ||
|
||
// https://vitepress.dev/reference/site-config | ||
export default defineConfig({ | ||
lang: 'en-US', | ||
title: 'Grassator', | ||
description: 'Secure, modern and fast multi-process downloader', | ||
themeConfig: { | ||
// https://vitepress.dev/reference/default-theme-config | ||
logo: '/logo.png', | ||
|
||
nav: [{ text: 'Home', link: '/' }], | ||
|
||
sidebar: [], | ||
|
||
socialLinks: [ | ||
{ icon: 'github', link: 'https://github.com/noctisynth/Grassator' }, | ||
], | ||
|
||
footer: { | ||
message: | ||
'Released under the <a href="https://github.com/noctisynth/Grassator/blob/main/LICENSE-MIT">MIT License</a> and <a href="https://github.com/noctisynth/Grassator/blob/main/LICENSE-AGPL">AGPLv3 License</a>.', | ||
copyright: | ||
'Copyright © 2011-present <a href="https://github.com/noctisynth">Noctisynth, Inc.</a>', | ||
}, | ||
}, | ||
...shared, | ||
locales: { | ||
root: { | ||
label: 'English', | ||
lang: 'en-US', | ||
}, | ||
zh: { | ||
label: '简体中文', | ||
lang: 'zh-CN', | ||
}, | ||
root: { label: 'English', ...en }, | ||
zh: { label: '简体中文', ...zh }, | ||
}, | ||
}); |
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,19 @@ | ||
import { defineConfig, type DefaultTheme } from 'vitepress'; | ||
|
||
export const en = defineConfig({ | ||
lang: 'en-US', | ||
description: 'Secure, modern and fast multi-process downloader', | ||
|
||
themeConfig: { | ||
nav: [{ text: 'Home', link: '/' }], | ||
|
||
sidebar: [], | ||
|
||
footer: { | ||
message: | ||
'Released under the <a href="https://github.com/noctisynth/Grassator/blob/main/LICENSE-MIT">MIT License</a> and <a href="https://github.com/noctisynth/Grassator/blob/main/LICENSE-AGPL">AGPLv3 License</a>.', | ||
copyright: | ||
'Copyright © 2011-present <a href="https://github.com/noctisynth">Noctisynth, Inc.</a>', | ||
}, | ||
}, | ||
}); |
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,35 @@ | ||
import { defineConfig } from 'vitepress'; | ||
import { search as zhSearch } from './zh'; | ||
|
||
export const shared = defineConfig({ | ||
title: 'Grassator', | ||
|
||
lastUpdated: true, | ||
cleanUrls: true, | ||
metaChunk: true, | ||
|
||
sitemap: { | ||
hostname: 'https://grassator.noctisynth.org', | ||
}, | ||
|
||
themeConfig: { | ||
logo: { | ||
dark: '/icon.png', | ||
light: '/light.ico', | ||
}, | ||
|
||
socialLinks: [ | ||
{ icon: 'github', link: 'https://github.com/noctisynth/Grassator' }, | ||
], | ||
|
||
search: { | ||
provider: 'algolia', | ||
options: { | ||
appId: '9RCKXREJL8', | ||
apiKey: 'fed8c71cf1f3731cd91d99fb8b5bc289', | ||
indexName: 'grassator', | ||
locales: { ...zhSearch }, | ||
}, | ||
}, | ||
}, | ||
}); |
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,90 @@ | ||
import { defineConfig, type DefaultTheme } from 'vitepress'; | ||
|
||
export const zh = defineConfig({ | ||
lang: 'zh-Hans', | ||
description: '由 Vite 和 Vue 驱动的静态站点生成器', | ||
|
||
themeConfig: { | ||
nav: [{ text: '主页', link: '/zh/' }], | ||
|
||
sidebar: [], | ||
|
||
editLink: { | ||
pattern: 'https://github.com/vuejs/vitepress/edit/main/docs/:path', | ||
text: '在 GitHub 上编辑此页面', | ||
}, | ||
|
||
footer: { | ||
message: '基于 MIT 及 AGPLv3 许可发布', | ||
copyright: `版权所有 © 2011-present <a href="https://github.com/noctisynth">夜莲组织</a>`, | ||
}, | ||
|
||
docFooter: { | ||
prev: '上一页', | ||
next: '下一页', | ||
}, | ||
|
||
outline: { | ||
label: '页面导航', | ||
}, | ||
|
||
lastUpdated: { | ||
text: '最后更新于', | ||
formatOptions: { | ||
dateStyle: 'short', | ||
timeStyle: 'medium', | ||
}, | ||
}, | ||
|
||
langMenuLabel: '多语言', | ||
returnToTopLabel: '回到顶部', | ||
sidebarMenuLabel: '菜单', | ||
darkModeSwitchLabel: '主题', | ||
lightModeSwitchTitle: '切换到浅色模式', | ||
darkModeSwitchTitle: '切换到深色模式', | ||
}, | ||
}); | ||
|
||
export const search: DefaultTheme.AlgoliaSearchOptions['locales'] = { | ||
zh: { | ||
placeholder: '搜索文档', | ||
translations: { | ||
button: { | ||
buttonText: '搜索文档', | ||
buttonAriaLabel: '搜索文档', | ||
}, | ||
modal: { | ||
searchBox: { | ||
resetButtonTitle: '清除查询条件', | ||
resetButtonAriaLabel: '清除查询条件', | ||
cancelButtonText: '取消', | ||
cancelButtonAriaLabel: '取消', | ||
}, | ||
startScreen: { | ||
recentSearchesTitle: '搜索历史', | ||
noRecentSearchesText: '没有搜索历史', | ||
saveRecentSearchButtonTitle: '保存至搜索历史', | ||
removeRecentSearchButtonTitle: '从搜索历史中移除', | ||
favoriteSearchesTitle: '收藏', | ||
removeFavoriteSearchButtonTitle: '从收藏中移除', | ||
}, | ||
errorScreen: { | ||
titleText: '无法获取结果', | ||
helpText: '你可能需要检查你的网络连接', | ||
}, | ||
footer: { | ||
selectText: '选择', | ||
navigateText: '切换', | ||
closeText: '关闭', | ||
searchByText: '搜索提供者', | ||
}, | ||
noResultsScreen: { | ||
noResultsText: '无法找到相关结果', | ||
suggestedQueryText: '你可以尝试查询', | ||
reportMissingResultsText: '你认为该查询应该有结果?', | ||
reportMissingResultsLinkText: '点击反馈', | ||
}, | ||
}, | ||
}, | ||
}, | ||
}; |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.