-
Notifications
You must be signed in to change notification settings - Fork 497
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
Docusaurus version bump to warn about broken anchors; other fixes #2578
Conversation
Deploy preview for docs ready! ✅ Preview Built with commit 2936e52. |
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.
This looks good if you've tested it. Do we expose the broken link check somewhere? Could a check be integrated into the CI?
@@ -0,0 +1,8 @@ | |||
import React from "react"; | |||
// eslint-disable-next-line import/no-unresolved | |||
import useBrokenLinks from "@docusaurus/useBrokenLinks"; |
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.
This looks great. Do you know why the module is reported as unresolved?
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.
No I don't but I see we've done this elsewhere in this folder so I didn't interrogate it at the time.
@@ -6,7 +6,7 @@ slug: amplitude | |||
--- | |||
|
|||
import DefaultInstructions from './_default-event-instructions.mdx' | |||
const { title, description, sidebar_label, slug } = frontMatter | |||
export const { title, description, sidebar_label, slug } = frontMatter |
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.
nit: Do those need to be exported? They don't seem to be consumed anywhere.
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.
I think the mdx to js approach we use expects it to be exported (it was the library complaining about these not being exported), presumably because they do get used somewhere else once the files are compiled. I'm not sure. Here's their docs: https://mdxjs.com/docs/using-mdx/
My bad, just reading your initial description. Ideally, we should make sure that we error when new broken link are discovered. Not sure how practical this would be. |
I agree, I just don't know if we can "ignore" these false positives in the .mdx files (I couldn't find a way) so we have to set the level to warn until the bug is resolved. |
There were about ~10 broken anchor links and 1 broken import that Docusaurus was not waring about before.
New versions check import statements and anchors more strictly, so now we can easily catch and fix broken anchor links.
Currently set to "warn" instead of "throw" for broken anchor links since links to the api docs are broken until (I think) this issue is closed: rohit-gohri/redocusaurus#321