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