Skip to content

Commit 98c268d

Browse files
committed
新增教程章节
1 parent 634e540 commit 98c268d

File tree

10 files changed

+94
-8
lines changed

10 files changed

+94
-8
lines changed

docs/.vitepress/config.js

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,17 @@
11
const base = process.env.BASE || '/'
2-
const nav = require('./configs/nav')
3-
const sidebar = require('./configs/sidebar')
2+
const nav = require('./nav')
3+
const sidebar = require('./sidebar')
44

55
module.exports = {
6-
title: 'PHP-Sword Doc',
6+
title: 'PHP-Sword',
77
description: '基于EasySwoole的PHP协程快速开发框架,让你更专注于业务代码的开发!',
88
head: [
9-
['link', { rel: 'icon', type: 'image/svg+xml', href: '/logo.svg' }]
9+
['link', { rel: 'icon', type: 'image/svg+xml', href: '/ps-logo.png' }]
1010
],
1111
base: base,
1212
themeConfig: {
1313
repo: 'php-sword/sword',
14-
logo: '/logo.svg',
14+
logo: '/ps-logo.png',
1515
docsDir: 'docs',
1616
docsBranch: 'master',
1717

docs/.vitepress/configs/nav.js renamed to docs/.vitepress/nav.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
module.exports = [
33
{ text: '文档', link: '/doc/' },
44
{ text: '组件', link: '/components/'},
5-
// { text: 'API 参考', link: '/api/' },
5+
{ text: '教程', link: '/course/' },
66
// {
77
// text: '外链地址',
88
// link:

docs/.vitepress/configs/sidebar.js renamed to docs/.vitepress/sidebar.js

Lines changed: 30 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,11 +42,40 @@ const sidebar = {
4242
}
4343
]
4444
}
45+
],
46+
'course': [
47+
{
48+
text: '基础教程',
49+
children: [
50+
{
51+
text: '教程导读',
52+
link: '/course/index'
53+
},
54+
{
55+
text: '实践开始',
56+
children: [
57+
{
58+
text: '准备工作',
59+
link: '/course/practice/ready'
60+
},
61+
{
62+
text: '创建HTTP服务器',
63+
link: '/course/practice/create'
64+
}
65+
]
66+
},
67+
{
68+
text: 'Swoole',
69+
link: '/course/swoole'
70+
}
71+
]
72+
}
4573
]
4674
}
4775

4876
module.exports = {
4977
['/doc/']: sidebar['doc'],
5078
['/components/']: sidebar['components'],
51-
// [getPath('/api/')]: 'auto'
79+
['/course/']: sidebar['course'],
80+
// ['/api/]: 'auto'
5281
}

docs/course/index.md

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
## 教程导读
2+
3+
> 想要用好swoole框架并不是没门槛的,你只是需要知道一下几点:
4+
5+
- 什么是php-fpm?
6+
- 什么Swoole?
7+
- 它们有什么不同?
8+
9+
> 通过什么方式学习?
10+
11+
如果你在初次接触Swoole的话,从官网文档去学习会感到一头雾水。
12+
13+
而我一直以来的学习方式都是`先动手`,而不是先去学习那些原理、理论知识。
14+
15+
因为这会让你失去进行下去的信心,也会击垮你的自信,`实践`才是检验真理的唯一标准。
16+
17+
### 实践开始
18+
19+
> 为了降低Swoole框架使用门槛,我将以此项目为例展示如何去快速搭建起你的项目,
20+
>
21+
> 学习过程中会一步一步的为大家答疑解惑。
22+
23+
- [准备工作](/course/practice/ready)
24+
- [创建一个新的项目](/course/swoole)
25+
- [启动Http服务器(网站)](/course/swoole)
26+
- [静态资源访问](/course/swoole)
27+
- [Session](/course/swoole)

docs/course/practice/create.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
## 擦胡歌那就

docs/course/practice/env-php.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
## PHP安装
2+
3+
这里主要介绍如何在你的Linux系统安装PHP环境
4+
5+
## 扩展安装

docs/course/practice/ready.md

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
2+
## 运行环境
3+
> 您需要具备一些基础条件才能运行
4+
5+
#### Linux操作系统
6+
Swoole需要在Linux系统中运行,
7+
你可以准备一台Linux服务器,或者通过虚拟机(具体方法百度)、Docker容器模拟Linux环境。
8+
9+
> 在 Windows 平台,也可使用 WSL(Windows Subsystem for Linux) 或 CygWin,这里不再单独说明
10+
11+
#### 安装PHP 7.4 (不再推荐老版本安装)
12+
13+
[参考PHP安装章节](/course/practice/env-php)
14+
15+
#### 安装Swoole扩展
16+
17+
[参考Swoole扩展安装章节](/course/practice/env-php)
18+
19+
#### 安装Nginx服务器(可选)
20+
21+
[参考Nginx安装章节](/course/practice/env-php)

docs/course/swoole.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
## 什么是swoole
2+
3+
swoole、、、

docs/index.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
---
22
home: true
3-
heroImage: /logo.svg
3+
heroImage: /ps-logo.png
44
actionText: 开始使用
55
actionLink: /doc/
66

docs/public/ps-logo.png

73.3 KB
Loading

0 commit comments

Comments
 (0)