feat(v2): onBrokenMarkdownLinks config (#3658)

* refactor(v2): move `reportMessage` from `core/src/server/utils` to `utils` package

* feat(v2): handle broken markdown links by using onBrokenLinks prop from siteconfig

* feat(v2): add a new site config prop called `onBrokenMarkdownLinks`

works like onBrokenLinks, but only for markdown links

* feat(v2): add `onBrokenMarkdownLinks` to API docs

* some changes regarding test issues after adding `onBrokenMarkdownLink`

* Update website/versioned_docs/version-2.0.0-alpha.66/api/docusaurus.config.js.md

Co-authored-by: Sébastien Lorber <slorber@users.noreply.github.com>
This commit is contained in:
iAmir 2020-10-31 20:34:56 +03:30 committed by GitHub
parent 52e7511869
commit 8f2d898f22
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
18 changed files with 71 additions and 38 deletions

View file

@ -108,6 +108,14 @@ The broken links detection is only available for a production build (`docusaurus
:::
### `onBrokenMarkdownLinks`
- Type: `'ignore' | 'log' | 'warn' | 'error' | 'throw'`
The behavior of Docusaurus, when it detects any broken markdown link.
By default, it prints a warning, to let you know about your broken markdown link, but you can change this security if needed.
### `onDuplicateRoutes`
- Type: `'ignore' | 'log' | 'warn' | 'error' | 'throw'`