Merge pull request 'fix errors in webdoc' (#30) from caodg/xuos-web:develop into master

This commit is contained in:
caodg 2021-05-01 12:22:30 +08:00
commit 02566a1259
3 changed files with 33 additions and 56 deletions

2
.gitignore vendored
View File

@ -10,3 +10,5 @@ dist
.basement .basement
config.local.js config.local.js
basement_dist basement_dist
*.swp
*.lock

Binary file not shown.

View File

@ -1,24 +1,24 @@
# 为XiUOS 完善网站文档 # 为XiUOS 完善网站文档
## 准备阶段 ## 准备阶段
首先从XiUOS主库中复刻一份到自己的个人空间。 首先从XiUOS文档主库中复刻一份到自己的个人空间。
假定您在Trustie的用户名为“panda” 假定您在Trustie的用户名为“panda”
### 步骤1复刻 ### 步骤1复刻
再在浏览器中打开XiUOS的项目首页[https://forgeplus.trustie.net/projects/xuos/xuos-web](https://forgeplus.trustie.net/projects/xuos/xuos-web), 点击右上角的"复刻" 按钮 再在浏览器中打开XiUOS的文档项目首页[https://forgeplus.trustie.net/projects/xuos/xuos-web](https://forgeplus.trustie.net/projects/xuos/xuos-web), 点击右上角的"复刻" 按钮
这样您就在自己的个人空间中有了XiUOS的一个复刻代码库, 地址为 这样您就在自己的个人空间中有了XiUOS文档库的一个复刻代码库, 地址为
项目首页为 "https://forgeplus.trustie.net/projects/panda/xiuos" 项目首页为 "https://forgeplus.trustie.net/projects/panda/xuos-web"
代码库地址为 "https://git.trustie.net/panda/xiuos.git" 代码库地址为 "https://git.trustie.net/panda/xuos-web.git"
### 步骤2 : 下载到本地,并配置 ### 步骤2 : 下载到本地,并配置
* 从个人空间下载 * 从个人空间下载
``` ```
git clone https://git.trustie.net/panda/xiuos.git git clone https://git.trustie.net/panda/xuos-web.git
``` ```
::: warning 警告 ::: warning 警告
@ -29,7 +29,7 @@ git clone https://git.trustie.net/panda/xiuos.git
``` ```
# 设置 upstream # 设置 upstream
git remote add upstream https://git.trustie.net/xuos/xiuos.git git remote add upstream https://git.trustie.net/xuos/xuos-web.git
# 禁止直接向 upstream 推送代码 # 禁止直接向 upstream 推送代码
git remote set-url --push upstream no_push git remote set-url --push upstream no_push
``` ```
@ -76,57 +76,38 @@ yarn global add vuepress
yarn add -D vuepress yarn add -D vuepress
``` ```
### 步骤5 : 下载网站源码 每当做了改动,可以运行
```bash
git clone https://git.trustie.net/xuos/xuos-web.git
```
如果没有全局vuepress, 需要安装
```bash
cd xuos-web
yarn add -D vuepress
```
## 修改测试
### 步骤6 : 修改测试
修改你想要修改的内容,修改完之后启动测试
```bash ```bash
yarn dev yarn dev
``` ```
会在终端启动 web server, 浏览器中访问 http://localhost:8080, 可观察网站效果 yarn会编译文档, 并启动内置的web server. 在浏览器中访问 http://localhost:8080, 可观察网站效果
运行 运行
```bash ```bash
yarn build yarn build
``` ```
可在 docs/.vuepress/dist 中生成编译后的html页面 可在 docs/.vuepress/dist 中生成编译后的html页面, 可以单独启动一个web server观察效果
```bash
## 上传阶段 python -m http.server
### 步骤7 : fetch
**upstream(xuos/xiuos)** fetch 代码到本地
```
git fetch upstream
``` ```
### 步骤8 : branch
## 工作阶段
### 步骤5 : 创建工作分支
为本次工作创建一个分支,命名为 `develop` 为本次工作创建一个分支,命名为 `develop`
``` ```
git checkout -b develop upstream/master git checkout -b develop
``` ```
### 步骤9 : work, commit & commit ### 步骤6 : work, commit & commit
此时就可以在该分支下工作了, 不断修改代码,不断 commit 此时就可以在该分支下工作了, 不断修改代码,不断 commit
@ -136,36 +117,29 @@ git add .
git commit -m "your commit message" git commit -m "your commit message"
``` ```
### 步骤10 : push & push ### 步骤7 : push & push
如果经过测试,您觉得在本地完成了代码工作,您就可以将代码推送到您自己的服务器端的仓库中了。 如果经过测试,您觉得在本地完成了代码工作,您就可以将代码推送到您自己的服务器端的仓库中了。
``` ```
git push origin develop git push origin develop
``` ```
push到自己的服务器端库中后就可以准备创建`合并请求(Pull Request)`了。 push到自己的服务器端库中后就可以考虑创建`合并请求(Pull Request)`了, 为
此需要将本地库和upstream同步。
### 步骤11 : fetch ### 步骤8 : 和upstream 同步
从XiUOS的主库, 即 upstream 中, fetch 最新的代码
``` ```
git fetch upstream git fetch upstream
```
### 步骤12 : merge
将upstream 上最新的代码合并到你的当前工作分支
```
git merge upstream/master git merge upstream/master
``` ```
此时请确保本地您位于工作分支。如果合并过程有冲突,您要负责解决冲突,并提交。 请确保本地您位于工作分支。如果合并过程有冲突,您要负责解决冲突,并提交。
### 步骤13 : push
将消解了冲突的最新本地代码推送到个人服务器端仓库的develop分支。 然后将消解了冲突的最新本地代码推送到个人服务器端仓库的develop分支。
``` ```
git push origin develop git push origin develop
@ -173,9 +147,9 @@ git push origin develop
## 合并阶段 ## 合并阶段
### 步骤14 : 合并请求(pull request) ### 步骤9 : 合并请求(pull request)
到自己个人服务器端仓库的首页 https://forgeplus.trustie.net/projects/panda/xiuos, 点击 **合并请求** , 到自己个人服务器端仓库的首页 https://forgeplus.trustie.net/projects/panda/xuos-web, 点击 **合并请求** ,
设置源分支: 设置源分支:
@ -183,7 +157,7 @@ git push origin develop
设置目标分支: 设置目标分支:
目标仓库选择 upstream 库, 即: "泛在操作系统实验室/xiuos" 目标仓库选择 upstream 库, 即: "泛在操作系统实验室/xuos-web"
目标分支选择 `master` 目标分支选择 `master`
@ -256,8 +230,9 @@ mkdir imagesrc
``` ```
将图片img.png放入文件夹imagesrc中 将图片img.png放入文件夹imagesrc中
在riscv.md中需要用到该图片的位置添加 在riscv.md中需要用到该图片的位置添加
```
./imagesrc/img.png ```md
![Image description](./imagesrc/img.png)
``` ```
图片添加完成。 图片添加完成。