[WIP] Better support for relative links (e.g. download links) for non-markdown files
Summary
Currently, using relative links to non-markdown files are broken and give a 404. This PR addresses this and should fix cases such as described in https://github.com/docsifyjs/docsify/issues/1929 and others.
Related issue, if any:
https://github.com/docsifyjs/docsify/issues/1929
What kind of change does this PR introduce?
- Bugfix
- Refactor
For any code change,
- [ ] Related documentation has been updated, if needed -> Not needed
- [x] Related tests have been added or updated, if needed
Does this PR introduce a breaking change?
No, although there has been some refactoring.
Tested in the following browsers:
- [ ] Chrome
- [x] Firefox
- [ ] Safari
- [ ] Edge
Notes
Relative linked files without extension are still seen as markdown files: I don't know if this is intentional or not, but seems counterintuitive. Better would be to require to link to .md-files with an explicit mention of the .md-extension (e.g. [test](test.md) of [test](./test.md).
The latest updates on your projects. Learn more about Vercel for Git ↗︎
| Name | Status | Preview | Comments | Updated (UTC) |
|---|---|---|---|---|
| docsify-preview | ✅ Ready (Inspect) | Visit Preview | 💬 Add feedback | Nov 23, 2023 9:07pm |
@MartenBE Hey can you add some non-.md files to the Docsify site so that we can manually test as well? (We can view the deployment for the PR for manual test). Once the PR is ready then we can delete them.
I've added some test files, but the latest commits feel "off". It is rather unstable and sometimes seems to cause reload loops and weird behavior. Unfortunately, I am out of my league here as my understanding of docsify is rather superficial. I think the original commit (https://github.com/docsifyjs/docsify/pull/2300/commits/e594e39e8f6b18b892473846bbefb0cc9cabe522) was (although not as architectal "proper" as we would like) more robust, and also uses the same workings as image links.
In the previous months, we have decided to go with MkDocs instead of Docsify due to this bug and other reasons. So I'll probably won't work on this any further.