obsidian-folder-note-plugin
obsidian-folder-note-plugin copied to clipboard
After renaming the folder, backlinks to the folder note are not updated automatically
Following is the initial setup.
.../some.md [[Note 1]]
Note 1/ Note 1.md
Then I change the folder from Note 1 to Note 2. As expected, Note 1.md is auto renamed to Note 2.md. But [[Note 1]] inside some.md stayed the same instead of being updated to [[Note 2]]. So we end up with an inconsistent situation.
Thanks for the information. Yes, there are some renaming issues need to be addressed in the future. Do you use the outside folder note mode? If so, you can try to change the Note 1.md's title to Note 2, then, the folder name will be changed to be Note 2, and the link in some.md will be changed to [[Note 2]]
My experience is very similar. I find the root cause, although I am not able to solve it now.
I use absolute link and "inside folder note mode". My setting is
.../some.md
[[Note 1/Note 1.md]]
Note 1/
Note 1.md
After renaming "Note 1" folder to "Note 2", the "Note 1.md" automatically rename to "Note 2.md", which is great.
However, the link is [[Note 2/Note 1.md]]
.
I debug a little and find the reason is vault.rename
doesn't trigger link update. I believe this is an Obsidian bug, I have reported it at Vault.rename(file, path) doesn’t trigger link update. Hope it get solved soon.
@xpgo , I have found the solution to this problem. As pointed out in link Vault.rename(file, path) doesn't trigger link update - Developers & API - Obsidian Forum, API "renameFile" will rename and update links.
I have tried the API this.app.fileManager.renameFile(this.app.vault.getAbstractFileByPath("abc/abc.md"), "abc/abc2.md")
and it works. I think using this API could fix this bug. May I know whether you prefer me to send a PR or you'd fix it by yourself?
Just find alx-folder-note which is a fork and rewrite of folder-note
. It solves the renaming problem.