vuepress icon indicating copy to clipboard operation
vuepress copied to clipboard

Optionally make build fail if there are bad links

Open rasapetter opened this issue 7 years ago • 4 comments

Feature request

Make vuepress build fail if any link found in the markdown files is pointing in the wrong direction. Checking external URLs would be painful, so my suggestion is we would only check links pointing to other pages in the same vuepress instance (I've noticed that there is already a link checker in place for when you run vuepress dev).

What problem does this feature solve?

This would prevent people from accidentally introducing dead links into their docs.

What does the proposed API look like?

It should probably be opt-in (at least to start with), so perhaps something like vuepress build --validate-links

How should this be implemented in your opinion?

Are you willing to work on this yourself?**

Sure. Some pointers would be appreciated.

rasapetter avatar Dec 10 '18 10:12 rasapetter

Actually VuePress has wrong-link check, so could you provide a reproduction repo?

ulivz avatar Dec 12 '18 16:12 ulivz

Hello @ulivz This feature seems to be down since v1.0.0-alpha*. I've just ran a build with an intentionally broken link inside a page and the whole process just went fine. The whole thing got built with the broken link inside the page.

I've set up a reproduction repository here https://github.com/kuzzleio/documentation/tree/broken-link-test

You can access the page with the broken link here https://github.com/kuzzleio/documentation/blob/broken-link-test/src/core/1/guide/guides/getting-started/first-steps/index.md

xbill82 avatar May 23 '19 15:05 xbill82

In addition to this, we made a broken link checker that made this build fail https://travis-ci.org/kuzzleio/documentation/jobs/551834013

@ulivz I guess this can be considered a valid reproduction repo so it would be appropriate to take the "need reproduction repo" label out.

xbill82 avatar Jul 01 '19 06:07 xbill82

I believe this issue still exists in the latest 2.x...

hybridherbst avatar Feb 04 '25 14:02 hybridherbst