Using Local Images as Cover

Things I have tried

  • I have tried concatenating how a normal image embed works in Obsidian markdown
  • Reading through dataview reference documentation

What I’m trying to do

There are a lot of people embedding an image into their dataview tables by using a URL in the frontmatter as follows:

table Author, ("![coverimg|100](" + Cover + ")") as Cover

However, I wish to use a file that is added to my Obsidian library (the attachment that gets auto-sorted to your chosen attachments folder when you drag and drop). This would allow a more permanent picture without having to upload to imgur or hotlink to a URL that could eventually break.

Thank you The Buccaneers Bounty for introducing me to DataView and all the neat stuff that Obsidian is capable of.

1 Like

As I mentioned in other post, for images I use a frontmatter field with link to local files:

Cover: <img width="150px" src="file:///Users/..../image.jpg">

With this you just need to add the field “Cover” in the table:

table Author, Cover
3 Likes

Thanks for Introducing that blogpost.

1 Like

I believe this will work! Although I do use Google Drive + RClone to sync my Obsidian between my Windows battlestation and Zorin OS (Ubuntu) laptop. So I am imaging there will be issues with a static path since the file paths would be different due to the really different systems. I will try to make your suggestion work with a relative path when I get a chance. Thank you for the reply!

Did you get this working with a relative path? I’m in the same position as you with different OS:es.

1 Like

I need to create a link to an attachment in the vault rather than in a URL to a local drive. The problem is when I am on my phone I can not see any of the images because the URL link is to a C drive o D, my phone doesnt work that way. I would use something like <vault=file1.png>

1 Like

Still looking for a solution

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.