Skip to content

Commit

Permalink
Merge branch 'develop' into update-noCompileLinks-doc
Browse files Browse the repository at this point in the history
  • Loading branch information
sy-records authored Nov 18, 2021
2 parents e8677cd + c3cdadc commit c6b0554
Show file tree
Hide file tree
Showing 31 changed files with 394 additions and 272 deletions.
72 changes: 45 additions & 27 deletions .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
@@ -1,47 +1,65 @@
<!-- Please use English language -->
<!-- Please don't delete this template -->
<!--
PULL REQUEST TEMPLATE
---
Please use English language
Please don't delete this template
---
Update "[ ]" to "[x]" to check a box in any list below.
---
To avoid wasting your time, it's best to open a **feature request issue** first and wait for approval before working on it.
-->

<!-- PULL REQUEST TEMPLATE -->
<!-- (Update "[ ]" to "[x]" to check a box) -->
## **Summary**

**Summary**
<!--
THIS IS REQUIRED! Please describe what the change does and why it should be merged.
-->

**What kind of change does this PR introduce?** (check at least one)
<!--
If changing the UI in any way, please provide the a **before/after** screenshot:
-->

- [ ] Bugfix
- [ ] Feature
- [ ] Code style update
- [ ] Refactor
- [ ] Docs
- [ ] Build-related changes
- [ ] Repo settings
- [ ] Other, please describe:
## **What kind of change does this PR introduce?**

If changing the UI of default theme, please provide the **before/after** screenshot:
<!--
Copy/paste one of the following options:
-->

**Does this PR introduce a breaking change?** (check one)
<!--
Bugfix
Feature
Code style update
Refactor
Docs
Build-related changes
Repo settings
Other
-->

<!--
If you chose Other, please describe.
-->

## **For any code change,**

- [ ] Related documentation has been updated if needed
- [ ] Related tests have been updated or tests have been added

## **Does this PR introduce a breaking change?** (check one)

- [ ] Yes
- [ ] No

If yes, please describe the impact and migration path for existing applications:

**The PR fulfills these requirements:**
## **Related issue, if any:**

- [ ] When resolving a specific issue, it's referenced in the PR's title (e.g. `fix #xxx[,#xxx]`, where "xxx" is the issue number)
<!-- Paste issue's link or number hashtag here. -->

You have tested in the following browsers: (Providing a detailed version will be better.)
## **Tested in the following browsers:**

- [ ] Chrome
- [ ] Firefox
- [ ] Safari
- [ ] Edge
- [ ] IE

If adding a **new feature**, the PR's description includes:

- [ ] A convincing reason for adding this feature
- [ ] Related documents have been updated
- [ ] Related tests have been updated

To avoid wasting your time, it's best to open a **feature request issue** first and wait for approval before working on it.
2 changes: 1 addition & 1 deletion .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ jobs:
run: npm run test:unit -- -ci --runInBand
- name: integration tests
run: npm run test:integration -- -ci --runInBand
- uses: microsoft/playwright-github-action@v1.3.0
- uses: microsoft/playwright-github-action@v1
- name: e2e tests
run: npm run test:e2e -- --ci --runInBand
- name: Upload artifacts (diff output)
Expand Down
23 changes: 23 additions & 0 deletions SECURITY.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# Security Policy

If you believe you have found a security vulnerability in docsify, please report it to us asap.

## Reporting a Vulnerability

**Please do not report security vulnerabilities through our public GitHub issues.**

Send email via :email: [email protected] to us.

Please include as much of the following information as possible to help us better understand the possible issue:

- Type of issue (e.g. cross-site scripting)
- Full paths of source file(s) related to the manifestation of the issue
- The location of the affected source code (tag/branch/commit or direct URL)
- Any special configuration required to reproduce the issue
- Step-by-step instructions to reproduce the issue
- Proof-of-concept or exploit code
- Impact of the issue, including how an attacker might exploit the issue

This information will help us triage your report more quickly.

Thank you in advance.
4 changes: 2 additions & 2 deletions docs/_sidebar.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@
- [Helpers](helpers.md)
- [Vue compatibility](vue.md)
- [CDN](cdn.md)
- [Offline Mode(PWA)](pwa.md)
- [Server-Side Rendering(SSR)](ssr.md)
- [Offline Mode (PWA)](pwa.md)
- [Server-Side Rendering (SSR)](ssr.md)
- [Embed Files](embed-files.md)

