Skip to content

fix(v2): brokenLinks should not report links that belong to an existing folder if folder/index.html exists - #3308

Merged
slorber merged 2 commits into
masterfrom
slorber/broken-links-handle-dir
Aug 19, 2020
Merged

slorber merged 2 commits into
masterfrom
slorber/broken-links-handle-dir

Conversation

@slorber

@slorber slorber commented Aug 19, 2020

Copy link
Copy Markdown
Collaborator

Motivation

#3303

Let's consider the static folder:

image

We should be able to link to the /javadoc, and despite not being an SPA link, it should not be reported as a broken link.

Test Plan

Unit tests + test on Docusaurus website

[javadoc](/javadoc)

[javadoc](/javadoc/)

[javadoc](/javadoc/index)

[javadoc](/javadoc/index.html)

[javadoc](/javadoc/hey)

[javadoc](/javadoc/hey.html)

[javadoc](/javadoc/bad)

[javadoc](/bad)

[javadoc](/bad/)

Lead to the expected result:

image

And we don't report anymore the good javadoc paths

@slorber
slorber requested a review from yangshun as a code owner August 19, 2020 16:21
@facebook-github-bot facebook-github-bot added the CLA Signed Signed Facebook CLA label Aug 19, 2020
@slorber slorber added pr: bug fix This PR fixes a bug in a past release. and removed CLA Signed Signed Facebook CLA labels Aug 19, 2020
@slorber slorber linked an issue Aug 19, 2020 that may be closed by this pull request
@docusaurus-bot

Copy link
Copy Markdown
Contributor

@slorber
slorber merged commit f4ca61b into master Aug 19, 2020
@yangshun
yangshun deleted the slorber/broken-links-handle-dir branch August 26, 2020 01:59
mrizwanashiq pushed a commit to mrizwanashiq/docusaurus that referenced this pull request Jun 25, 2026
…ng folder if folder/index.html exists (meta#3308)

* move pluginIds.test.ts

* improve brokenLinks checker and add tests for filterExistingFileLinks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

pr: bug fix This PR fixes a bug in a past release.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Links validation failures after updating to 2.0.0-alpha.61

3 participants