mirror of
https://github.com/zhigang1992/docsify.git
synced 2026-04-25 21:55:53 +08:00
docs: add netlify (#542)
This commit is contained in:
@@ -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:
|
||||
|
||||
* `docs/` folder
|
||||
* master branch
|
||||
* gh-pages branch
|
||||
- `docs/` folder
|
||||
- master 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.
|
||||
|
||||
@@ -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.
|
||||
|
||||
``` YAML
|
||||
```YAML
|
||||
pages:
|
||||
stage: deploy
|
||||
script:
|
||||
@@ -41,20 +41,17 @@ pages:
|
||||
|
||||
## Firebase Hosting
|
||||
|
||||
!> You'll need to install the Firebase CLI using `npm i -g firebase-tools` after signing into the [Firebase Console](https://console.firebase.google.com) using a Google Account.
|
||||
!> You'll need to install the Firebase CLI using `npm i -g firebase-tools` after signing into the [Firebase Console](https://console.firebase.google.com) using a Google Account.
|
||||
|
||||
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`):
|
||||
|
||||
```json
|
||||
{
|
||||
"hosting": {
|
||||
"public": "site",
|
||||
"ignore": [
|
||||
"firebase.json",
|
||||
"**/.*",
|
||||
"**/node_modules/**"
|
||||
]
|
||||
"ignore": ["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`.
|
||||
|
||||
Reference in New Issue
Block a user