Docusaurus: Detect external broken links on build

Created on 3 Aug 2020  路  6Comments  路  Source: facebook/docusaurus

馃殌 Feature

Partly inspired by #3048, it would be nice to detect external links in the Markdown docs and signal to the user that they are broken.

Ref projects:

Have you read the Contributing Guidelines on issues?

Yes

Motivation

If you want good docs, you probably don't want broken links.

Pitch

We should signal users if any external links are invalid on build.

A by-pass flag would be helpful because there might be cases broken external links are ok (e.g. pages that anticipate a link to become valid later on).

This additional check would be really helpful. I'm suggesting this feature because I am building a docs site on top of Docusaurus and I found a need for this personally. I was actually going to use markdown-link-checker with CI. But if this can be built-in, then it saves a LOT of work.

feature needs triage

All 6 comments

It will increase build time and I think it makes less sense since external link may become dead after the build.

Hi,

That's an interesting feature but I don't think we should make it part of Docusaurus.

This would make the build unstable, slower, dependant of the availability and speed of external link, + as. @anshulrgoyal said they can go offline after the build anyway so you actually prevent nothing.

You definitively can add this easily on your own with the package you linked if you really need this, and we wouldn't really do a better job including this in Docusaurus.

I think that's a fair answer, thanks for taking a look!

NTS: If I ever figure out how to make markdown-link-check work with Docusaurus, I should offer to make additional documentation that shows how to integrate it with Docusaurus' conventions (i.e. ignoring links to internal docs).

@adrianmcli it is very easy to create a new remark plugin for it. I have created one for image and one for assets u can take a look.

Here is my pr for assets check https://github.com/facebook/docusaurus/pull/3096

Was this page helpful?
0 / 5 - 0 ratings

Related issues

MoogyG picture MoogyG  路  3Comments

ericnakagawa picture ericnakagawa  路  3Comments

endiliey picture endiliey  路  3Comments

endiliey picture endiliey  路  3Comments

lex111 picture lex111  路  3Comments