docsifyjs / docsify

🃏 A magical documentation site generator.
https://docsify.js.org
MIT License
27.47k stars 5.67k forks source link

[WIP] Better support for relative links (e.g. download links) for non-markdown files #2300

Open MartenBE opened 10 months ago

MartenBE commented 10 months ago

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?

For any code change,

Does this PR introduce a breaking change?

No, although there has been some refactoring.

Tested in the following browsers:

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).

vercel[bot] commented 10 months ago

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
trusktr commented 10 months ago

@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.

MartenBE commented 10 months ago

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.

MartenBE commented 5 months ago

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.