feat(core): make broken link checker detect broken anchors - add onBrokenAnchors config (#9528)

Co-authored-by: sebastienlorber <lorber.sebastien@gmail.com>
This commit is contained in:
ozaki 2024-01-04 12:56:20 +01:00 committed by GitHub
parent 332a466893
commit fd49301a45
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
52 changed files with 1220 additions and 519 deletions

View file

@ -188,7 +188,7 @@ export default {
The behavior of Docusaurus when it detects any broken link.
By default, it throws an error, to ensure you never ship any broken link, but you can lower this security if needed.
By default, it throws an error, to ensure you never ship any broken link.
:::note
@ -196,13 +196,21 @@ The broken links detection is only available for a production build (`docusaurus
:::
### `onBrokenAnchors` {#onBrokenAnchors}
- Type: `'ignore' | 'log' | 'warn' | 'throw'`
The behavior of Docusaurus when it detects any broken anchor declared with the `Heading` component of Docusaurus.
By default, it prints a warning, to let you know about your broken anchors.
### `onBrokenMarkdownLinks` {#onBrokenMarkdownLinks}
- Type: `'ignore' | 'log' | 'warn' | '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.
By default, it prints a warning, to let you know about your broken Markdown link.
### `onDuplicateRoutes` {#onDuplicateRoutes}