docs: add netlify (#542)
This commit is contained in:
parent
ee72dd05e5
commit
f8f22e5a3c
3 changed files with 31 additions and 19 deletions
|
|
@ -6,9 +6,9 @@
|
||||||
|
|
||||||
Du kannst folgende drei Orte verwenden, um die Dokumentation für dein Github repository zu verwalten:
|
Du kannst folgende drei Orte verwenden, um die Dokumentation für dein Github repository zu verwalten:
|
||||||
|
|
||||||
* `docs/` Ordner
|
- `docs/` Ordner
|
||||||
* master branch
|
- master branch
|
||||||
* gh-pages branch
|
- gh-pages branch
|
||||||
|
|
||||||
Es wird empfohlen, deine Dateien im `./docs` Unterordner im `master` branch deines repository zu speichern. Wechsle dann zu den Einstellungen deines repository und wähle `master branch /docs folder` als deine Github Pages Quelle.
|
Es wird empfohlen, deine Dateien im `./docs` Unterordner im `master` branch deines repository zu speichern. Wechsle dann zu den Einstellungen deines repository und wähle `master branch /docs folder` als deine Github Pages Quelle.
|
||||||
|
|
||||||
|
|
@ -16,14 +16,13 @@ Es wird empfohlen, deine Dateien im `./docs` Unterordner im `master` branch dein
|
||||||
|
|
||||||
!> Du kannst die Dateien auch im Hauptverzeichnis speichern und dann `master branch` in den Einstellungen auswählen.
|
!> Du kannst die Dateien auch im Hauptverzeichnis speichern und dann `master branch` in den Einstellungen auswählen.
|
||||||
|
|
||||||
|
|
||||||
## GitLab Pages
|
## GitLab Pages
|
||||||
|
|
||||||
If you are deploying your master branch, include `.gitlab-ci.yml` with the following script:
|
If you are deploying your master branch, include `.gitlab-ci.yml` with the following script:
|
||||||
|
|
||||||
?> The `.public` workaround is so `cp` doesn't also copy `public/` to itself in an infinite loop.
|
?> The `.public` workaround is so `cp` doesn't also copy `public/` to itself in an infinite loop.
|
||||||
|
|
||||||
``` YAML
|
```YAML
|
||||||
pages:
|
pages:
|
||||||
stage: deploy
|
stage: deploy
|
||||||
script:
|
script:
|
||||||
|
|
@ -39,7 +38,6 @@ pages:
|
||||||
|
|
||||||
!> You can replace script with `- cp -r docs/. public`, if `./docs` is your Docsify subfolder.
|
!> You can replace script with `- cp -r docs/. public`, if `./docs` is your Docsify subfolder.
|
||||||
|
|
||||||
|
|
||||||
## VPS
|
## VPS
|
||||||
|
|
||||||
Verwende folgende nginx config.
|
Verwende folgende nginx config.
|
||||||
|
|
@ -55,3 +53,9 @@ server {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
|
## Netlify
|
||||||
|
|
||||||
|
1. Login to your [Netlify](https://www.netlify.com/) account.
|
||||||
|
2. In the [dashboard](https://app.netlify.com/) page, click New site from Git.
|
||||||
|
3. Choose a repository where you store your docs, leave the Build Command area blank, fill in the Publish directory area with the directory of your `index.html`, for example it should be docs if you populated it at `docs/index.html`.
|
||||||
|
|
|
||||||
|
|
@ -6,9 +6,9 @@ Similar to [GitBook](https://www.gitbook.com), you can deploy files to GitHub Pa
|
||||||
|
|
||||||
There're three places to populate your docs for your Github repository:
|
There're three places to populate your docs for your Github repository:
|
||||||
|
|
||||||
* `docs/` folder
|
- `docs/` folder
|
||||||
* master branch
|
- master branch
|
||||||
* gh-pages branch
|
- gh-pages branch
|
||||||
|
|
||||||
It is recommended that you save your files to the `./docs` subfolder of the `master` branch of your repository. Then select `master branch /docs folder` as your Github Pages source in your repositories' settings page.
|
It is recommended that you save your files to the `./docs` subfolder of the `master` branch of your repository. Then select `master branch /docs folder` as your Github Pages source in your repositories' settings page.
|
||||||
|
|
||||||
|
|
@ -23,7 +23,7 @@ If you are deploying your master branch, include `.gitlab-ci.yml` with the follo
|
||||||
|
|
||||||
?> The `.public` workaround is so `cp` doesn't also copy `public/` to itself in an infinite loop.
|
?> The `.public` workaround is so `cp` doesn't also copy `public/` to itself in an infinite loop.
|
||||||
|
|
||||||
``` YAML
|
```YAML
|
||||||
pages:
|
pages:
|
||||||
stage: deploy
|
stage: deploy
|
||||||
script:
|
script:
|
||||||
|
|
@ -46,15 +46,12 @@ pages:
|
||||||
Using Terminal determine and navigate to the directory for your Firebase Project - this could be `~/Projects/Docs` etc. From there, run `firebase init`, choosing `Hosting` from the menu (use **space** to select, **arrow keys** to change options and **enter** to confirm). Follow the setup instructions.
|
Using Terminal determine and navigate to the directory for your Firebase Project - this could be `~/Projects/Docs` etc. From there, run `firebase init`, choosing `Hosting` from the menu (use **space** to select, **arrow keys** to change options and **enter** to confirm). Follow the setup instructions.
|
||||||
|
|
||||||
You should have your `firebase.json` file looking similar to this (I changed the deployment directory from `public` to `site`):
|
You should have your `firebase.json` file looking similar to this (I changed the deployment directory from `public` to `site`):
|
||||||
|
|
||||||
```json
|
```json
|
||||||
{
|
{
|
||||||
"hosting": {
|
"hosting": {
|
||||||
"public": "site",
|
"public": "site",
|
||||||
"ignore": [
|
"ignore": ["firebase.json", "**/.*", "**/node_modules/**"]
|
||||||
"firebase.json",
|
|
||||||
"**/.*",
|
|
||||||
"**/node_modules/**"
|
|
||||||
]
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
@ -76,3 +73,9 @@ server {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
|
## Netlify
|
||||||
|
|
||||||
|
1. Login to your [Netlify](https://www.netlify.com/) account.
|
||||||
|
2. In the [dashboard](https://app.netlify.com/) page, click New site from Git.
|
||||||
|
3. Choose a repository where you store your docs, leave the Build Command area blank, fill in the Publish directory area with the directory of your `index.html`, for example it should be docs if you populated it at `docs/index.html`.
|
||||||
|
|
|
||||||
|
|
@ -5,6 +5,7 @@
|
||||||
## GitHub Pages
|
## GitHub Pages
|
||||||
|
|
||||||
GitHub Pages 支持从三个地方读取文件
|
GitHub Pages 支持从三个地方读取文件
|
||||||
|
|
||||||
- `docs/` 目录
|
- `docs/` 目录
|
||||||
- master 分支
|
- master 分支
|
||||||
- gh-pages 分支
|
- gh-pages 分支
|
||||||
|
|
@ -15,14 +16,13 @@ GitHub Pages 支持从三个地方读取文件
|
||||||
|
|
||||||
!> 可以将文档放在根目录下,然后选择 **master 分支** 作为文档目录。
|
!> 可以将文档放在根目录下,然后选择 **master 分支** 作为文档目录。
|
||||||
|
|
||||||
|
|
||||||
## GitLab Pages
|
## GitLab Pages
|
||||||
|
|
||||||
如果你正在部署你的主分支, 在 `.gitlab-ci.yml` 中包含以下脚本:
|
如果你正在部署你的主分支, 在 `.gitlab-ci.yml` 中包含以下脚本:
|
||||||
|
|
||||||
?> `.public` 的解决方法是这样的,`cp` 不会无限循环的将 `public/` 复制到自身。
|
?> `.public` 的解决方法是这样的,`cp` 不会无限循环的将 `public/` 复制到自身。
|
||||||
|
|
||||||
``` YAML
|
```YAML
|
||||||
pages:
|
pages:
|
||||||
stage: deploy
|
stage: deploy
|
||||||
script:
|
script:
|
||||||
|
|
@ -38,7 +38,6 @@ pages:
|
||||||
|
|
||||||
!> 你可以用 `- cp -r docs/. public` 替换脚本, 如果 `./docs` 是你的 docsify 子文件夹。
|
!> 你可以用 `- cp -r docs/. public` 替换脚本, 如果 `./docs` 是你的 docsify 子文件夹。
|
||||||
|
|
||||||
|
|
||||||
## VPS
|
## VPS
|
||||||
|
|
||||||
和部署所有静态网站一样,只需将服务器的访问根目录设定为 `index.html` 文件。
|
和部署所有静态网站一样,只需将服务器的访问根目录设定为 `index.html` 文件。
|
||||||
|
|
@ -56,3 +55,9 @@ server {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
|
## Netlify
|
||||||
|
|
||||||
|
1. Login to your [Netlify](https://www.netlify.com/) account.
|
||||||
|
2. In the [dashboard](https://app.netlify.com/) page, click New site from Git.
|
||||||
|
3. Choose a repository where you store your docs, leave the Build Command area blank, fill in the Publish directory area with the directory of your `index.html`, for example it should be docs if you populated it at `docs/index.html`.
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue