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

Relative docs links are broken in "versioned" docs when building with "skip-next-release" #1805

Closed
amimas opened this issue Oct 1, 2019 · 0 comments · Fixed by #3429
Closed
Labels
bug An error in the Docusaurus core causing instability or issues with its execution v1 This issue is for Docusaurus 1

Comments

@amimas
Copy link

amimas commented Oct 1, 2019

🐛 Bug Report

When the site is built with the option --skip-next-release, relative links from one doc to another in the versioned docs are broken.

Have you read the Contributing Guidelines on issues?

Yes

To Reproduce

(Write your steps here:)

  1. Clone this repository: https://github.com/amimas/docusaurus-bug-broken-link
  2. Run yarn build and observe that there are no build errors
  3. Run yarn build --skip-next-release and observe that there are following warnings about broken relative links:
yarn run v1.12.3
warning package.json: No license field
$ docusaurus-build --skip-next-release
generate.js triggered...
[WARN] unresolved links in file 'version-1.0.0/dir1/dir1-subdir1/doc3.md' > [ '../../doc1.md' ]
[WARN] unresolved links in file 'version-1.0.0/dir1/doc2.md' > [ 'dir1-subdir1/doc3.md' ]
[WARN] unresolved links in file 'version-1.0.0/doc1.md' > [ 'dir1/doc2.md' ]
feed.js triggered...
feed.js triggered...
sitemap.js triggered...
Site built successfully. Generated files in 'build' folder.

Expected behavior

The build would work the same way as it does when --skip-next-release option is not used. The relative links should not be broken.

Actual Behavior

The build produces site with broken links from one doc to another when --skip-next-release option is used. This seems to be isolated to versioned_docs/ only. Looking at the final output, it seems that the generator is not converting markdown links from .md to .html

Reproducible Demo

(Paste the link to an example repo, including a siteConfig.js, and exact instructions to reproduce the issue.)

Reproducible demo can be found here: https://github.com/amimas/docusaurus-bug-broken-link

Please follow the steps mentioned above to see the issue.

parkas2018 added a commit to parkas2018/docusaurus that referenced this issue Oct 8, 2019
…build option

The problem is described in issue facebook#1805 and it seems to have existed for a long time.
Given versioning is enabled and the repository contains versioned docs, if the build
option `--skip-next-release` is used when building the static site, the versioned
docs contains a lot of broken links. The generator is not able to locate the targetted
file for the relative link and so it leaves the html links as ".md" instead of ".html".

The issue appears to be isolated to `website/versioned-docs/` only and only if the above
mentioned build option is used.

This change fixes this issue and allows for generating site with appropriate relative
links.
@endiliey endiliey added the v1 This issue is for Docusaurus 1 label Oct 10, 2019
parkas2018 added a commit to parkas2018/docusaurus that referenced this issue Oct 18, 2019
…build option

The problem is described in issue facebook#1805 and it seems to have existed for a long time.
Given versioning is enabled and the repository contains versioned docs, if the build
option `--skip-next-release` is used when building the static site, the versioned
docs contains a lot of broken links. The generator is not able to locate the targetted
file for the relative link and so it leaves the html links as ".md" instead of ".html".

The issue appears to be isolated to `website/versioned-docs/` only and only if the above
mentioned build option is used.

This change fixes this issue and allows for generating site with appropriate relative
links.
parkas2018 added a commit to parkas2018/docusaurus that referenced this issue Oct 21, 2019
…build option

The problem is described in issue facebook#1805 and it seems to have existed for a long time.
Given versioning is enabled and the repository contains versioned docs, if the build
option `--skip-next-release` is used when building the static site, the versioned
docs contains a lot of broken links. The generator is not able to locate the targetted
file for the relative link and so it leaves the html links as ".md" instead of ".html".

The issue appears to be isolated to `website/versioned-docs/` only and only if the above
mentioned build option is used.

This change fixes this issue and allows for generating site with appropriate relative
links.
parkas2018 added a commit to parkas2018/docusaurus that referenced this issue Oct 31, 2019
…build option

The problem is described in issue facebook#1805 and it seems to have existed for a long time.
Given versioning is enabled and the repository contains versioned docs, if the build
option `--skip-next-release` is used when building the static site, the versioned
docs contains a lot of broken links. The generator is not able to locate the targetted
file for the relative link and so it leaves the html links as ".md" instead of ".html".

The issue appears to be isolated to `website/versioned-docs/` only and only if the above
mentioned build option is used.

This change fixes this issue and allows for generating site with appropriate relative
links.
parkas2018 added a commit to parkas2018/docusaurus that referenced this issue Nov 6, 2019
…build option

The problem is described in issue facebook#1805 and it seems to have existed for a long time.
Given versioning is enabled and the repository contains versioned docs, if the build
option `--skip-next-release` is used when building the static site, the versioned
docs contains a lot of broken links. The generator is not able to locate the targetted
file for the relative link and so it leaves the html links as ".md" instead of ".html".

The issue appears to be isolated to `website/versioned-docs/` only and only if the above
mentioned build option is used.

This change fixes this issue and allows for generating site with appropriate relative
links.
@endiliey endiliey added the bug An error in the Docusaurus core causing instability or issues with its execution label Nov 13, 2019
parkas2018 added a commit to parkas2018/docusaurus that referenced this issue Dec 17, 2019
…build option

The problem is described in issue facebook#1805 and it seems to have existed for a long time.
Given versioning is enabled and the repository contains versioned docs, if the build
option `--skip-next-release` is used when building the static site, the versioned
docs contains a lot of broken links. The generator is not able to locate the targetted
file for the relative link and so it leaves the html links as ".md" instead of ".html".

The issue appears to be isolated to `website/versioned-docs/` only and only if the above
mentioned build option is used.

This change fixes this issue and allows for generating site with appropriate relative
links.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug An error in the Docusaurus core causing instability or issues with its execution v1 This issue is for Docusaurus 1
Projects
None yet
3 participants
@amimas @endiliey and others