feat(cli): add github page deploy desc to templates (#236)
This commit is contained in:
parent
713e7bcc2a
commit
25c4a78767
@ -50,7 +50,24 @@ npm run docs:preview
|
||||
npm run vp-update
|
||||
```
|
||||
{{/if}}
|
||||
{{#if (equal deploy "github")}}
|
||||
|
||||
## Deploy to GitHub Pages
|
||||
|
||||
The plume theme has been created with GitHub Actions: `.github/workflows/docs-deploy.yml`. You also need to make the following settings in the GitHub repository:
|
||||
|
||||
- [ ] `settings > Actions > General`, Scroll to the bottom of the page, under `Workflow permissions`, check `Read and write permissions`, and click the save button.
|
||||
|
||||
- [ ] `settings > Pages`, In `Build and deployment`, select `Deploy from a branch` for `Source`, choose `gh-pages` for `Branch`, and click the save button.
|
||||
(The `gh-pages` branch may not exist upon first creation. You can complete the above setup first, push the code to the main branch, wait for `github actions` to finish, and then proceed with the setup.)
|
||||
|
||||
- [ ] Modify the `base` option in `docs/.vuepress/config.ts`:
|
||||
- If you are planning to deploy to `https://<USERNAME>.github.io/`, you can skip this step as `base` defaults to `"/"`.
|
||||
- If you are planning to deploy to `https://<USERNAME>.github.io/<REPO>/`, meaning your repository URL is `https://github.com/<USERNAME>/<REPO>`, set `base` to `"/<REPO>/"`.
|
||||
|
||||
To customize a domain name, please refer to [Github Pages](https://docs.github.com/zh/pages/configuring-a-custom-domain-for-your-github-pages-site/about-custom-domains-and-github-pages)
|
||||
|
||||
{{/if}}
|
||||
## Documents
|
||||
|
||||
- [vuepress](https://vuepress.vuejs.org/)
|
||||
|
||||
@ -50,7 +50,24 @@ npm run docs:preview
|
||||
npm run vp-update
|
||||
```
|
||||
{{/if}}
|
||||
{{#if (equal deploy "github")}}
|
||||
|
||||
## 部署到 GitHub Pages
|
||||
|
||||
主题已创建 github actions: `.github/workflows/docs-deploy.yml`,你还需要在 github 仓库中进行以下设置:
|
||||
|
||||
- [ ] `settings > Actions > General`,拉到页面底部,在 `Workflow permissions` 下,勾选 `Read and write permissions`,并点击保存按钮
|
||||
|
||||
- [ ] `settings > Pages`, 在 `Build and deployment` 中,`Source` 选择 `Deploy from a branch`, `Branch` 选择 `gh-pages`,并点击保存按钮
|
||||
(首次创建可能没有 `gh-pages`分支,你可以先完成上面的设置后,推送一次代码到主分支,等待 `github actions` 完成后再进行设置)
|
||||
|
||||
- [ ] 修改 `docs/.vuepress/config.ts` 中的 `base` 选项:
|
||||
- 如果你准备发布到 `https://<USERNAME>.github.io/` ,你可以省略这一步,因为 `base` 默认就是 `"/"` 。
|
||||
- 如果你准备发布到 `https://<USERNAME>.github.io/<REPO>/` ,也就是说你的仓库地址是 `https://github.com/<USERNAME>/<REPO>` ,则将 `base` 设置为 `"/<REPO>/"`。
|
||||
|
||||
如需要自定义域名,请查看 [Github Pages 文档](https://docs.github.com/zh/pages/configuring-a-custom-domain-for-your-github-pages-site/about-custom-domains-and-github-pages)
|
||||
|
||||
{{/if}}
|
||||
## 文档
|
||||
|
||||
- [vuepress](https://vuepress.vuejs.org/)
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user