Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Help with rendering images within ObsidianVault #190

Open
exosyphon opened this issue Jul 1, 2024 · 2 comments
Open

Help with rendering images within ObsidianVault #190

exosyphon opened this issue Jul 1, 2024 · 2 comments

Comments

@exosyphon
Copy link

Hi, thank you for all your work in getting images inside of Neovim. I am really excited to try and get this working.

I am able to use the minimal setup and also configured my setup to work with this style image:

This is a remote image

Inside of my ObsidianVault, I have an Attachments folder at the root where all of my images are stored.

How can I configure image.nvim to look in this directory when it sees something like this?

![[Test.png]]

I am probably missing something obvious or unsure how to configure resolve_image_path to make this work.

Thank you again for your time and work on this plugin!

@3rd
Copy link
Owner

3rd commented Jul 1, 2024

Hey, we could probably add a hook for the Markdown integration, it must be trying to load the image from the same directory as the document when it should search for it in a special place. You can patch it in the markdown integration meanwhile.

@exosyphon
Copy link
Author

Will do. Here's what I have hard coded and got it to render correctly.

          elseif current_image and key == "url" then
            current_image.url = "~/Documents/ObsidianVault/Attachments/" .. value
            table.insert(images, current_image)
            current_image = nil
          end

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants