Skip to content

Commit

Permalink
refactor: 修改中文为主要语言,修改配置文件为TypeScript
Browse files Browse the repository at this point in the history
  • Loading branch information
AyalaKaguya committed Dec 5, 2023
1 parent f038500 commit cf2eb5c
Show file tree
Hide file tree
Showing 23 changed files with 718 additions and 570 deletions.
8 changes: 7 additions & 1 deletion .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
{
"vue3snippets.enable-compile-vue-file-on-did-save-code": false
"vue3snippets.enable-compile-vue-file-on-did-save-code": false,
"html.customData": [
"./node_modules/mdui/html-data.zh-cn.json"
],
"css.customData": [
"./node_modules/mdui/css-data.zh-cn.json"
]
}
10 changes: 6 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,13 +17,15 @@
},
"homepage": "https://github.com/easybangumiorg/.github#readme",
"devDependencies": {
"@vuepress/plugin-google-analytics": "^2.0.0-beta.68",
"@vuepress/plugin-register-components": "^2.0.0-beta.68",
"@vuepress/plugin-search": "^2.0.0-beta.68",
"vuepress": "^2.0.0-beta.68"
"@vuepress/bundler-vite": "^2.0.0-rc.0",
"@vuepress/plugin-google-analytics": "^2.0.0-rc.0",
"@vuepress/plugin-register-components": "^2.0.0-rc.0",
"@vuepress/plugin-search": "^2.0.0-rc.0",
"vuepress": "^2.0.0-rc.0"
},
"dependencies": {
"marked": "^4.3.0",
"mdui": "^2.0.3",
"moment": "^2.29.4",
"vuex": "^4.0.2"
}
Expand Down
3 changes: 1 addition & 2 deletions src/.vuepress/client.js → src/.vuepress/client.ts
Original file line number Diff line number Diff line change
@@ -1,14 +1,13 @@
import { defineClientConfig } from '@vuepress/client'
import store from './store'
import webappLayout from './layouts/webapp.vue'

export default defineClientConfig({
enhance({ app, router, siteData }) {
app.use(store)
},
setup() { },
layouts: {
webapp: webappLayout

},
rootComponents: [],
})
71 changes: 43 additions & 28 deletions src/.vuepress/config.js → src/.vuepress/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,9 @@ import { registerComponentsPlugin } from '@vuepress/plugin-register-components'
import { googleAnalyticsPlugin } from '@vuepress/plugin-google-analytics'
import { getDirname, path } from '@vuepress/utils'
import { searchPlugin } from '@vuepress/plugin-search'

import { viteBundler } from '@vuepress/bundler-vite'
import { mduiTheme } from './theme'

const __dirname = getDirname(import.meta.url)

