-
-
Notifications
You must be signed in to change notification settings - Fork 8.5k
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
Links validation failures after updating to 2.0.0-alpha.61 #3303
Comments
Hi, This is a security we put in place to detect broken links. This will catch false positives, like there, because Docusaurus is not aware of the Note, at the end of the error message, there is an explanation about a setting so that instead of throwing, it errors, warn, or ignore all broken links we found. Also, if you use full URLs (including the domain) these URLs won't be checked against the broken link checker. As I knew this feature could be annoying and bring false positive, I've added a "secret" escape hatch. The navbar/footer items linking to the javadoc could be:
This way you opt out of the broken link checker on a per-link basis, and can keep detecting legit broken links. |
Hi @slorber! Thanks for your answer. I'll add some clarification questions:
|
Hi, The escape hatch is mostly for sites that use a baseurl like So, I'd that we'll fix this soon, in the meantime you can ignore the broken link errors (or at least not throw) and re-enable later.
I have no idea what you are talking about 🤪 |
Hello @slorber,
It's about this part:
|
Validation errors (broken links found)Yes, things in ./static are part of the site. Actually the code only consider files like myFile.html, it does not consider folders like build/javadoc/index.html Navigation failures:If you use markdown links like Do you have such links? Because in your codebase I've seen the following:
This will work normally. But if you want to avoid the domain, I've added a similar escape hatch so that Docusaurus leaves the path unmodified and pass it directly to the link:
If you can give me link to files for which you have a problem, that will be helpful to see how to solve this problem |
For the broken links, it should be solved in #3308 For the navigation failure, I'm not sure but I don't feel there's a regression there, it's likely that it didn't work in early versions of Docusaurus 2 and I don't see a better solution than the |
Unfortunately I don't even think the The problem is a bit different here and I don't think there's an easy way to solve it. Unlike the broken link checker that can do its job at the end of the build, we have to choose what should be done when an user clicks on the link: should we navigate with classic HTML navigation, or should we navigate with SPA-like navigation ( As we are building a static app, there is no easy way to know ahead of time if /javadoc is an SPA link route or not. Not sure what is the best solution to this problem, but it's something we should try to solve indeed. |
I've opened a proper issue to track this problem: #3309 |
Validation errors (broken links found)
Thank you! That sounds right to me 😃 . Considering that any arbitrary number of subfolders will be handled. Navigation failures
From #3278 I understood that all root ( So, I was considering that any
That was a mistake and it was fixed for Docusaurus in I'll copy the last part to the new dedicated issue as well, to continue discussion there 😃 |
At some point we have to choose. Supposing we use a
Can lead to one of the following navigation method being used
Given that we can only write very simple links in markdown syntax, how can we choose between these 3 code paths? I think we can prevent case 1 from happening, if we try to see if the link matches a "known" route. But there is not a clean way to define what behavior is the correct one for case 2 and case 3, yet we must support both, not only your /baseUrl/javadoc case :) I'd like to not have to modify the docs, and solve this usecase from the outside, but somehow we need a way to tell docusaurus that Note: |
I've answered in #3309 (comment), to keep navigation discussion in its own issue. |
🐛 Bug Report
We are in the process of migrating Litho UI Framework website to Docusaurus v2. After updating Docusaurus setup to
alpha.61
we started getting weird behaviour of not seeing the content ofstatic/javadoc
folder on the website and prod build started to fail on links validation step.Have you read the Contributing Guidelines on issues?
Yep
To Reproduce
Validation errors:
website
folder and runyarn run build
for links validation to kick in/javadoc/...
linksNavigation failures:
website
folder and runyarn run start
to access website locallyhttp://localhost:3000/javadoc/
Cmd+R
/Ctrl+R
and you'll see the correct API Javadocs pageExpected behavior
No validation errors on build and
/javadocs/...
links navigation working without reloads.Actual Behavior
Validation errors:
Console log screenshot
Navigation failures:
Video in Dropbox
Your Environment
Reproducible Demo
static/javadoc
folder: https://github.com/facebook/litho/tree/master/website/static/javadocSteps are present in "To Reproduce" section.
The text was updated successfully, but these errors were encountered: