快速上手

  1. 新建目录
shell
1mkdir onepress-app
2cd onepress-app
  1. 初始化项目
shell
1yarn init
  1. 安装依赖
shell
1yarn add -D onepress
  1. package.json 中添加 scripts
json
1{
2 "scripts": {
3 "dev": "onepress dev",
4 "build": "onepress build"
5 }
6}
  1. 开始写文档
shell
1echo '# Hello OnePress' > README.md
  1. 启动开发服务器
shell
1yarn dev

这会在 http://localhost:3000 启动一个开发服务器,打开这个地址应该就能看到你的站点了。