Perlite
Perlite copied to clipboard
Support Graph view when working with multiple Vaults
Describe the bug If I try creating a site that hosts multiple vaults, then the Graph views do not work.
To Reproduce Steps to reproduce the behavior:
- Do not define a
NOTES_PATHvariable. - Have the
Demodirectory inside theperlitedirectory - Have multiple other vaults inside the
perlitedirectory
Expected behavior Graph views for each individual vault when navigating into it.
Desktop (please complete the following information):
- OS: Ubuntu 22/04 LTS
- Browser Chrome
- Version 103
Additional context
I even tried moving the metadata.json file to the root perlite directory when setting up the Demo site. In this case, the Graph only shows the README file. The only time the Graph seems to show is if the Perlite instance is set up to serve only one vault.
Hi @athshean,
Yes, at the moment this won't work because only one metadata.json is supported.
The problem is, that:
- The metadata.json needs to be located in the root of the
NOTES_PATHor perlite folder (if none is defined). - Because of the relative paths in the metadata.json, the file needs to be in the root folder of the vault.
Example 1 (no vault defined):
-perlite --metadata.json --test.md --test2.md
Example 2 (vault1 defined) -perlite --vault1 ---metadata.json ---test.md ---test2.md
What should work is: copy the contents of all your vaults into the perlite folder and also merge all the metadata.json files into one that you provide in the perlite folder. Then Perlite will act like a "vault" and the graph should work.
If you want to keep your vault root folders for the structure and menu as well, you will need to adjust/expand the contents of each metadata.json vault to include the vault name before each relativePath key, you will also need to add another ../ before each displayText key. A simple Python script should automate this task.
To get the demo graph working without defining a NOTES_PATH, you can copy the contents of the demo folder to the perlite folder, provide the metadata.json in the Perlite folder as well, and the graph should work.
So this is not a bug, it's just not implemented yet... I will think about it, maybe i can implement it in the future.
BR, Sec77