You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Relative links with relativepath = false don't work as people would reasonably expect.
Sidebars only work if if paths are set to absolute If they are relative, then the sidebar link is appended to the current page path - which won't work except in the root page.
Relative paths are generally useful in documentation, because they allow you to write that something is in the same current folder, without having to qualify the full path, or is at some position relative to the current path (e.g. down one level). In particular this means that a multilingual sites easier, because the the path doesn't need to be changed for each translation.
Further, if you use relative link syntax in your markdown, people expect it to behave in a certain way because every file manager and web browser interprets the relative path syntax in the same way. Specifically: "../" always means go down one level, "/" always means "from the root", and no preceding path always means "relative to the current folder". When relativepath is set to false, you get completely weird and unexpected behaviour that does not obey these conventions.
The reason this is a problem is that it is good to have relative paths working as expected, but if you do this then it is impossible to use a sidebar. This is because that is also relative to the current page. So that same sidebar which worked for all links on the first page will work for none of them on any other page (because the path is appended to the current page).
What is the expected behaviour
The standard syntax for markdown paths should be respected, as per every other system in the world. If a link is ../ it should always be treated as relative to the current page. It would only be absolute if the path is prefixed by /.
Minimally, the only other way this might work is if the sidebar was fixed to be "absolute".
Other relevant information
Bug does still occur when all/other plugins are disabled?
All of these are irrelevant, though I guess since relativepath=true was supported
Bug Report
relativepath = false
don't work as people would reasonably expect.Steps to reproduce
Any site with a sidebar that uses
https://docsify.js.org/#/configuration?id=relativepath
What is current behaviour
Relative paths are generally useful in documentation, because they allow you to write that something is in the same current folder, without having to qualify the full path, or is at some position relative to the current path (e.g. down one level). In particular this means that a multilingual sites easier, because the the path doesn't need to be changed for each translation.
Further, if you use relative link syntax in your markdown, people expect it to behave in a certain way because every file manager and web browser interprets the relative path syntax in the same way. Specifically: "../" always means go down one level, "/" always means "from the root", and no preceding path always means "relative to the current folder". When relativepath is set to false, you get completely weird and unexpected behaviour that does not obey these conventions.
The reason this is a problem is that it is good to have relative paths working as expected, but if you do this then it is impossible to use a sidebar. This is because that is also relative to the current page. So that same sidebar which worked for all links on the first page will work for none of them on any other page (because the path is appended to the current page).
What is the expected behaviour
The standard syntax for markdown paths should be respected, as per every other system in the world. If a link is
../
it should always be treated as relative to the current page. It would only be absolute if the path is prefixed by /.Minimally, the only other way this might work is if the sidebar was fixed to be "absolute".
Other relevant information
All of these are irrelevant, though I guess since relativepath=true was supported
Please create a reproducible sandbox
I don't understand how to get this sandbox editor to work.
Mention the docsify version in which this bug was not present (if any)
Whenever
The text was updated successfully, but these errors were encountered: