-
-
Notifications
You must be signed in to change notification settings - Fork 8.4k
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
feat(v2): broken links detection #3059
Conversation
Deploy preview for docusaurus-2 ready! Built with commit 5af0b3b |
ready to review @yangshun opted for throwing an error on broken links by default, with ability to disable it (the error message mentions that config option) |
@@ -63,8 +63,6 @@ Strikethrough uses two tildes. ~~Scratch this.~~ | |||
|
|||
[I'm a reference-style link][arbitrary case-insensitive reference text] | |||
|
|||
[I'm a relative reference to a repository file](../blob/master/LICENSE) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Well then, I am glad this feature already found one broken link :)
# Conflicts: # packages/docusaurus/src/client/exports/Link.tsx # packages/docusaurus/src/server/configValidation.ts
Awesome! this is great. |
Docusaurus v2 alpha 59 adds broken link detection (facebook/docusaurus#3059), but that only works when linking to the source file.
Docusaurus v2 alpha 59 adds broken link detection (facebook/docusaurus#3059), but that only works when linking to the source file.
Motivation
We should be able to fail fast the build if there are broken links.
We can't necessarily detect external broken links, but at least ensure the internal links always match an existing route.
See also: #3048
Test Plan
TODO
Here's what it shows to the user, at the very end of the build (once all the broken links are collected):
It can also be a non-blocking error/log, or just be skipped, according to configuration
For links with anchor, not sure we can do anything easily... but at least the would lead to the correct page