feat(config): Add 404 page options. (#406)

This feature add the notFoundPage options to customize the default 404 page
with a markdown file. It also support the localisation.
This commit is contained in:
Romain Lenzotti 2018-03-03 15:09:01 +01:00 committed by cinwell.li
commit 9b3b4454de
5 changed files with 187 additions and 47 deletions

View file

@ -435,3 +435,34 @@ window.$docsify = {
]
};
```
## notFoundPage
* type: `Boolean` | `String` | `Object`
Load the `_404.md` file:
```js
window.$docsify = {
notFoundPage: true
};
```
Load the customised path of the 404 page:
```js
window.$docsify = {
notFoundPage: 'my404.md'
};
```
Load the right 404 page according to the localisation:
```js
window.$docsify = {
notFoundPage: {
'/': '_404.md',
'/de': 'de/_404.md',
}
};
```
> Note: The options with fallbackLanguages didn't work with the `notFoundPage` options.

View file

@ -419,3 +419,32 @@ window.$docsify = {
fallbackLanguages: ['fr', 'de']
};
```
## notFoundPage
* type: `Boolean` | `String` | `Object`
Load the `_404.md` file:
```js
window.$docsify = {
notFoundPage: true
};
```
Load the customised path of the 404 page:
```js
window.$docsify = {
notFoundPage: 'my404.md'
};
```
Load the right 404 page according to the localisation:
```js
window.$docsify = {
notFoundPage: {
'/': '_404.md',
'/de': 'de/_404.md',
}
};
```
> Note: The options with fallbackLanguages didn't work with the `notFoundPage` options.

View file

@ -431,3 +431,34 @@ window.$docsify = {
fallbackLanguages: ['fr', 'de']
};
```
## notFoundPage
* type: `Boolean` | `String` | `Object`
Load the `_404.md` file:
```js
window.$docsify = {
notFoundPage: true
};
```
Load the customised path of the 404 page:
```js
window.$docsify = {
notFoundPage: 'my404.md'
};
```
Load the right 404 page according to the localisation:
```js
window.$docsify = {
notFoundPage: {
'/': '_404.md',
'/de': 'de/_404.md',
}
};
```
> Note: The options with fallbackLanguages didn't work with the `notFoundPage` options.