Skip to content
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

Merged
merged 3 commits into from
Dec 27, 2024

Conversation

mujahidkay
Copy link
Member

@mujahidkay mujahidkay commented Oct 8, 2024

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.

@mujahidkay mujahidkay self-assigned this Oct 8, 2024
Copy link

cloudflare-workers-and-pages bot commented Oct 11, 2024

Deploying documentation with  Cloudflare Pages  Cloudflare Pages

Latest commit: 26875df
Status: ✅  Deploy successful!
Preview URL: https://f13d514a.documentation-7tp.pages.dev
Branch Preview URL: https://mk-deadlink-checker.documentation-7tp.pages.dev

View logs

@mujahidkay mujahidkay marked this pull request as ready for review October 11, 2024 22:21
@mujahidkay mujahidkay requested a review from Jovonni October 11, 2024 22:21
Copy link

github-actions bot commented Oct 12, 2024

Cloudflare deployment logs are available here

@amessbee
Copy link
Contributor

@mujahidkay wondering whether we have any other options to fix #1225 ?

@mujahidkay
Copy link
Member Author

@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.

const __dirname = path.dirname(__filename);

const extractLinks = (content) => {
const linkRegex = /link:\s*'([^']+)'/g;
Copy link
Contributor

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?

Copy link
Member Author

Choose a reason for hiding this comment

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

good catch!

Copy link
Contributor

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?

@mujahidkay mujahidkay marked this pull request as draft October 30, 2024 12:12
@mujahidkay mujahidkay force-pushed the mk/deadlink-checker branch 2 times, most recently from b0fe23f to 9bf48e6 Compare December 23, 2024 12:49
@mujahidkay mujahidkay marked this pull request as ready for review December 23, 2024 13:12
@mujahidkay mujahidkay requested a review from amessbee December 23, 2024 13:12
Copy link
Contributor

@amessbee amessbee left a comment

Choose a reason for hiding this comment

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

lgtm - nice work!

@mujahidkay mujahidkay merged commit e523760 into main Dec 27, 2024
6 checks passed
@mujahidkay mujahidkay deleted the mk/deadlink-checker branch December 27, 2024 07:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Deadlink checker for Navbar/sidebar items
2 participants