Skip to content

Commit 85b4be7

Browse files
committed
docs: add reactpress doc
1 parent 002972b commit 85b4be7

21 files changed

+594
-455
lines changed
Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
---
22
sidebar_position: 1
3-
id: ReactPress
4-
sidebar_label: 什么是ReactPress ?
3+
id: intro
4+
title: 介绍
55
---
66

77
## 项目简介
@@ -93,7 +93,6 @@ $ pnpm run dev
9393

9494
如果您在使用的过程中碰到问题,可以通过下面几个途径寻求帮助,同时我们也鼓励资深用户通过下面的途径给新人提供帮助。
9595

96-
9796
通过 WeChat 联系,可通过搜素微信号 `red_tea_v2` 或扫码加入 ,并备注来源。
9897

9998
通过 GitHub Discussions 提问时,建议使用 `Q&A` 标签。

docs/docs/tutorial-basics/_category_.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,6 @@
33
"position": 2,
44
"link": {
55
"type": "generated-index",
6-
"description": "5 minutes to learn the most important Docusaurus concepts."
6+
"description": "ReactPress基础教程"
77
}
88
}

docs/docs/tutorial-basics/congratulations.md

Lines changed: 0 additions & 23 deletions
This file was deleted.

docs/docs/tutorial-basics/create-a-blog-post.md

Lines changed: 0 additions & 34 deletions
This file was deleted.

docs/docs/tutorial-basics/create-a-document.md

Lines changed: 0 additions & 57 deletions
This file was deleted.

docs/docs/tutorial-basics/create-a-page.md

Lines changed: 0 additions & 43 deletions
This file was deleted.
Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
---
2+
sidebar_position: 4
3+
title: 如何创建第一篇博客
4+
---
5+
6+
## 访问站点
7+
本地启动后,可以直接访问:http://localhost:3001
8+
9+
![QQ_1730649142941.png](https://api.gaoredu.com/public/uploads/2024-11-03/QQ_1730649142941.png)
10+
11+
## 登录页面
12+
13+
登录之前,需要先注册一个账号,注册成功后登录账号:
14+
15+
![QQ_1730649395704.png](https://api.gaoredu.com/public/uploads/2024-11-03/QQ_1730649395704.png)
16+
17+
![QQ_1730649194674.png](https://api.gaoredu.com/public/uploads/2024-11-03/QQ_1730649194674.png)
18+
19+
## 进入后台
20+
可以直接访问:http://localhost:3001/admin
21+
22+
![QQ_1730649254076.png](https://api.gaoredu.com/public/uploads/2024-11-03/QQ_1730649254076.png)
23+
24+
## 新建文章
25+
26+
可以通过左侧的目录直接选择“新建文章”选项:
27+
![QQ_1730649280585.png](https://api.gaoredu.com/public/uploads/2024-11-03/QQ_1730649280585.png)
28+
29+
## 发布文章
30+
点击右上角的“发布”按钮完成内容发布:
31+
![QQ_1730649303524.png](https://api.gaoredu.com/public/uploads/2024-11-03/QQ_1730649303524.png)
32+
33+
34+
至此,你的第一篇文章就创作好了。
Lines changed: 45 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,31 +1,62 @@
11
---
22
sidebar_position: 5
3+
title: 生产环境部署
34
---
45

5-
# Deploy your site
6+
### 环境准备
7+
```bash
8+
$ git clone --depth=1 https://github.com/fecommnity/reactpress.git
9+
$ cd reactpress
10+
$ npm i -g pnpm
11+
$ pnpm i
12+
```
613

7-
Docusaurus is a **static-site-generator** (also called **[Jamstack](https://jamstack.org/)**).
14+
### 配置文件
815

9-
It builds your site as simple **static HTML, JavaScript and CSS files**.
16+
项目启动后会加载根目录下的 `.env` 配置文件,请确保MySQL数据库服务和下面的配置保持一致,并提前创建好 `reactpress` 数据库
1017

11-
## Build your site
18+
```js
19+
DB_HOST=127.0.0.1 // 数据库地址
20+
DB_PORT=3306 // 端口
21+
DB_USER=reactpress // 用户名
22+
DB_PASSWD=reactpress // 密码
23+
DB_DATABASE=reactpress // 数据库
24+
```
1225

13-
Build your site **for production**:
26+
环境准备好后,执行启动命令:
1427

1528
```bash
16-
npm run build
29+
$ pnpm run build
1730
```
1831

19-
The static files are generated in the `build` folder.
20-
21-
## Deploy your site
22-
23-
Test your production build locally:
2432

33+
### 启动服务
2534
```bash
26-
npm run serve
35+
$ pnpm run pm2
2736
```
2837

29-
The `build` folder is now served at [http://localhost:3000/](http://localhost:3000/).
38+
至此,ReactPress 服务就启动成功了。
39+
40+
### 代码更新启动
41+
当ReactPress代码更新后,可以按照如下Shell重新启动服务:
42+
```js
43+
# 更新代码
44+
git checkout master
45+
git pull
46+
47+
# 安装依赖&构建
48+
pnpm install
49+
pnpm run build
50+
51+
# 启动进程
52+
pm2 delete @reactpress/server
53+
pm2 delete @reactpress/client
54+
pnpm run pm2
55+
56+
# 开机启动
57+
pm2 startup
58+
pm2 save
59+
60+
```
3061

31-
You can now deploy the `build` folder **almost anywhere** easily, **for free** or very small cost (read the **[Deployment Guide](https://docusaurus.io/docs/deployment)**).
62+
以上就是ReactPress生成环境的完整部署流程。

0 commit comments

Comments
 (0)