lucaorio / obsidian-image-gallery

A zero setup masonry image gallery for Obsidian
MIT License
186 stars 14 forks source link

Support relative paths #17

Open shayded-exe opened 1 year ago

shayded-exe commented 1 year ago

I use folder notes for my galleries. I would like to be able to generate a gallery from all images in the current folder.

Currently, if I move a folder, I have to manually update the gallery paths.

roadscape commented 1 year ago

I would love to see support for relative paths as well. It would be great to be able to do something like:

path: ./screenshots/
type: vertical
kuzmandi commented 1 year ago

This feature would help me a lot +1

pdolezal commented 1 year ago

A second to that. Relative links would be absolute great. Obsidian is still not very good with relative links, but each improvement that eases the pain is welcome.

Actually, not being able to have the links relative significantly limits my use of this plugin.

nodegraphics commented 4 months ago

This is very helpful for long term usage...

theebio commented 3 months ago

if you are still looking for relative path for this I needed it for my vault and got it working well enough. Here is the changes to the main.ts file in the .obsidian/plugins folder

replace: settings.path = (0, import_obsidian2.normalizePath)(settingsSrc.path);

with: const currentFilePath = this.app.workspace.getActiveFile().path; const currentDir = currentFilePath.substring(0, currentFilePath.lastIndexOf('/')); settings.path = import_obsidian2.normalizePath(currentDir + "/" + settingsSrc.path);