Skip to content

Commit

Permalink
feat(*): 更新 vuepress 版本
Browse files Browse the repository at this point in the history
1. 更新 vuepress 版本
2. 切换 yarn 到 pnpm
3. 国际化功能
  • Loading branch information
MoonBegonia authored and oevery committed Mar 16, 2022
1 parent d7d18a8 commit 19a27c1
Show file tree
Hide file tree
Showing 35 changed files with 2,886 additions and 8,159 deletions.
7 changes: 5 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@

# Created by https://www.gitignore.io/api/node,linux,macos,windows,visualstudiocode
# Edit at https://www.gitignore.io/?templates=node,linux,macos,windows,visualstudiocode

Expand Down Expand Up @@ -188,4 +187,8 @@ $RECYCLE.BIN/
# Windows shortcuts
*.lnk

# End of https://www.gitignore.io/api/node,linux,macos,windows,visualstudiocode
# End of https://www.gitignore.io/api/node,linux,macos,windows,visualstudiocode

.vuepress/.temp/
.vuepress/.cache/
.vuepress/dist/
1 change: 1 addition & 0 deletions .npmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
shamefully-hoist=true
10 changes: 2 additions & 8 deletions .vuepress/config.js → .vuepress/config.back.js
Original file line number Diff line number Diff line change
Expand Up @@ -41,10 +41,7 @@ module.exports = {
{
title: 'User Guide',
path: '/guide/',
children: [
'/guide/',
'/guide/magisk',
],
children: ['/guide/', '/guide/magisk'],
},
{
title: 'FAQ',
Expand All @@ -66,10 +63,7 @@ module.exports = {
{
title: 'Join Us',
path: '/joinus/',
children: [
'/joinus/',
'/joinus/docs',
],
children: ['/joinus/', '/joinus/docs'],
},
],
lastUpdated: 'Latest Update',
Expand Down
83 changes: 83 additions & 0 deletions .vuepress/config.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,83 @@
import type { DefaultThemeOptions } from 'vuepress';
import { defineUserConfig } from 'vuepress';
import { navbar, sidebar } from './configs';

export default defineUserConfig<DefaultThemeOptions>({
// 站点配置
lang: 'zh-CN',
title: 'Distributed Update System',
description: 'Upgrade anything any where',
head: [['link', { rel: 'icon', href: '/logo.png' }]],

// 语言配置
locales: {
'/': {
lang: 'zh-CN',
title: 'Distributed Update System',
description: 'Upgrade anything any where',
},
'/en/': {
lang: 'en-US',
title: 'Distributed Update System',
description: 'Upgrade anything any where',
},
},

// 主题配置
theme: '@vuepress/theme-default',
themeConfig: {
logo: '/logo.png',
repo: 'DUpdateSystem',
locales: {
'/': {
// navbar
navbar: navbar.zh,
selectLanguageName: '简体中文',
selectLanguageText: '选择语言',
selectLanguageAriaLabel: '选择语言',

// sidebar
sidebar: sidebar.zh,

// page meta
editLinkText: '在 GitHub 上编辑此页',
lastUpdatedText: '上次更新',
contributorsText: '贡献者',

// custom containers
tip: '提示',
warning: '注意',
danger: '警告',

// 404 page
notFound: [
'这里什么都没有',
'我们怎么到这来了?',
'这是一个 404 页面',
'看起来我们进入了错误的链接',
],
backToHome: '返回首页',

// a11y
openInNewWindow: '在新窗口打开',
toggleDarkMode: '切换夜间模式',
toggleSidebar: '切换侧边栏',
},

'/en/': {
// navbar
navbar: navbar.en,
selectLanguageName: 'English',

// sidebar
sidebar: sidebar.en,

// page meta
editLinkText: 'Edit this page on GitHub',
},
},

docsRepo: 'DUpdateSystem/docs',
docsBranch: 'master',
},
});
2 changes: 2 additions & 0 deletions .vuepress/configs/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
export * as navbar from './navbar';
export * as sidebar from './sidebar';
25 changes: 25 additions & 0 deletions .vuepress/configs/navbar/en.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
import type { NavbarConfig } from '@vuepress/theme-default';

export const en: NavbarConfig = [
{ text: 'User Guide', link: '/en/guide/' },
{ text: 'FAQ', link: '/en/faq/' },
{ text: 'Developer Documentation', link: '/en/dev/' },
{ text: 'Discussion', link: '/en/discussion/' },
{
text: 'Client Downloads',
children: [
{
text: 'Github',
link: '/~https://github.com/DUpdateSystem/UpgradeAll/releases',
},
{
text: 'F-Droid',
link: 'https://f-droid.org/packages/net.xzos.upgradeall',
},
{
text: 'Telegram CI',
link: 'https://t.me/upallci',
},
],
},
];
2 changes: 2 additions & 0 deletions .vuepress/configs/navbar/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
export * from './en';
export * from './zh';
29 changes: 29 additions & 0 deletions .vuepress/configs/navbar/zh.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
import type { NavbarConfig } from '@vuepress/theme-default';

export const zh: NavbarConfig = [
{ text: '用户指南', link: '/guide/' },
{ text: '常见问题', link: '/faq/' },
{ text: '开发者文档', link: '/dev/' },
{ text: '参与讨论', link: '/discussion/' },
{
text: '客户端下载',
children: [
{
text: '酷安',
link: 'https://www.coolapk.com/apk/net.xzos.upgradeall',
},
{
text: 'Github',
link: '/~https://github.com/DUpdateSystem/UpgradeAll/releases',
},
{
text: 'F-Droid',
link: 'https://f-droid.org/packages/net.xzos.upgradeall',
},
{
text: 'Telegram CI',
link: 'https://t.me/upallci',
},
],
},
];
22 changes: 22 additions & 0 deletions .vuepress/configs/sidebar/en.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
import type { SidebarConfig } from '@vuepress/theme-default';

export const en: SidebarConfig = [
'/en/guide/README.md',
'/en/faq/README.md',
{
text: 'Developer Documention',
link: '/en/dev/',
collapsible: true,
children: [
'/en/dev/README.md',
'/en/dev/contributing.md',
'/en/dev/file-dir-structure.md',
'/en/dev/app-json-rules.md',
'/en/dev/hub-json-rules.md',
'/en/dev/python-scripts.md',
'/en/dev/bs4-function.md',
'/en/dev/docs.md',
],
},
'/en/discussion/README.md',
];
2 changes: 2 additions & 0 deletions .vuepress/configs/sidebar/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
export * from './en';
export * from './zh';
22 changes: 22 additions & 0 deletions .vuepress/configs/sidebar/zh.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
import type { SidebarConfig } from '@vuepress/theme-default';

export const zh: SidebarConfig = [
'/guide/README.md',
'/faq/README.md',
{
text: 'Developer Documention',
link: '/dev/',
collapsible: true,
children: [
'/dev/README.md',
'/dev/contributing.md',
'/dev/file-dir-structure.md',
'/dev/app-json-rules.md',
'/dev/hub-json-rules.md',
'/dev/python-scripts.md',
'/dev/bs4-function.md',
'/dev/docs.md',
],
},
'/discussion/README.md',
];
9 changes: 6 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,11 @@
---
home: true
heroImage: /logo.png
actionText: 快速上手 →
actionLink: /guide/
features:
actions:
- text: '用户指南'
link: /guide/
- text: 'English'
link: /en/
type: secondary
footer: GPL-3.0 Licensed | Copyright © 2019-present DUpdateSystem
---
2 changes: 1 addition & 1 deletion dev/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@

无论你选择何种方式提交,我们都将及时处理

::: tip 提示
::: tip
无论你选择何种方法提交,为了便于我们快速地处理,请遵循[贡献准则](./contributing)
:::

Expand Down
32 changes: 16 additions & 16 deletions joinus/docs.md → dev/docs.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# 文档编写

::: tip 提示
::: tip
请先了解[贡献准则](./contributing.html),若已查看请忽略。
:::

Expand Down Expand Up @@ -30,7 +30,7 @@

## 配置文件部分说明

::: tip 提示
::: tip
修改配置后重新运行 `yarn dev` 才会生效。
:::

Expand All @@ -52,18 +52,18 @@ module.exports = {
items: [
{
text: 'Android 端(酷安)',
link: 'https://www.coolapk.com/apk/net.xzos.upgradeall'
link: 'https://www.coolapk.com/apk/net.xzos.upgradeall',
},
{
text: 'Android 端(GitHub)',
link: '/~https://github.com/DUpdateSystem/UpgradeAll/releases'
}
]
link: '/~https://github.com/DUpdateSystem/UpgradeAll/releases',
},
],
},
{ text: 'GitHub', link: '/~https://github.com/DUpdateSystem' }
]
}
}
{ text: 'GitHub', link: '/~https://github.com/DUpdateSystem' },
],
},
};
```

### themeConfig.sidebar
Expand All @@ -77,14 +77,14 @@ module.exports = {
sidebar: [
{
title: 'FAQ',
path: '/faq/'
path: '/faq/',
},
{
title: '参与我们',
path: '/joinus/',
children: ['/joinus/', '/joinus/docs']
}
]
}
}
children: ['/joinus/', '/joinus/docs'],
},
],
},
};
```
4 changes: 2 additions & 2 deletions dev/hub-json-rules.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# 软件源配置编写

::: tip 提示
::: tip
请先了解[贡献准则](./contributing.html),若已查看请忽略。
:::

Expand All @@ -27,7 +27,7 @@
该值标记该配置文件遵守的软件源配置格式标准。
过时的版本号(过低的值)可能导致软件无法读取解析当前配置文件。

::: tip 提示
::: tip
每次 UpgradeAll 项目进行的自定义源配置的格式变更会使最新版本号+1。
有时不同版本并不是兼容的,若软件检测到不兼容的版本号,软件源脚本将不会运行,因此你必须保证你填写了正确的版本号。
:::
Expand Down
Loading

0 comments on commit 19a27c1

Please sign in to comment.