export default defineUserConfig({
Expand All @@ -12,6 +14,19 @@ export default defineUserConfig({
temp: "./.temp",
cache: "./.temp/cache",

// 打包设置
bundler: viteBundler({
viteOptions: {},
vuePluginOptions: {
template: {
compilerOptions: {
// 所有以 mdui- 开头的标签名都是 mdui 组件
isCustomElement: (tag) => tag.startsWith('mdui-')
}
}
},
}),

// 头部设置
head: [
["link", { rel: "icon", href: "/favicon.ico" }],
Expand All @@ -21,100 +36,100 @@ export default defineUserConfig({
],

// 主题配置
theme: defaultTheme({
theme: mduiTheme({
// 基本配置
logo: "/icons/logo.ico",
repo: "easybangumiorg/easybangumi",
// 协同编辑
editLinks: true,
docsRepo: "easybangumiorg/website",
docsBranch: 'main',
docsDir: "src",
editLink: true,
// 上次编辑
lastUpdated: true,
// 合作者
contributors: false,
contributors: true,
// 侧边栏
sidebar: 'auto',

// 主题多语言设置
locales: {
'/': { // 英语设置
'/en/': { // 英语设置
selectLanguageName: 'English',
editLinkText: "Help us improve this page",
lastUpdatedText: "Last updated",
contributorsText: "Contributors",

navbar: [
{ text: "Home", link: "/" },
{ text: "Home", link: "/en/" },
{
text: "Download",
children: [
{ text: "EasyBangumi", link: "/download/" },
{ text: "Extensions", link: "/extensions/" },
{ text: "EasyBangumi", link: "/en/download/" },
{ text: "Extensions", link: "/en/extensions/" },
]
},
],
},
'/zh/': { // 简体中文设置
'/': { // 简体中文设置
selectLanguageName: '简体中文',
editLinkText: "帮助我们改善此页",
lastUpdatedText: "上次更新",
contributorsText: "贡献者",

navbar: [ // 顶部导航栏
{ text: "主页", link: "/zh/" },
{ text: "主页", link: "/" },
{
text: "下载",
children: [
{ text: "本体", link: "/zh/download/" },
{ text: "扩展", link: "/zh/extensions/" },
{ text: "本体", link: "/download/" },
{ text: "扩展", link: "/extensions/" },
]
},
{
text: "帮助",
children: [
{
text: "常见问题",
link: "/zh/guide/faq/",
link: "/guide/faq/",
},
{
text: "用户指南",
children: [
'/zh/guide/user-manual/getting-started.md'
'/guide/user-manual/getting-started.md'
],
},
{
text: "开发",
children: [
'/zh/guide/contribution/noumenon.md',
'/zh/guide/contribution/extension-example.md',
'/zh/guide/contribution/extension-utils.md'
'/guide/contribution/noumenon.md',
'/guide/contribution/extension-example.md',
'/guide/contribution/extension-utils.md'
],
},
]
},
],

sidebar: { // 个别页面的侧边栏
'/zh/guide/': [
'/guide/': [
{
text: '常见问题',
collapsible: true,
link: '/zh/guide/faq/',
link: '/guide/faq/',
}, {
text: '用户指南',
collapsible: true,
children: [
'/zh/guide/user-manual/getting-started.md',
'/guide/user-manual/getting-started.md',
],
}, {
text: '开发',
collapsible: true,
children: [
'/zh/guide/contribution/noumenon.md',
'/zh/guide/contribution/extension-example.md',
'/zh/guide/contribution/extension-utils.md'
'/guide/contribution/noumenon.md',
'/guide/contribution/extension-example.md',
'/guide/contribution/extension-utils.md'
],
},
],
Expand Down Expand Up @@ -142,12 +157,12 @@ export default defineUserConfig({

// 网站多语言支持
locales: {
'/': {
'/en/': {
lang: 'en-US',
title: 'EasyBangumi',
description: 'Free and open source bangumi(animation) player for Android',
description: 'Free and open source animation player for Android',
},
'/zh/': {
'/': {
lang: 'zh-CN',
title: '纯纯看番',
description: '免费且开源的安卓动漫播放器',
Expand All @@ -164,10 +179,10 @@ export default defineUserConfig({
}),
searchPlugin({
locales: {
'/': {
'/en/': {
placeholder: 'Search',
},
'/zh/': {
'/': {
placeholder: '搜索',
},
},
Expand Down
23 changes: 0 additions & 23 deletions src/.vuepress/layouts/webapp.vue

This file was deleted.

12 changes: 0 additions & 12 deletions src/.vuepress/theme/index.js

This file was deleted.

15 changes: 15 additions & 0 deletions src/.vuepress/theme/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
import type { Theme } from '@vuepress/core'
import { defaultTheme, type DefaultThemeOptions } from '@vuepress/theme-default'
import { getDirname, path } from '@vuepress/utils'

const __dirname = getDirname(import.meta.url)

export const mduiTheme = (options: DefaultThemeOptions): Theme => {
return {
name: 'vuepress-theme-easybangumi',
extends: defaultTheme(options),
alias: {

},
}
}
24 changes: 12 additions & 12 deletions src/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,23 +2,23 @@
home: true
meta:
- name: keywords
content: 纯纯看番, EasyBangumi, Official, Android app
lang: en-US
content: 纯纯看番, EasyBangumi, Animation, Android app
lang: zh_CN
heroImage: /icons/FAVICON-RAW.png
heroHeight: 140
actions:
- text: Download
link: /download/
- text: 下载纯纯看番
link: /zh/download/
type: primary
- text: Extensions
link: /extensions/
- text: 扩展列表
link: /zh/extensions/
type: secondary
features:
- title: Extensions
details: We only have two extensions at the moment, but you can expect them.
- title: Tracking
details: Every time you start EasyBangumi, you will automatically get updates from various sources.
- title: Customization
details: EasyBangumi has a variety of themes to choose from, and will automatically switch the dark mode according to the system.
- title: 插件化
details: 比较系统的插件化框架,通过安装插件来获取更多的源。
- title: 追番
details: 每次打开纯纯看番,你都可以接收到来自多个番剧源的番剧更新提示。
- title: 自定义
details: 纯纯看番具有相当多的主题选项,也可以跟随系统自动设置暗黑模式。
footer: Apache-2.0 Licensed | Copyright © 2022-present EasyBangumi.org
---
24 changes: 14 additions & 10 deletions src/download/README.md
Original file line number Diff line number Diff line change
@@ -1,31 +1,35 @@
---
title: Download
description: Download links for the latest versions of EasyBangumi.
title: 下载
description: 纯纯看番最新版的下载列表。
meta:
- name: keywords
content: 纯纯看番, Download, Official, Android app
lang: en-US
lang: zh_CN
sidebar: false
---

# Download
# 下载

::: tip
tips: [stars](https://github.com/easybangumiorg/EasyBangumi) can encourage developer to speed up the development of more new features.
[stars](https://github.com/easybangumiorg/EasyBangumi) 可以帮助开发者加快新功能的开发。
:::

hope you enjoy this app.
希望您能够享受这个app。

## From Github
## Github 上下载

Download the latest stable version of **EasyBangumi** that released <ReleaseDate stable /> or the preview version that released <ReleaseDate nightly />.
纯纯看番分为正式版和nightly版,一般情况下nightly版本比正式版更新一些,但也包含许多的不稳定性(比如bug)。在开发进度缓慢的时候,可能会出现正式版比nightly版更新的情况。

<DownloadButtons/>

<WhatsNew/>

## From App Center
## App Center 下载

You can also download EasyBangumi and get updates at:
你也可以从App Center下载或者更新纯纯看番:

[https://install.appcenter.ms/users/heyanle/apps/easybangumi/distribution_groups/easybangumi](https://install.appcenter.ms/users/heyanle/apps/easybangumi/distribution_groups/easybangumi)

## 从 QQ频道 获取

如果你在国内无法访问以上两个下载源,你也可以加入我们的 [QQ频道](https://pd.qq.com/s/4q8rd0285) 来获取纯纯看番的更新,但是在QQ频道的更新往往不是最快的。
24 changes: 24 additions & 0 deletions src/en/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
---
home: true
meta:
- name: keywords
content: 纯纯看番, EasyBangumi, Official, Android app
lang: en-US
heroImage: /icons/FAVICON-RAW.png
heroHeight: 140
actions:
- text: Download →
link: /download/
type: primary
- text: Extensions
link: /extensions/
type: secondary
features:
- title: Extensions
details: We only have two extensions at the moment, but you can expect them.
- title: Tracking
details: Every time you start EasyBangumi, you will automatically get updates from various sources.
- title: Customization
details: EasyBangumi has a variety of themes to choose from, and will automatically switch the dark mode according to the system.
footer: Apache-2.0 Licensed | Copyright © 2022-present EasyBangumi.org
---
Loading

0 comments on commit cf2eb5c

Please sign in to comment.