relative path for link

This post was last updated for 517 days ago, and the information may already be changed

Hi,

Is there a way to use relative path to adress parent folders (in multiple level)?

Can we link to root folder?

It is usefull when we link to things that must not be in Siyuan like programming projects. In my case they are synced through computers but not in the same drive name (C, D, or G depending of the config)

    Welcome to here!

    Here we can learn from each other how to use SiYuan, give feedback and suggestions, and build SiYuan together.

    Signup About
    Please input reply content ...
    • 88250

      Hello, SiYuan is not linked based on the file system, so it can only use the reference method (based on the unique block ID).

      1 Reply
    • zacl
      PRO VIP Warrior Author

      I'm talking about link outside of Siyuan Notes. It can already do absolute link to any folder.

      1 Reply
    • 88250

      Sorry, I misunderstood before. Block hyperlinks (siyuan://) do not support relative paths, only ID positioning.

    • alvorithm via Linux
      VIP Warrior

      Hi @88250 , probably @zacl refers to relative links to arbitrary files in the filesystem.

      The FAQ says only absolute links are supported. But it would be great if SiYuan could support relative links, e.g. to a file file:///home/user/mybooks/fiction/a.pdf as ../../mybooks/fiction/a.pdf, which would help links keep working across devices. Another option is to expand ~ to the user name and interpret links starting with ~ as relative, e.g. ~/mybooks/fiction/a.pdf. Or, perhaps best, let users customize in each SiYuan instance a root for external files, which then can be used for local attachments in place of ~. So ~ (or some other character) would default to $HOME but could be set to e.g. /home/user/syncthing/.

      This feature would go a long way towards making SiYuan the central point for all knowledge management, while keeping files that have specific locations for other reasons (e.g. sharing with 3rd parties) at their respective locations.

      On a related note: in SiYuan 3.1.32 Ctrl-Shift-V is not associated to making an hyperlink from the clipboard content (as described by the FAQ?). Ctrl-K automatically takes the text as target and anchor of a hyperlink, unlike Alt-drag-in, which finds makes the anchor be just the filename, i.e. a.pdf. The FAQ needs updating, and perhaps Ctrl-K can behave like Alt- drag-in when the clipboard contains a file:/// link?

      1 Reply
      2 Operate
      alvorithm updated this reply at 2025-06-22 21:04:40
      alvorithm updated this reply at 2025-06-22 21:04:19
    • 88250

      Relative paths may cause some problems. Since this is not the main development direction at present, we will not invest development resources to solve it for the time being. We hope that community developers can help take a look.

      Ctrl+K still follows the unified anchor text rule (that is, if the anchor text can be obtained, it will be obtained, and if it cannot be obtained, a hyperlink will be used), while Ctrl+Shift+V and Alt+drag are for files, so there will be some differences.