alangrainger / obsidian-google-photos

Connect to Google Photos from Obsidian
GNU General Public License v3.0
93 stars 5 forks source link

Is it possible to link the thumbnail to Google Photos? #39

Closed kmaustral closed 8 months ago

kmaustral commented 8 months ago

Thank you for the plugin. It adds a lot of value to my daily reviews.

I had assumed that you could click on a thumbnail and open the full photo in Google Photos.

I am using this markdown [![]({{local_thumbnail_link}})]({{google_photo_url})

Can this work in code blocks? If not, would it be possible to link the displayed images to the date in Google Photos?

alangrainger commented 8 months ago

You do click on the thumbnail and it opens the full photo in Google Photos - that's exactly how the plugin currently works.

It's plain Markdown, so it will work like any normal image link works in Obsidian. Therefore it won't work in codeblocks, because codeblocks in Obsidian don't display images.

Can you explain a bit more what is the actual issue, as what you're describing as your desired behaviour is already exactly how it works.

kmaustral commented 8 months ago

Thanks for the reply.

I understand now that the link won't work on the code block. But I can't get it to work on single images with this kind of code:

]({{google_photo_url})

Does that look right?

I'm disabling various other image plugins to see if there is any interference.

Much appreciated,

Kevin

On Sun, 7 Jan 2024 at 20:30, Alan Grainger @.***> wrote:

You do click on the thumbnail and it opens the full photo in Google Photos

  • that's exactly how the plugin currently works.

It's plain Markdown, so it will work like any normal image link works in Obsidian. Therefore it won't work in codeblocks, because codeblocks in Obsidian don't display images.

Can you explain a bit more what is the actual issue, as what you're describing as your desired behaviour is already exactly how it works.

— Reply to this email directly, view it on GitHub https://github.com/alangrainger/obsidian-google-photos/issues/39#issuecomment-1880004600, or unsubscribe https://github.com/notifications/unsubscribe-auth/ARTR6N2KGYOIEMOI7BARJF3YNJTK5AVCNFSM6AAAAABBNQ6J3WVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTQOBQGAYDINRQGA . You are receiving this because you authored the thread.Message ID: @.***>

alangrainger commented 8 months ago

There are a couple of issues with the Markdown you have in your comment:

  1. You're missing the second closing brace } after google_photo_url.
  2. You're missing the opening [ which will turn it into a link.

It should be:

[![](local_file.jpg)](https://remote_link)

The template will be:

[![]({{local_thumbnail_link}})]({{google_photo_url}}) 
kmaustral commented 8 months ago

Many thanks for that. I've corrected the code and it works well now. I don't recall seeing it written like that in the Read Me. It may help to include it.

Your plugin is much appreciated.

alangrainger commented 8 months ago

Probably a good idea to add to the readme, but FYI it's the default text in the settings box. Just delete whatever custom value you added and you'll see this:

image