Skip to content

can i set img_folder separately? #657

Answered by epwalsh
Jaehaks asked this question in Q&A
Discussion options

You must be logged in to vote

Yes to both. You use a note-dependent directory by overriding the image_name_func option:

      image_name_func = function()
        ---@type obsidian.Client
        local client = require("obsidian").get_client()

        local note = client:current_note()
        if note then
          return string.format("%s/", note.id)
        else
          return string.format("%s-", os.time())
        end
      end,

And if you want the folder to be relative to the current note, you could have image_name_func return an absolute path like this:

      image_name_func = function()
        ---@type obsidian.Client
        local client = require("obsidian").get_client()

        local note = client:curr…

Replies: 2 comments 6 replies

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
6 replies
@Jaehaks
Comment options

@epwalsh
Comment options

@Jaehaks
Comment options

@epwalsh
Comment options

@Jaehaks
Comment options

Answer selected by Jaehaks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants