blacksmithgu / obsidian-dataview Public
generated from obsidianmd/obsidian-sample-pluginNew 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
Not only elink() but also dynamic image links? #137
Comments
|
Hmm, actually I can probably do that right now. I was looking at general image embedding which is a little more annoying (mainly figuring out how to specify when to embed/when not to embed), but have an explicit function which renders an inline image seems pretty straightforward. |
|
Count me interested ;-) |
|
Been doing a bit of research this morning and found this. I think it's a feature I'd like. Spent the last hour trying to embed an image from yaml frontmatter but it's not working. Best I can do is have the url/source with this: But that gives me this: As I think @Moonbase59 mentioned in one of the forum posts, must be to do with the parsing order or some such. |
|
That specific way to do embeds is unlikely to ever work - Dataview runs after the markdown renderer, so the markdown renderer will never pick up that as an image link. I think this will likely need explicit function support ( |
|
So, tested and this kind of works using dataviewjs, very much based on some of the code that Moonbase put up on the Obsidian forums. I had some issues where the photos would sometimes render, sometimes not. I'm assuming this is again, a render engine issue. Any ideas how to fix this? No console errors or anything. Maybe it's just a matter of opening and closing the note, or refreshing the page. ---
photo_thumbnail: _resources/985D5316-AD96-4673-970B-A7C3366C218C-485-0002EE52E3B1C099.jpg
---Single photo: Loop through a list of photos in the YAML: ---
photos:
- _resources/985D5316-AD96-4673-970B-A7C3366C218C-485-0002EE52E3B1C099.jpg
- _resources/985D5316-AD96-4673-970B-A7C3366C218C-485-0002EE52E3B1C088.jpg
--- |
|
The fact that embeds work at all in Dataview is an Obsidian bug - the markdown renderer that plugins use does not support them at all currently. If you want to hack at it, the best option would be to look at the generated HTML for an image in Obsidian and then replicate that in your script. |
Having
elink()is really useful.Do you think it would be possible to also get something like
ilink()andeilink()in order to dynamically create internal and external image links?Thinking of internal/external images to be shown, based on YAML frontmatter data, like location-based weather images, user avatars or images, etc.
The text was updated successfully, but these errors were encountered: