facebook / facebook/docusaurus
Broken relative links in docs and i18n translation
- 主要言語
- TypeScript
- スター
- 66.2k
- フォーク
- 10k
- 平均マージ
- 1日 3時間
- マージ済み PR(30日)
- 52
説明
### Have you read the Contributing Guidelines on issues?
- [x] I have read the [Contributing Guidelines on issues](https://github.com/facebook/docusaurus/blob/main/CONTRIBUTING.md#issues).
### Prerequisites
- [x] I'm using the latest version of Docusaurus.
- [x] I have tried the `npm run clear` or `yarn clear` command.
- [x] I have tried `rm -rf node_modules yarn.lock package-lock.json` and re-installing packages.
- [x] I have tried creating a repro with https://new.docusaurus.io.
- [x] I have read the console error message carefully (if applicable).
### Description
Problem with relative links in docs and i18n translation.
### Reproducible demo
https://trofim24.github.io/
### Steps to reproduce
1. Create a new Docusaurus site with `npx create-docusaurus@latest my-website classic -t` command from [instruction](https://docusaurus.io/docs#fast-track)
2. Go to created folder `cd my-website`
3. Copy only one Markdown file and images use
`mkdir -p i18n/fr/docusaurus-plugin-content-docs/current/tutorial-extras/img`
`cp -r docs/tutorial-extras/img/** i18n/fr/docusaurus-plugin-content-docs/current/tutorial-extras/img`
`cp -r docs/tutorial-extras/translate-your-site.md i18n/fr/docusaurus-plugin-content-docs/current/tutorial-extras`
command from [instruction](https://docusaurus.io/docs/i18n/tutorial#translate-markdown-files)
4. Change docusaurus.config.js. Add 'fr' language to locales from [instruction](https://docusaurus.io/docs/i18n/tutorial#site-configuration) and add a navbar item of type localeDropdown from [instruction](https://docusaurus.io/docs/i18n/tutorial#theme-configuration):
`locales: ['en', 'fr']`
and
`{ type: 'localeDropdown', position: 'left', },`
5. Run build use `npm run build` command from [instruction](https://docusaurus.io/docs/deployment)
Also you can visit my build site to check broken link:
[/fr/docs/tutorial-basics/congratulations](https://trofim24.github.io/fr/docs/tutorial-basics/congratulations)
[broken link](https://trofim24.github.io/fr/docs/tutorial-extras/translate-your-site.md)
### Expected behavior
The build is OK
### Actual behavior
[WARNING] Docusaurus found broken links!
Please check the pages of your site in the list below, and make sure you don't reference any path that does not exist.
Note: it's possible to ignore broken links with the 'onBrokenLinks' Docusaurus configuration, and let the build pass.
Exhaustive list of all broken links found:
- Broken link on source page path = /fr/docs/tutorial-basics/congratulations:
-> linking to ../tutorial-extras/translate-your-site.md (resolved as: /fr/docs/tutorial-extras/translate-your-site.md)
### Your environment
- Public source code: https://github.com/trofim24/my-website
- Public source code of build: https://github.com/trofim24/trofim24.github.io
- Public site URL: https://trofim24.github.io/
- Docusaurus version used: 3.7.0
- Environment name and version (e.g. Chrome 89, Node.js 16.4): Chrome 133.0.6943.54 (Official Build) (x86_64), Node.js v20.18.2
- Operating system and version (e.g. Ubuntu 20.04.2 LTS): MacOS Ventura Version 13.7.2 (22H313)
### Self-service
- [ ] I'd be willing to fix this bug myself.
コントリビューションガイド
評価
この issue はまだ評価されていません。