- [Awesome docsify](awesome.md)
Expand Down
26 changes: 13 additions & 13 deletions docs/configuration.md
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ window.$docsify = {
- Type: `String`
- Default: `null`

Configure the repository url, or a string of `username/repo` can add the [GitHub Corner](http://tholman.com/github-corners/) widget in the top right corner of the site.
Configure the repository url, or a string of `username/repo`, to add the [GitHub Corner](http://tholman.com/github-corners/) widget in the top right corner of the site.

```js
window.$docsify = {
Expand Down Expand Up @@ -260,7 +260,7 @@ window.$docsify = {

- Type: `String`

Website logo as it appears in the sidebar. You can resize it by using CSS.
Website logo as it appears in the sidebar. You can resize it using CSS.

```js
window.$docsify = {
Expand Down Expand Up @@ -301,8 +301,8 @@ window.$docsify = {

// For each route
nameLink: {
'/zh-cn/': '/zh-cn/',
'/': '/',
'/zh-cn/': '#/zh-cn/',
'/': '#/',
},
};
```
Expand Down Expand Up @@ -337,7 +337,7 @@ window.$docsify = {

- Type: `String`

Customize the theme color. Use [CSS3 variables](https://developer.mozilla.org/en-US/docs/Web/CSS/Using_CSS_variables) feature and polyfill in old browser.
Customize the theme color. Use [CSS3 variables](https://developer.mozilla.org/en-US/docs/Web/CSS/Using_CSS_variables) feature and polyfill in older browsers.

```js
window.$docsify = {
Expand Down Expand Up @@ -367,7 +367,7 @@ window.$docsify = {

- type: `Boolean`

If `loadSidebar` and `autoHeader` are both enabled, for each link in `_sidebar.md`, prepend a header to the page before converting it to HTML. Compare [#78](https://github.com/docsifyjs/docsify/issues/78).
If `loadSidebar` and `autoHeader` are both enabled, for each link in `_sidebar.md`, prepend a header to the page before converting it to HTML. See [#78](https://github.com/docsifyjs/docsify/issues/78).

```js
window.$docsify = {
Expand All @@ -380,7 +380,7 @@ window.$docsify = {

- type: `Boolean`

Execute the script on the page. Only parse the first script tag([demo](themes)). If Vue is present, it is turned on by default.
Execute the script on the page. Only parse the first script tag ([demo](themes)). If Vue is present, it is turned on by default.

```js
window.$docsify = {
Expand Down Expand Up @@ -410,7 +410,7 @@ window.$docsify = {
};
```

?> If this options is `false` but you don't want to emojify some specific colons , [Refer this](https://github.com/docsifyjs/docsify/issues/742#issuecomment-586313143)
?> If this option is `false` but you don't want to emojify some specific colons, [refer to this](https://github.com/docsifyjs/docsify/issues/742#issuecomment-586313143)

## mergeNavbar

Expand Down Expand Up @@ -497,8 +497,8 @@ window.$docsify = {

- type: `Array`

When `routerMode: 'history'`, you may face the cross-origin issues, See [#1379](https://github.com/docsifyjs/docsify/issues/1379).
In Markdown content, there is a simple way to solve it, see extends Markdown syntax `Cross-Origin link` in [helpers](helpers.md).
When `routerMode: 'history'`, you may face cross-origin issues. See [#1379](https://github.com/docsifyjs/docsify/issues/1379).
In Markdown content, there is a simple way to solve it: see extends Markdown syntax `Cross-Origin link` in [helpers](helpers.md).

```js
window.$docsify = {
Expand Down Expand Up @@ -570,7 +570,7 @@ window.$docsify = {

- type: `Array<string>`

List of languages that will fallback to the default language when a page is requested and it doesn't exist for the given local.
List of languages that will fallback to the default language when a page is requested and it doesn't exist for the given locale.

Example:

Expand Down Expand Up @@ -615,14 +615,14 @@ window.$docsify = {
};
```

> Note: The options with fallbackLanguages didn't work with the `notFoundPage` options.
> Note: The options for fallbackLanguages don't work with the `notFoundPage` options.
## topMargin

- type: `Number`
- default: `0`

Adds a space on top when scrolling content page to reach the selected section. This is useful in case you have a _sticky-header_ layout and you want to align anchors to the end of your header.
Adds a space on top when scrolling the content page to reach the selected section. This is useful in case you have a _sticky-header_ layout and you want to align anchors to the end of your header.

```js
window.$docsify = {
Expand Down
2 changes: 1 addition & 1 deletion docs/cover.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Cover

Activate the cover feature by setting `coverpage` to **true**, compare [coverpage configuration](configuration.md#coverpage).
Activate the cover feature by setting `coverpage` to **true**. See [coverpage configuration](configuration.md#coverpage).

## Basic usage

Expand Down
44 changes: 22 additions & 22 deletions docs/deploy.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,22 +4,22 @@ Similar to [GitBook](https://www.gitbook.com), you can deploy files to GitHub Pa

## GitHub Pages

There're three places to populate your docs for your Github repository:
There are three places to populate your docs for your GitHub repository:

- `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.
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 repository's settings page.

![github pages](_images/deploy-github-pages.png)
![GitHub Pages](_images/deploy-github-pages.png)

!> You can also save files in the root directory and select `master branch`.
You'll need to place a `.nojekyll` file in the deploy location (such as `/docs` or the gh-pages branch)

## GitLab Pages

If you are deploying your master branch, include `.gitlab-ci.yml` with the following script:
If you are deploying your master branch, create a `.gitlab-ci.yml` with the following script:

?> The `.public` workaround is so `cp` doesn't also copy `public/` to itself in an infinite loop.

Expand All @@ -43,9 +43,9 @@ pages:

!> 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.
Using a terminal, determine and navigate to the directory for your Firebase Project. This could be `~/Projects/Docs`, etc. From there, run `firebase init` and choose `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`):
Your `firebase.json` file should look similar to this (I changed the deployment directory from `public` to `site`):

```json
{
Expand All @@ -56,11 +56,11 @@ You should have your `firebase.json` file looking similar to this (I changed the
}
```

Once finished, build the starting template by running `docsify init ./site` (replacing site with the deployment directory you determined when running `firebase init` - public by default). Add/edit the documentation, then run `firebase deploy` from the base project directory.
Once finished, build the starting template by running `docsify init ./site` (replacing site with the deployment directory you determined when running `firebase init` - public by default). Add/edit the documentation, then run `firebase deploy` from the root project directory.

## VPS

Try following nginx config.
Use the following nginx config.

```nginx
server {
Expand All @@ -78,21 +78,21 @@ server {

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`.
3. Choose a repository where you store your docs, leave the **Build Command** area blank, and 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`.

### HTML5 router

When using the HTML5 router, you need to set up redirect rules that redirect all requests to your `index.html`, it's pretty simple when you're using Netlify, create a file named `_redirects` in the docs directory, add this snippet to the file and you're all set:
When using the HTML5 router, you need to set up redirect rules that redirect all requests to your `index.html`. It's pretty simple when you're using Netlify. Just create a file named `_redirects` in the docs directory, add this snippet to the file, and you're all set:

```sh
/* /index.html 200
```

## ZEIT Now
## Vercel

1. Install [Now CLI](https://zeit.co/download), `npm i -g now`
1. Install [Vercel CLI](https://vercel.com/download), `npm i -g vercel`
2. Change directory to your docsify website, for example `cd docs`
3. Deploy with a single command, `now`
3. Deploy with a single command, `vercel`

## AWS Amplify

Expand All @@ -117,7 +117,7 @@ version: 0.1
frontend:
phases:
build:
commands:
commands:
- echo "Nothing to build"
artifacts:
baseDirectory: /docs
Expand All @@ -128,28 +128,28 @@ frontend:
```

6. Add the following Redirect rules in their displayed order. Note that the second record is a PNG image where you can change it with any image format you are using.
6. Add the following Redirect rules in their displayed order. Note that the second record is a PNG image where you can change it with any image format you are using.

| Source address | Target address | Type |
|----------------|----------------|---------------|
| /<*>.md | /<*>.md | 200 (Rewrite) |
| /<*>.png | /<*>.png | 200 (Rewrite) |
| /<*> | /index.html | 200 (Rewrite) |
| /<*> | /index.html | 200 (Rewrite) |


## Docker

- Create docsify files
- Create docsify files

You need prepare the initial files instead of making in container.
You need prepare the initial files instead of making them inside the container.
See the [Quickstart](https://docsify.js.org/#/quickstart) section for instructions on how to create these files manually or using [docsify-cli](https://github.com/docsifyjs/docsify-cli).

```sh
index.html
README.md
```

- Create dockerfile
- Create Dockerfile

```Dockerfile
FROM node:latest
Expand All @@ -158,10 +158,10 @@ frontend:
RUN npm install -g docsify-cli@latest
EXPOSE 3000/tcp
ENTRYPOINT docsify serve .
```

So, current directory structure should be this:
The current directory structure should be this:

```sh
index.html
Expand All @@ -178,6 +178,6 @@ frontend:
- Run docker image

```sh
docker run -itp 3000:3000 --name=docsify -v $(pwd):/docs docsify/demo
docker run -itp 3000:3000 --name=docsify -v $(pwd):/docs docsify/demo
```

Loading

0 comments on commit c6b0554

Please sign in to comment.