Closed decaf-dev closed 3 months ago
This could be part of the "fallback" mechanism?
@moyf
Here is a list of URL's that I think a user could load
//External embed with empty alt text
![](https://example.com/file.jpg)
//External embed with alt text
![cover](https://example.com/file.jpg)
//External embed with no file extension. This is common for some image
//hosting sites
![](https://example.com/file?width=200)
//Internal embed
![[file.jpg]]
//Internal embed with parameter
![[file.jpg|200]]
//Wiki Link
[[file.jpg]]
//Plain url
https://example.com/file.jpg
//Plain url without an image extension
https://example.com/file?width=200
The order that you presented is good, but I think my use case is a little more complex.
- Frontmatter - this is in sequential order
- Specified property
- Wiki Link
- Internal Embed
- External Embed
- Plain URL
- Body - this is in sequential order
- Internal Embed
- External Embed
Do you think users would want to load a plain url from the body for a cover image?
This could be part of the "fallback" mechanism?
Yes, I believe that the selection should be made from top to bottom while respecting the user's preferred order.
For instance, if I configure the settings as "Image Property > URL > First Image in Note" and leave both the image
and url
fields empty, the system should display the first image.
However, if I fill in the url
, the system should display the social media image from that URL, and so on.
Currently, the plugin provides the user with two specific property names: image and url, which I find beneficial:
I believe that these two specific properties are sufficient for my needs. 😊
Do you think users would want to load a plain url from the body for a cover image?
I personally think it's possible, but not necessary.
In my opinion, a certain degree of limitation is necessary, considering that loading all the social media images from links might add extra overhead in terms of performance or storage space...?
But you can always provide this option along with a corresponding checkbox, allowing users who need it to enable it (which may also depend on the development effort required for you to implement this).
It's kind of hard for me to imagine when I would put a plain text image url (http://xxx.jpg) in my note 😂
@Moyf
Okay here's an updated order
image property
(configured in settings)url property
(configured in settings)Wiki link
url
internal embed
external embed
Explanation
image
property in the frontmatter, if configured in the settingsurl
property in the frontmatter, if configured in the settingsSo updating the dropdown image that you posted I would think
And then you could toggle each one on or off, and rearrange.
Does this seem sufficient?
A social media image can be loaded for an external embed or a URL if the link fails to find an image
@Moyf By the way, where did you get the image of the dropdown? Is that an Obsidian plugin?
Implementing fallback logic would a little complex. I am thinking of the case if you have an order like
Let's say I have an URL and a link in the body
If the URL fails to load, it should load the link the body.
I think for me personally, I wouldn't want that. It would be confusing as to where the link is loading from
@Moyf By the way, where did you get the image of the dropdown? Is that an Obsidian plugin?
Oh yes, it's another plugin called Comonents - which is not available in the community plugin store yet. You can find the repo in https://github.com/obsidian-components/obsidian-components-release , where you can download and install the plugin.
However, please note that this is a paid, closed-source plugin, and unfortunately, the author has not provided an English introduction or information on purchasing options outside of China. Here is the Chinese documentation
Additionally, there is a public beta version available for use without payment: https://github.com/obsidian-components/obsidian-components-release/releases/tag/20240423.
sufficient
YEEES, completely satisfied! Thank you very much for your effort!
Implementing fallback logic would a little complex. I am thinking of the case if you have an order like
- Image property
- URL
- First link in frontmatter
- First link in body
Let's say I have an URL and a link in the body
If the URL fails to load, it should load the link the body.
I think for me personally, I wouldn't want that. It would be confusing as to where the link is loading from
Yay, I share the same opinion.
Personally, I believe that the first image in the text should consist of local images only; I would not expect to display images from "normal URLs" 🤔
The url
property in the frontmatter provides more control, allowing me to easily associate the image with its source. However, using links—especially when I have numerous reference links in a note—might not be as intuitive.
@Moyf Added in 1.37.0. Enjoy :)
@Moyf Added in 1.37.0. Enjoy :)
Hooray! You made my day, thank you decaf! 🥳
BTW, could you consider adding more options for cover image detection ?
For example, maybe an array of "cover soure" like..
Cover Source:
Query from top to bottom, displaying the first valid image. If users doesn't want to show any image they can just un-check all of the options. ( but why? 🤔)
And if it can be re-ordered, that would be even better!
Originally posted by @Moyf in https://github.com/decaf-dev/obsidian-vault-explorer/issues/192#issuecomment-2251954136