Comments (6)
Just saw the note about adding .md extensions. I'll use that. Thank you
from docusaurus.
Despite the error saying it was resolved as /cool-page it is in fact not.
There is nothing at /cool-page
. For your link to work, it must be resolved as /docs/cool-page
.
And trailingSlash has an impact on relative link resolution.
I'm sorry but your sandbox does not match your text description, which makes things confusing. Please try again by having the text and the sandbox being in sync.
For example your sandbox is using a relative path link (which we don't recommend because it's sensitive to trailingSlash setting changes)
[Cool page](../test2/cool-page)
While your text is using a relative reference to a markdown file
[Cool page](../cool-page.md)
Those 2 are not the same at all, and will not resolve the same.
Most likely it's a mistake on your side, so I'm closing as can't repro. The behavior you see in your sandbox is the expected behavior.
from docusaurus.
The bug works the same regardless of the location of the page being linked. However, I've updated my repro to match the bug /exactly/.
from docusaurus.
I'm not sure if you expect me to do something, your sandbox now includes many other broken links due to removing other md files.
[Cool page](../cool-page)
[Cool page](../cool-page.md)
The 1st doesn't work, and it's expected because ../cool-page
resolved from /docs/test
resolves as /cool-page
, a path that does not exist
The 2nd work because it's resolved as /test/cool-page
, that exists.
I maintain that all this works as intended. If you still believe otherwise please create a minimal repro showing a single broken link being reported and explain why you think the error is a false positive.
Also make sure to properly understand how relative links work on the web (this is not a Docusaurus feature, it is how regular html pages and browsers work, we use the same resolution algo).
Also make sure to read that doc:
from docusaurus.
I'm still seeing this bug if an image links to a markdown file. This fails claiming the link is broken: [![Cool Page](https://docusaurus.io/img/docusaurus.svg)](../cool-page.md)
:
Exhaustive list of all broken links found:
- Broken link on source page path = /docs/test:
-> linking to ../cool-page.md (resolved as: /cool-page.md)
As soon as I switch it to a text link, it works despite having the same link path.
I've updated the repro project here: https://codesandbox.io/p/devbox/runtime-pine-84xm8d
from docusaurus.
Can confirm the bug, related to resolving relative file paths when using an image.
Can reproduce this on our own website:
[text](./installation.mdx)
[![alt](/img/slash-introducing.svg)](./installation.mdx)
Only the first link resolves.
Definitively a bug. Track #9048 for the root cause and the solution. We can keep this issue closed.
from docusaurus.
Related Issues (20)
- MDX fails building website when using a <code> inside of a <TabItem> element HOT 3
- 'baseUrl' is ignored in Production routing HOT 5
- Error when importing Docusaurus Swizzle component into Netlify CMS HOT 1
- Allow `tags` in `generated-index` sidebar item HOT 4
- MDX v3.0.1 fails to import <details> HOT 7
- Tabs not working on Docusaurus Static build HOT 5
- Doesn't support protocol-relative URL's HOT 1
- Layout moves around when switching tabs (scroll position issue) HOT 2
- Scripts in head don't load from component on production HOT 2
- The htmlLang setting in the localeConfigs of i18n is invalid, and the source code remains as en HOT 5
- Pages do not support Markdown "file path" links HOT 6
- navigation to '/index.html' with a static web server duplicates the page's content. HOT 2
- Broken link found where it should not on relative (same folder) link HOT 6
- LastUpdateTime and LastUpdateAuthor are not displayed in some documents HOT 2
- onBrokenAnchors reports spurious broken anchors for every page HOT 3
- [Bug]: `Invalid name=docusaurus-plugin-vercel-analytics version number=0.0.0-5831.` HOT 1
- Hydration failed because the initial UI does not match what was rendered on the server. HOT 6
- Dark mode not sticking on Brave Browser HOT 1
- Code block no longer show syntax highlight HOT 8
- how to create code blocks new design HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from docusaurus.