-
Notifications
You must be signed in to change notification settings - Fork 39
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
chore: add a deadlink checker for nav/sidebar items #1236
Conversation
6e086d2
to
89fb868
Compare
Deploying documentation with Cloudflare Pages
|
89fb868
to
5cdb64a
Compare
Cloudflare deployment logs are available here |
@mujahidkay wondering whether we have any other options to fix #1225 ? |
I think Linkinator seems like another option but I haven't really tested it. I will give it a go in my free time. |
scripts/checkLinks.mjs
Outdated
const __dirname = path.dirname(__filename); | ||
|
||
const extractLinks = (content) => { | ||
const linkRegex = /link:\s*'([^']+)'/g; |
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 guess there is nothing to stop someone from using double quotes with links?
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.
good catch!
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 this would also break the CI if there is a comment that contains a broken link?
b0fe23f
to
9bf48e6
Compare
9bf48e6
to
3fc7dd8
Compare
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.
lgtm - nice work!
Closes: #1225
Added this check to build script to keep it consistent with vitepress's built-in deadlink checker for md files (raises error during build time)
Unrelated but also formats the scripts dir.
Testing:
You can test by checking out the branch and entering invalid links.