Skip to content
Closed
Changes from 1 commit
Commits
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
8 changes: 8 additions & 0 deletions website/docs/api/docusaurus.config.js.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -293,6 +293,14 @@ The behavior of Docusaurus when it detects any broken link.

By default, it throws an error, to ensure you never ship any broken link.

Broken link detection only applies to relative links within a plugin, it does not work across plugins nor on pages specified in `/pages` or `static`.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That's not really accurate. It's unclear to me what it means to "not work across plugins", and it definitively works if you link to /my-page after creating a pages/my-page.md file


To opt out of a broken link, add the HTML attribute `data-noBrokenLinkCheck` to the element that contains the link:

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this is not an HTML attribute (although it's technically legal to pass any data attribute to HTML elements), it is a proprietary React component prop of the Docusaurus <Link> component

As explained here, we don't document it on purpose, and only share this secret API after having clearly understood why a user need it

#11520 (comment)


```jsx
<Link to="/broken-link" data-noBrokenLinkCheck>Link</Link>
```

:::note

The broken links detection is only available for a production build (`docusaurus build`).
Expand Down