Skip to content

Commit

Permalink
文档文件结构整理 (#247)
Browse files Browse the repository at this point in the history
  • Loading branch information
jiazengp authored Apr 25, 2024
2 parents fe28368 + ba2ce8c commit eb66660
Show file tree
Hide file tree
Showing 239 changed files with 190 additions and 351 deletions.
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
54 changes: 27 additions & 27 deletions .github/trans-guide-no-exp-en.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,21 +24,21 @@ This site uses [Vitepress](https://vitepress.dev/), you can refer to their websi

2. [Download and install VSCode](https://code.visualstudio.com/), launch VSCode, and head to "Source Control"

![](/src/public/imgs/i18n-guide/2.png)
![](/.github/imgs/i18n-guide/2.png)

3. Click the button to [download and install Git](https://git-scm.com/download/win) from the webpage

![](/src/public/imgs/i18n-guide/3.png)
![](/.github/imgs/i18n-guide/3.png)

4. Return to VSCode, head to "Extensions" search for "Vite" and install

![](/src/public/imgs/i18n-guide/4.png)
![](/.github/imgs/i18n-guide/4.png)

5. Relaunch VSCode to load Git

6. Select "View” in the navigation menu and then select "Terminal"

![](/src/public/imgs/i18n-guide/25.png)
![](/.github/imgs/i18n-guide/25.png)

7. Enter the following command and hit enter to install pnpm

Expand All @@ -48,7 +48,7 @@ iwr https://get.pnpm.io/install.ps1 -useb | iex

8. Next, select the “+” menu in the terminal section, and then open "Git Bash"

![](/src/public/imgs/i18n-guide/26.png)
![](/.github/imgs/i18n-guide/26.png)

9. Enter the following commands into the terminal one at a time and hit enter, replace "username" and "youremail" with relevant information

Expand All @@ -58,47 +58,47 @@ git config --global user.name "username"
git config --global user.email "youremail"
```

![](/src/public/imgs/i18n-guide/27.png)
![](/.github/imgs/i18n-guide/27.png)

## Source Management Prep

0. Sign up for a GitHub account

1. Head to VSCode's Accounts menu, Select "Turn on Cloud Changes..." and log in

![](/src/public/imgs/i18n-guide/6.png)
![](/.github/imgs/i18n-guide/6.png)

2. Visit the [GitHub page of our site](https://github.com/kongying-tavern/docs), and create a new "fork"

![](/src/public/imgs/i18n-guide/1.png)
![](/.github/imgs/i18n-guide/1.png)

![](/src/public/imgs/i18n-guide/5.png)
![](/.github/imgs/i18n-guide/5.png)

3. In that new "fork", copy the link to your repository

![](/src/public/imgs/i18n-guide/7.png)
![](/.github/imgs/i18n-guide/7.png)

4. Return to VSCode, head to"Source Control" again, click "Clone Repository", and select "Clone from GitHub", VSCode will prompt you to allow login, simply allow

![](/src/public/imgs/i18n-guide/8.png)
![](/.github/imgs/i18n-guide/8.png)

5. Paste the link to your repository into the text box, hit Enter to confirm and clone the repository to a directory of your choice

![](/src/public/imgs/i18n-guide/9.png)
![](/.github/imgs/i18n-guide/9.png)

6. Open once the download is completed

![](/src/public/imgs/i18n-guide/10.png)
![](/.github/imgs/i18n-guide/10.png)

## Editing Prep

1. Once you open the cloned repository folder, the Vite extension will display a `pnpm install` prompt at the bottom right, click install, this is necessary for local preview

![](/src/public/imgs/i18n-guide/11.png)
![](/.github/imgs/i18n-guide/11.png)

2. Once the installation completes, the Vite extension will automatically start a local test server at `http://localhost:4000`, and open a build-in browser, you can also use your own browser by visiting the address there(you may encounter problems right after installation, relaunch to VSCode if error occurs)

![](/src/public/imgs/i18n-guide/12.png)
![](/.github/imgs/i18n-guide/12.png)

3. (Recommended)Head to the "Extensions" page again, search for "Markdown All in One" and install, this extension allows you to preview text styles (bold, italic, etc.) in the VSCode editor

Expand All @@ -112,13 +112,13 @@ The following content that requires translation is listed in the order they appe

- `\.vitepress\config\**.ts` Configuration of its respective language, affects all pages' format in that language

![](/src/public/imgs/i18n-guide/13.png)
![](/.github/imgs/i18n-guide/13.png)

- `\src\**\manual` All content requires translation, you need to configure each page's "frontmatter"(second picture below), which affects that specific page's format

![](/src/public/imgs/i18n-guide/14.png)
![](/.github/imgs/i18n-guide/14.png)

![](/src/public/imgs/i18n-guide/15.png)
![](/.github/imgs/i18n-guide/15.png)

- `src\**\community.md`
- `src\**\contribution.md`
Expand All @@ -133,38 +133,38 @@ It is recommended to use "Find and Replace" smartly, see the following example:

1. Right-click on the directory where Find and Replace is needed, select "Find in Folder..."

![](/src/public/imgs/i18n-guide/16.png)
![](/.github/imgs/i18n-guide/16.png)

2. Enter target keywords into their respective text box, select Replace to replace one by one, or Replace All as needed

![](/src/public/imgs/i18n-guide/17.png)
![](/.github/imgs/i18n-guide/17.png)

![](/src/public/imgs/i18n-guide/18.png)
![](/.github/imgs/i18n-guide/18.png)

## Submit and Sync Changes

### Submission

1. If you want to submit changes at a certain stage, head to Source Control to view all the changes

![](/src/public/imgs/i18n-guide/19.png)
![](/.github/imgs/i18n-guide/19.png)

2. After checking your changes, enter a commit message and commit your changes, you can view a "commit" as a record of changes. A format is required for the commit message for our website, you should open with feat:, chore:, fix:, etc. You can see commit message standards here:[commitlint](https://github.com/conventional-changelog/commitlint)

![](/src/public/imgs/i18n-guide/20.png)
![](/.github/imgs/i18n-guide/20.png)

3. There are three kinds of commits, using "commit" only will save the changes locally, "Commit & Push" will upload your commit to the online repository of your fork, "Commit & sync" will upload your local change and download from your online repository if they differ.

![](/src/public/imgs/i18n-guide/21.png)
![](/.github/imgs/i18n-guide/21.png)

### Sync

1. Once you have committed to your own fork, head to its GitHub page and initiate a Pull Request, this will begin the update process to the website

![](/src/public/imgs/i18n-guide/22.png)
![](/.github/imgs/i18n-guide/22.png)

2. If the website was updated, you can use "sync fork" to update your own fork, and click on "Sync" in VSCode to update the changes to your local repository

![](/src/public/imgs/i18n-guide/24.png)
![](/.github/imgs/i18n-guide/24.png)

![](/src/public/imgs/i18n-guide/23.png)
![](/.github/imgs/i18n-guide/23.png)
54 changes: 27 additions & 27 deletions .github/trans-guide-no-exp.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,21 +22,21 @@

2. [下载并安装 VSCode](https://code.visualstudio.com/),打开 VSCode,前往资源管理页(Source Control)

![](/src/public/imgs/i18n-guide/2.png)
![](/.github/imgs/i18n-guide/2.png)

3. 点击按钮前往弹出的网站[下载并安装 Git](https://git-scm.com/download/win),安装时一直点 next 就行

![](/src/public/imgs/i18n-guide/3.png)
![](/.github/imgs/i18n-guide/3.png)

4. 回到 VSCode,前往插件页(Extensions)并搜索“Vite”,点击安装(install)

![](/src/public/imgs/i18n-guide/4.png)
![](/.github/imgs/i18n-guide/4.png)

5. 重启 VSCode,此步骤用于装载 Git

6. 点击窗口上方菜单栏“View”,并选择“Terminal”

![](/src/public/imgs/i18n-guide/25.png)
![](/.github/imgs/i18n-guide/25.png)

7. 在命令行内输入以下指令以安装 pnpm

Expand All @@ -46,7 +46,7 @@ iwr https://get.pnpm.io/install.ps1 -useb | iex

8. 在底部打开的窗口中点击右上“+”菜单,并选择“Git Bash”

![](/src/public/imgs/i18n-guide/26.png)
![](/.github/imgs/i18n-guide/26.png)

9. 在命令行内分别输入以下指令,将昵称和邮件地址替换为你的信息,并回车

Expand All @@ -56,47 +56,47 @@ git config --global user.name "你的昵称"
git config --global user.email "邮件地址"
```

![](/src/public/imgs/i18n-guide/27.png)
![](/.github/imgs/i18n-guide/27.png)

## 资源管理准备

0. 注册一个 GitHub 账户

1. 前往 VSCode 账户菜单,选择“Turn on Cloud Changes...”,并登录

![](/src/public/imgs/i18n-guide/6.png)
![](/.github/imgs/i18n-guide/6.png)

2. 前往[文档的 GitHub 页面](https://github.com/kongying-tavern/docs),并新建一个分支(fork)

![](/src/public/imgs/i18n-guide/1.png)
![](/.github/imgs/i18n-guide/1.png)

![](/src/public/imgs/i18n-guide/5.png)
![](/.github/imgs/i18n-guide/5.png)

3. 在新建的分支内,复制源码的链接

![](/src/public/imgs/i18n-guide/7.png)
![](/.github/imgs/i18n-guide/7.png)

4. 回到 VSCode,再次前往资源管理页(Source Control),点击克隆仓库(Clone Repository),并选择从 GitHub 克隆(Clone from GitHub),VSCode 会提示登录,允许(Allow)即可

![](/src/public/imgs/i18n-guide/8.png)
![](/.github/imgs/i18n-guide/8.png)

5. 登陆后在解锁的对话框内粘贴刚才复制的源码链接,回车确认并在弹窗中自行选择源码的本地储存地点

![](/src/public/imgs/i18n-guide/9.png)
![](/.github/imgs/i18n-guide/9.png)

6. 下载完后打开即可

![](/src/public/imgs/i18n-guide/10.png)
![](/.github/imgs/i18n-guide/10.png)

## 编辑准备

1. 打开源码目录以后,Vite 插件会在右下角弹出 pnpm install 提示,点击以安装,这是本地预览所需的必要组件

![](/src/public/imgs/i18n-guide/11.png)
![](/.github/imgs/i18n-guide/11.png)

2. 安装完成后,Vite 插件会自动启动本地测试服务器于`http://localhost:4000`,并打开一个内置的浏览器,你也可以用自己的浏览器查看预览(注:安装完成后第一次启动可能会有”spawn git ENOENT“错误,重启 VSCode 即可)

![](/src/public/imgs/i18n-guide/12.png)
![](/.github/imgs/i18n-guide/12.png)

3. (推荐)再次前往插件页(Extensions),搜索”Markdown All in One"并安装,这个插件让你可以在 VSCode 编辑器里预览文字格式(加粗,倾斜)

Expand All @@ -112,13 +112,13 @@ git config --global user.email "邮件地址"

- `\.vitepress\config\**.ts` 对应语言的配置,影响所有页面统一的格式

![](/src/public/imgs/i18n-guide/13.png)
![](/.github/imgs/i18n-guide/13.png)

- `\src\**\manual` 内的所有内容,文档中有如下图注释(图一),同时注意每一页的 fontmatter(图二),这些内容影响当前页的配置

![](/src/public/imgs/i18n-guide/14.png)
![](/.github/imgs/i18n-guide/14.png)

![](/src/public/imgs/i18n-guide/15.png)
![](/.github/imgs/i18n-guide/15.png)

- `src\**\community.md` 加入社区
- `src\**\contribution.md` 贡献鸣谢
Expand All @@ -133,38 +133,38 @@ git config --global user.email "邮件地址"

1. 右键需要批量翻译关键词所在的目录,选择“Find in Folder...”

![](/src/public/imgs/i18n-guide/16.png)
![](/.github/imgs/i18n-guide/16.png)

2. 在对应的对话框中放入目标内容,点击替换全部(Replace All)即可

![](/src/public/imgs/i18n-guide/17.png)
![](/.github/imgs/i18n-guide/17.png)

![](/src/public/imgs/i18n-guide/18.png)
![](/.github/imgs/i18n-guide/18.png)

## 上传与同步改动

### 上传

1. 完成一次阶段性改动后,若想上传,前往资源管理页(Source Control),即可查看你所做出的所有改动

![](/src/public/imgs/i18n-guide/19.png)
![](/.github/imgs/i18n-guide/19.png)

2. 检查完毕即可输入 commit message 并推送至你自己的分支,可以将 commit 看成为阶段性改动的记录。Commit message 开头格式可以用:“docs:”-加入新页面、“chore:”-更改页面配置(例如上文所做的替换)、“fix:”-修改语法错误,或者链接错误。更多格式见:[commitlint](https://github.com/conventional-changelog/commitlint)

![](/src/public/imgs/i18n-guide/20.png)
![](/.github/imgs/i18n-guide/20.png)

3. Commit 有三种选择,直接 commit 将把这次改动储存在本地,“Commit & Push”会把改动 commit 并推送至你的分支,“Commit & sync”会将改动推送并下载你的分支在云端的改动。

![](/src/public/imgs/i18n-guide/21.png)
![](/.github/imgs/i18n-guide/21.png)

### 同步

1. Commit 至你的分支以后,前往分支的 GitHub 页,并发起“Pull Request”就可以开始对网站内容(主分支)的更新流程

![](/src/public/imgs/i18n-guide/22.png)
![](/.github/imgs/i18n-guide/22.png)

2. 如果主分支有新的改动,你可以先在“sync fork”处同步,然后在 VSCode 中点击同步(Sync)将其同步至本地即可(图二)

![](/src/public/imgs/i18n-guide/24.png)
![](/.github/imgs/i18n-guide/24.png)

![](/src/public/imgs/i18n-guide/23.png)
![](/.github/imgs/i18n-guide/23.png)
11 changes: 7 additions & 4 deletions .vitepress/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,9 @@ export default defineConfig({
},
},
},
rewrites: {
'zh/:splat(.*)': ':splat',
},
locales: {
root: {
label: '简体中文',
Expand Down Expand Up @@ -186,7 +189,7 @@ export default defineConfig({
'link',
{
rel: 'icon',
href: `https://yuanshen.site/docs/imgs/favicon-32x32.png`,
href: `https://yuanshen.site/docs/imgs/common/favicon/favicon-32x32.png`,
type: 'image/png',
},
],
Expand Down Expand Up @@ -242,7 +245,7 @@ export default defineConfig({
'link',
{
rel: 'alternate',
href: `https://yuanshen.site/docs/imgs/favicon.ico`,
href: `https://yuanshen.site/docs/imgs/common/favicon/favicon.ico`,
type: 'image/x-icon',
},
],
Expand Down Expand Up @@ -374,7 +377,7 @@ A Completionist's Interactive Map by Kongying Tavern`,
name: 'og:image',
content: pageData.frontmatter.image
? pageData.frontmatter.image
: 'https://yuanshen.site/docs/cover.jpg',
: 'https://yuanshen.site/docs/imgs/common/cover.jpg',
},
])
pageData.frontmatter.head.push([
Expand All @@ -383,7 +386,7 @@ A Completionist's Interactive Map by Kongying Tavern`,
name: 'twitter:image',
content: pageData.frontmatter.image
? pageData.frontmatter.image
: 'https://yuanshen.site/docs/cover.jpg',
: 'https://yuanshen.site/docs/imgs/common/cover.jpg',
},
])
},
Expand Down
6 changes: 2 additions & 4 deletions .vitepress/locales/en.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
import fs from 'fs'
import path from 'path'
import { baseHelper } from '../theme/utils'
import { socialList } from '../theme/composables/socialList'

Expand All @@ -12,7 +10,7 @@ export const META_KEYWORDS =
'Genshin Interactive Map, Genshin Map, Kongying Tavern, yuanshenmap, Genshin Impact Map, Kongying Map'
export const META_DESCRIPTION =
'A Genshin interactive map by Kongying Tavern for completionists'
export const META_IMAGE = 'https://yuanshen.site/docs/imgs/cover.jpg'
export const META_IMAGE = 'https://yuanshen.site/docs/imgs/common/cover.jpg'
export const LOCAL_CODE = 'en-US'
export const LOCAL_BASE = 'en'

Expand All @@ -27,7 +25,7 @@ export const enConfig: LocaleSpecificConfig<
siteTitle: 'Genshin Interactive Map',
outlineTitle: 'On This Page',
lastUpdatedText: 'Update Date',
logo: '/imgs/logo_256.png',
logo: '/imgs/common/logo/logo_256.png',
ui: {
button: {
submit: 'Submit',
Expand Down
Loading

0 comments on commit eb66660

Please sign in to comment.