Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Chore] revert merges. #1912

Merged
merged 50 commits into from
Oct 26, 2022
Merged
Changes from 1 commit
Commits
Show all changes
50 commits
Select commit Hold shift + click to select a range
c1227b2
fix: packages/docsify-server-renderer/package.json & packages/docsify…
snyk-bot Jan 13, 2022
719dcbe
fix: correctly fix missing +1, -1 (#1722)
ChoKaPeek Jan 14, 2022
799c0a4
Update LICENSE
trusktr Jan 17, 2022
e0bead3
Merge pull request #1725 from docsifyjs/update-license
trusktr Jan 23, 2022
47cb36e
mention that SSR is experimental and incomplete, prevent people from …
trusktr Jan 24, 2022
b58941e
Merge pull request #1734 from docsifyjs/mark-ssr-as-experimental
trusktr Jan 26, 2022
c49c39a
refactor: Update test environments and lint configuration (#1736)
jhildenbiddle Jan 31, 2022
f5b5282
chore: bump node-fetch in /packages/docsify-server-renderer (#1738)
dependabot[bot] Feb 1, 2022
18cd18c
docs: update readme (#1740)
sy-records Feb 2, 2022
301b516
fix: Coverpage when content > viewport height (#1744)
jhildenbiddle Feb 3, 2022
8aee074
chore: sync emojis (#1745)
sy-records Feb 4, 2022
fa6df6d
fix: Legacy bugs (styles, site plugin error, and dev server error) (#…
jhildenbiddle Feb 5, 2022
2dc5b12
fix: package.json & package-lock.json to reduce vulnerabilities (#1756)
snyk-bot Feb 24, 2022
a00cfbb
chore: bump follow-redirects from 1.14.7 to 1.14.9 (#1757)
dependabot[bot] Feb 25, 2022
fd883e6
chore: bump prismjs in /packages/docsify-server-renderer (#1760)
dependabot[bot] Mar 3, 2022
35002c9
feat: Native emoji w/ image-based fallbacks and improved parsing (#1746)
jhildenbiddle Mar 6, 2022
ba5ee26
feat: Emoji build (#1766)
jhildenbiddle Mar 8, 2022
9bff31d
chore: Remove dompurify (#1490)
jhildenbiddle Mar 8, 2022
716a48e
chore: update develop branch preview link (#1772)
sy-records Mar 15, 2022
63b2535
feat: Plugin error handling (#1742)
jhildenbiddle Mar 15, 2022
32c6b38
Fix: ready/doneEach order with async afterEach (#1770)
jhildenbiddle Mar 16, 2022
6f4f09b
docs: Update configuration options (#1773)
jhildenbiddle Mar 18, 2022
9e6a3e6
docs: Minor fixes to plugin docs (#1774)
jhildenbiddle Mar 19, 2022
093d4a0
chore: update vercel link (#1775)
sy-records Mar 19, 2022
2d13255
chore: update vercel logo (#1776)
sy-records Mar 23, 2022
bec187f
chore: Update CONTRIBUTING.md (#1782)
bhbarquero-dev Mar 31, 2022
b8b221f
chore: bump minimist from 1.2.5 to 1.2.6 (#1787)
dependabot[bot] Apr 13, 2022
8cbc7c8
Virtual Routes Support (#1799)
illBeRoy May 23, 2022
fa14210
docs: update the name for "Simplified Chinese" (#1811)
awxiaoxian2020 Jun 3, 2022
54cc5f9
fix: cornerExternalLinkTarget config. (#1814)
Koooooo-7 Jun 4, 2022
150236a
Improve README.md sentence (#1817)
shaunbharat Jun 7, 2022
1e46f2b
chore: bump jpeg-js from 0.4.3 to 0.4.4 (#1820)
dependabot[bot] Jun 17, 2022
682bf96
chore: bump parse-url from 6.0.0 to 6.0.2 (#1833)
dependabot[bot] Jul 10, 2022
19e40c2
Docs: Fix plugin insertion order in docs (#1850)
jhildenbiddle Aug 2, 2022
3c9b3d9
fix: Ignore emoji shorthand codes in URIs (#1847)
socsieng Aug 3, 2022
9832805
fix: fix docsify-ignore in seach title. (#1872)
Koooooo-7 Aug 30, 2022
9b74744
fix: fix search with no content. (#1878)
Koooooo-7 Sep 17, 2022
c98fda7
docs: Update GitHub default branch from to 'main' (#1883)
123MwanjeMike Sep 17, 2022
79a6619
chore: upgrade caniuse-lit. (#1879)
Koooooo-7 Sep 20, 2022
91272ca
chore: bump trim-newlines and lerna (#1895)
dependabot[bot] Oct 4, 2022
d27af3d
fix: filter null node first. (#1909)
Koooooo-7 Oct 26, 2022
7db2434
[build]: 4.12.3
Koooooo-7 Oct 26, 2022
8fcd92b
[build] 4.12.4
Koooooo-7 Oct 26, 2022
c044517
chore: add changelog 4.12.4
Koooooo-7 Oct 26, 2022
6ac6f52
update: update dependencies.
Koooooo-7 Oct 26, 2022
73ea28d
fix: fix test.
Koooooo-7 Oct 26, 2022
dbc4b45
fix: upgrade dependencies.
Koooooo-7 Oct 26, 2022
a6701d6
[build] 4.13.0
Koooooo-7 Oct 26, 2022
1d29eb3
chore: add changelog 4.13.0
Koooooo-7 Oct 26, 2022
78aaa37
chore: add changelog v4.13.0
Koooooo-7 Oct 26, 2022
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
docs: Update configuration options (#1773)
jhildenbiddle authored Mar 18, 2022

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
commit 6f4f09bd7e97b48982a6ab5cdd6668bdc5ed12e4
557 changes: 285 additions & 272 deletions docs/configuration.md
Original file line number Diff line number Diff line change
@@ -30,280 +30,314 @@ The config can also be defined as a function, in which case the first argument i
</script>
```

## el
## alias

- Type: `String`
- Default: `#app`
- Type: `Object`

The DOM element to be mounted on initialization. It can be a CSS selector string or an actual [HTMLElement](https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement).
Set the route alias. You can freely manage routing rules. Supports RegExp.

```js
window.$docsify = {
el: '#app',
alias: {
'/foo/(.*)': '/bar/$1', // supports regexp
'/zh-cn/changelog': '/changelog',
'/changelog':
'https://raw.githubusercontent.com/docsifyjs/docsify/master/CHANGELOG',
'/.*/_sidebar.md': '/_sidebar.md', // See #301
},
};
```

## repo
## auto2top

- Type: `String`
- Default: `null`
- Type: `Boolean`
- Default: `false`

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.
Scrolls to the top of the screen when the route is changed.

```js
window.$docsify = {
repo: 'docsifyjs/docsify',
// or
repo: 'https://github.com/docsifyjs/docsify/',
auto2top: true,
};
```

## maxLevel
## autoHeader

- Type: `Number`
- Default: `6`
- Type: `Boolean`
- Default: `false`

Maximum Table of content level.
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 = {
maxLevel: 4,
loadSidebar: true,
autoHeader: true,
};
```

## loadNavbar
## basePath

- Type: `Boolean|String`
- Default: `false`
- Type: `String`

Loads navbar from the Markdown file `_navbar.md` if **true**, else loads it from the path specified.
Base path of the website. You can set it to another directory or another domain name.

```js
window.$docsify = {
// load from _navbar.md
loadNavbar: true,
basePath: '/path/',

// load from nav.md
loadNavbar: 'nav.md',
// Load the files from another site
basePath: 'https://docsify.js.org/',

// Even can load files from other repo
basePath:
'https://raw.githubusercontent.com/ryanmcdermott/clean-code-javascript/master/',
};
```

## loadSidebar
## catchPluginErrors

- Type: `Boolean|String`
- Default: `false`
- Type: `Boolean`
- Default: `true`

Loads sidebar from the Markdown file `_sidebar.md` if **true**, else loads it from the path specified.
Determines if Docsify should handle uncaught _synchronous_ plugin errors automatically. This can prevent plugin errors from affecting docsify's ability to properly render live site content.

## cornerExternalLinkTarget

- Type: `String`
- Default: `'_blank'`

Target to open external link at the top right corner. Default `'_blank'` (new window/tab)

```js
window.$docsify = {
// load from _sidebar.md
loadSidebar: true,

// load from summary.md
loadSidebar: 'summary.md',
cornerExternalLinkTarget: '_self', // default: '_blank'
};
```

## hideSidebar
## coverpage

- Type : `Boolean`
- Default: `true`
- Type: `Boolean|String|String[]|Object`
- Default: `false`

This option will completely hide your sidebar and won't render any content on the side.
Activate the [cover feature](cover.md). If true, it will load from `_coverpage.md`.

```js
window.$docsify = {
hideSidebar: true,
coverpage: true,

// Custom file name
coverpage: 'cover.md',

// multiple covers
coverpage: ['/', '/zh-cn/'],

// multiple covers and custom file name
coverpage: {
'/': 'cover.md',
'/zh-cn/': 'cover.md',
},
};
```

## subMaxLevel
## crossOriginLinks

- Type: `Number`
- Default: `0`
- Type: `Array`

Add table of contents (TOC) in custom sidebar.
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 = {
subMaxLevel: 2,
crossOriginLinks: ['https://example.com/cross-origin-link'],
};
```

## auto2top
## el

- Type: `Boolean`
- Default: `false`
- Type: `String`
- Default: `'#app'`

Scrolls to the top of the screen when the route is changed.
The DOM element to be mounted on initialization. It can be a CSS selector string or an actual [HTMLElement](https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement).

```js
window.$docsify = {
auto2top: true,
el: '#app',
};
```

## homepage
## executeScript

- Type: `String`
- Default: `README.md`
- Type: `Boolean`
- Default: `null`

`README.md` in your docs folder will be treated as the homepage for your website, but sometimes you may need to serve another file as your homepage.
Execute the script on the page. Only parses the first script tag ([demo](themes)). If Vue is detected, this is `true` by default.

```js
window.$docsify = {
// Change to /home.md
homepage: 'home.md',

// Or use the readme in your repo
homepage:
'https://raw.githubusercontent.com/docsifyjs/docsify/master/README.md',
executeScript: true,
};
```

If you have a link to the homepage in the sidebar and want it to be shown as active when accessing the root url, make sure to update your sidebar accordingly:

```markdown
- Sidebar
- [Home](/)
- [Another page](another.md)
## This is test

<script>
console.log(2333)
</script>
```

For more details, see [#1131](https://github.com/docsifyjs/docsify/issues/1131).
Note that if you are running an external script, e.g. an embedded jsfiddle demo, make sure to include the [external-script](plugins.md?id=external-script) plugin.

## basePath
## ext

- Type: `String`
- Default: `'.md'`

Base path of the website. You can set it to another directory or another domain name.
Request file extension.

```js
window.$docsify = {
basePath: '/path/',
ext: '.md',
};
```

// Load the files from another site
basePath: 'https://docsify.js.org/',
## externalLinkRel

// Even can load files from other repo
basePath:
'https://raw.githubusercontent.com/ryanmcdermott/clean-code-javascript/master/',
- Type: `String`
- Default: `'noopener'`

Default `'noopener'` (no opener) prevents the newly opened external page (when [externalLinkTarget](#externallinktarget) is `'_blank'`) from having the ability to control our page. No `rel` is set when it's not `'_blank'`. See [this post](https://mathiasbynens.github.io/rel-noopener/) for more information about why you may want to use this option.

```js
window.$docsify = {
externalLinkRel: '', // default: 'noopener'
};
```

## relativePath

- Type: `Boolean`
- Default: `false`
## externalLinkTarget

If **true**, links are relative to the current context.
- Type: `String`
- Default: `'_blank'`

For example, the directory structure is as follows:
Target to open external links inside the markdown. Default `'_blank'` (new window/tab)

```text
.
└── docs
├── README.md
├── guide.md
└── zh-cn
├── README.md
├── guide.md
└── config
└── example.md
```js
window.$docsify = {
externalLinkTarget: '_self', // default: '_blank'
};
```

With relative path **enabled** and current URL `http://domain.com/zh-cn/README`, given links will resolve to:
## fallbackLanguages

```text
guide.md => http://domain.com/zh-cn/guide
config/example.md => http://domain.com/zh-cn/config/example
../README.md => http://domain.com/README
/README.md => http://domain.com/README
```
- 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 locale.

Example:

- try to fetch the page of `/de/overview`. If this page exists, it'll be displayed.
- then try to fetch the default page `/overview` (depending on the default language). If this page exists, it'll be displayed.
- then display the 404 page.

```js
window.$docsify = {
// Relative path enabled
relativePath: true,

// Relative path disabled (default value)
relativePath: false,
fallbackLanguages: ['fr', 'de'],
};
```

## coverpage
## formatUpdated

- Type: `Boolean|String|String[]|Object`
- Default: `false`
- Type: `String|Function`

Activate the [cover feature](cover.md). If true, it will load from `_coverpage.md`.
We can display the file update date through **{docsify-updated<span>}</span>** variable. And format it by `formatUpdated`.
See https://github.com/lukeed/tinydate#patterns

```js
window.$docsify = {
coverpage: true,

// Custom file name
coverpage: 'cover.md',
formatUpdated: '{MM}/{DD} {HH}:{mm}',

// multiple covers
coverpage: ['/', '/zh-cn/'],
formatUpdated: function (time) {
// ...

// multiple covers and custom file name
coverpage: {
'/': 'cover.md',
'/zh-cn/': 'cover.md',
return time;
},
};
```

## logo
## hideSidebar

- Type: `String`
- Type : `Boolean`
- Default: `true`

Website logo as it appears in the sidebar. You can resize it using CSS.
This option will completely hide your sidebar and won't render any content on the side.

```js
window.$docsify = {
logo: '/_media/icon.svg',
hideSidebar: true,
};
```

## name
## homepage

- Type: `String`
- Default: `'README.md'`

Website name as it appears in the sidebar.
`README.md` in your docs folder will be treated as the homepage for your website, but sometimes you may need to serve another file as your homepage.

```js
window.$docsify = {
name: 'docsify',
// Change to /home.md
homepage: 'home.md',

// Or use the readme in your repo
homepage:
'https://raw.githubusercontent.com/docsifyjs/docsify/master/README.md',
};
```

The name field can also contain custom HTML for easier customization:
## loadNavbar

- Type: `Boolean|String`
- Default: `false`

Loads navbar from the Markdown file `_navbar.md` if **true**, else loads it from the path specified.

```js
window.$docsify = {
name: '<span>docsify</span>',
// load from _navbar.md
loadNavbar: true,

// load from nav.md
loadNavbar: 'nav.md',
};
```

## nameLink
## loadSidebar

- Type: `Boolean|String`
- Default: `false`

Loads sidebar from the Markdown file `_sidebar.md` if **true**, else loads it from the path specified.

```js
window.$docsify = {
// load from _sidebar.md
loadSidebar: true,

// load from summary.md
loadSidebar: 'summary.md',
};
```

## logo

- Type: `String`
- Default: `window.location.pathname`

The URL that the website `name` links to.
Website logo as it appears in the sidebar. You can resize it using CSS.

```js
window.$docsify = {
nameLink: '/',

// For each route
nameLink: {
'/zh-cn/': '#/zh-cn/',
'/': '#/',
},
logo: '/_media/icon.svg',
};
```

@@ -333,70 +367,70 @@ window.$docsify = {
};
```

## themeColor
## maxLevel

- Type: `String`
- Type: `Number`
- Default: `6`

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.
Maximum Table of content level.

```js
window.$docsify = {
themeColor: '#3F51B5',
maxLevel: 4,
};
```

## alias
## mergeNavbar

- Type: `Object`
- Type: `Boolean`
- Default: `false`

Set the route alias. You can freely manage routing rules. Supports RegExp.
Navbar will be merged with the sidebar on smaller screens.

```js
window.$docsify = {
alias: {
'/foo/(.*)': '/bar/$1', // supports regexp
'/zh-cn/changelog': '/changelog',
'/changelog':
'https://raw.githubusercontent.com/docsifyjs/docsify/master/CHANGELOG',
'/.*/_sidebar.md': '/_sidebar.md', // See #301
},
mergeNavbar: true,
};
```

## autoHeader
## name

- Type: `Boolean`
- Type: `String`

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).
Website name as it appears in the sidebar.

```js
window.$docsify = {
loadSidebar: true,
autoHeader: true,
name: 'docsify',
};
```

## executeScript

- 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.
The name field can also contain custom HTML for easier customization:

```js
window.$docsify = {
executeScript: true,
name: '<span>docsify</span>',
};
```

```markdown
## This is test
## nameLink

<script>
console.log(2333)
</script>
```
- Type: `String`
- Default: `'window.location.pathname'`

Note that if you are running an external script, e.g. an embedded jsfiddle demo, make sure to include the [external-script](plugins.md?id=external-script) plugin.
The URL that the website `name` links to.

```js
window.$docsify = {
nameLink: '/',

// For each route
nameLink: {
'/zh-cn/': '#/zh-cn/',
'/': '#/',
},
};
```

## nativeEmoji

@@ -451,6 +485,18 @@ To render shorthand codes as text, replace `:` characters with the `&colon;` HTM

</output>

## noCompileLinks

- Type: `Array<string>`

Sometimes we do not want docsify to handle our links. See [#203](https://github.com/docsifyjs/docsify/issues/203). We can skip compiling of certain links by specifying an array of strings. Each string is converted into to a regular expression (`RegExp`) and the _whole_ href of a link is matched against it.

```js
window.$docsify = {
noCompileLinks: ['/foo', '/bar/.*'],
};
```

## noEmoji

- Type: `Boolean`
@@ -490,121 +536,112 @@ To disable emoji parsing of individual shorthand codes, replace `:` characters w

</output>

## mergeNavbar
## notFoundPage

- Type: `Boolean`
- Type: `Boolean` | `String` | `Object`
- Default: `false`

Navbar will be merged with the sidebar on smaller screens.
Display default "404 - Not found" message:

```js
window.$docsify = {
mergeNavbar: true,
notFoundPage: false,
};
```

## formatUpdated

- Type: `String|Function`

We can display the file update date through **{docsify-updated<span>}</span>** variable. And format it by `formatUpdated`.
See https://github.com/lukeed/tinydate#patterns
Load the `_404.md` file:

```js
window.$docsify = {
formatUpdated: '{MM}/{DD} {HH}:{mm}',

formatUpdated: function (time) {
// ...

return time;
},
notFoundPage: true,
};
```

## externalLinkTarget

- Type: `String`
- Default: `_blank`

Target to open external links inside the markdown. Default `'_blank'` (new window/tab)
Load the customized path of the 404 page:

```js
window.$docsify = {
externalLinkTarget: '_self', // default: '_blank'
notFoundPage: 'my404.md',
};
```

## cornerExternalLinkTarget

- Type:`String`
- Default:`_blank`

Target to open external link at the top right corner. Default `'_blank'` (new window/tab)
Load the right 404 page according to the localization:

```js
window.$docsify = {
cornerExternalLinkTarget: '_self', // default: '_blank'
notFoundPage: {
'/': '_404.md',
'/de': 'de/_404.md',
},
};
```

## externalLinkRel

- Type: `String`
- Default: `noopener`

Default `'noopener'` (no opener) prevents the newly opened external page (when [externalLinkTarget](#externallinktarget) is `'_blank'`) from having the ability to control our page. No `rel` is set when it's not `'_blank'`. See [this post](https://mathiasbynens.github.io/rel-noopener/) for more information about why you may want to use this option.
> Note: The options for fallbackLanguages don't work with the `notFoundPage` options.
```js
window.$docsify = {
externalLinkRel: '', // default: 'noopener'
};
```
## onlyCover

## routerMode
- Type: `Boolean`
- Default: `false`

- Type: `String`
- Default: `hash`
Only coverpage is loaded when visiting the home page.

```js
window.$docsify = {
routerMode: 'history', // default: 'hash'
onlyCover: false,
};
```

## crossOriginLinks
## relativePath

- Type: `Array`
- Type: `Boolean`
- Default: `false`

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).
If **true**, links are relative to the current context.

```js
window.$docsify = {
crossOriginLinks: ['https://example.com/cross-origin-link'],
};
```
For example, the directory structure is as follows:

## noCompileLinks
```text
.
└── docs
├── README.md
├── guide.md
└── zh-cn
├── README.md
├── guide.md
└── config
└── example.md
```

- Type: `Array<string>`
With relative path **enabled** and current URL `http://domain.com/zh-cn/README`, given links will resolve to:

Sometimes we do not want docsify to handle our links. See [#203](https://github.com/docsifyjs/docsify/issues/203). We can skip compiling of certain links by specifying an array of strings. Each string is converted into to a regular expression (`RegExp`) and the _whole_ href of a link is matched against it.
```text
guide.md => http://domain.com/zh-cn/guide
config/example.md => http://domain.com/zh-cn/config/example
../README.md => http://domain.com/README
/README.md => http://domain.com/README
```

```js
window.$docsify = {
noCompileLinks: ['/foo', '/bar/.*'],
// Relative path enabled
relativePath: true,

// Relative path disabled (default value)
relativePath: false,
};
```

## onlyCover
## repo

- Type: `Boolean`
- Type: `String`

Only coverpage is loaded when visiting the home page.
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 = {
onlyCover: false,
repo: 'docsifyjs/docsify',
// or
repo: 'https://github.com/docsifyjs/docsify/',
};
```

@@ -632,69 +669,52 @@ window.$docsify = {
};
```

## ext
## routerMode

- Type: `String`

Request file extension.
- Default: `'hash'`

```js
window.$docsify = {
ext: '.md',
routerMode: 'history', // default: 'hash'
};
```

## fallbackLanguages

- 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 locale.
## subMaxLevel

Example:
- Type: `Number`
- Default: `0`

- try to fetch the page of `/de/overview`. If this page exists, it'll be displayed.
- then try to fetch the default page `/overview` (depending on the default language). If this page exists, it'll be displayed.
- then display the 404 page.
Add table of contents (TOC) in custom sidebar.

```js
window.$docsify = {
fallbackLanguages: ['fr', 'de'],
subMaxLevel: 2,
};
```

## notFoundPage

- Type: `Boolean` | `String` | `Object`

Load the `_404.md` file:
If you have a link to the homepage in the sidebar and want it to be shown as active when accessing the root url, make sure to update your sidebar accordingly:

```js
window.$docsify = {
notFoundPage: true,
};
```markdown
- Sidebar
- [Home](/)
- [Another page](another.md)
```

Load the customized path of the 404 page:
For more details, see [#1131](https://github.com/docsifyjs/docsify/issues/1131).

```js
window.$docsify = {
notFoundPage: 'my404.md',
};
```
## themeColor

Load the right 404 page according to the localization:
- 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 older browsers.

```js
window.$docsify = {
notFoundPage: {
'/': '_404.md',
'/de': 'de/_404.md',
},
themeColor: '#3F51B5',
};
```

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

- Type: `Number`
@@ -808,10 +828,3 @@ window.$docsify = {
{{ count }}
<button @click="count += 1">+</button>
</output>

## catchPluginErrors

- Type: `Boolean`
- Default: `true`

Determines if Docsify should handle uncaught _synchronous_ plugin errors automatically. This can prevent plugin errors from affecting docsify's ability to properly render live site content.
47 changes: 23 additions & 24 deletions src/core/config.js
Original file line number Diff line number Diff line change
@@ -6,38 +6,37 @@ const currentScript = document.currentScript;
export default function (vm) {
const config = merge(
{
el: '#app',
repo: '',
maxLevel: 6,
subMaxLevel: 0,
loadSidebar: null,
loadNavbar: null,
homepage: 'README.md',
coverpage: '',
basePath: '',
auto2top: false,
name: '',
themeColor: '',
nameLink: window.location.pathname,
autoHeader: false,
basePath: '',
catchPluginErrors: true,
cornerExternalLinkTarget: '_blank',
coverpage: '',
crossOriginLinks: [],
el: '#app',
executeScript: null,
nativeEmoji: false,
noEmoji: false,
ga: '',
ext: '.md',
mergeNavbar: false,
formatUpdated: '',
// This config for the links inside markdown
externalLinkTarget: '_blank',
// This config for the corner
cornerExternalLinkTarget: '_blank',
externalLinkRel: 'noopener',
routerMode: 'hash',
externalLinkTarget: '_blank',
formatUpdated: '',
ga: '',
homepage: 'README.md',
loadNavbar: null,
loadSidebar: null,
maxLevel: 6,
mergeNavbar: false,
name: '',
nameLink: window.location.pathname,
nativeEmoji: false,
noCompileLinks: [],
crossOriginLinks: [],
noEmoji: false,
notFoundPage: true,
relativePath: false,
repo: '',
routerMode: 'hash',
subMaxLevel: 0,
themeColor: '',
topMargin: 0,
catchPluginErrors: true,
},
typeof window.$docsify === 'function'
? window.$docsify(vm)