- 新建目录
shell
1mkdir onepress-app2cd onepress-app
- 初始化项目
shell
1yarn init
- 安装依赖
shell
1yarn add -D onepress
- 在
package.json
中添加 scripts
json
1{2 "scripts": {3 "dev": "onepress dev",4 "build": "onepress build"5 }6}
- 开始写文档
shell
1echo '# Hello OnePress' > README.md
- 启动开发服务器
shell
1yarn dev
这会在 http://localhost:3000
启动一个开发服务器,打开这个地址应该就能看到你的站点了。