hbstack / bigger-picture

HB Bigger Picture Module
https://hbstack.dev/
MIT License
1 stars 1 forks source link

can you please add sharing options when an image is clicked on ?( now we only have download and close) #14

Closed heitumo closed 1 year ago

heitumo commented 1 year ago
image

Maybe we can have options of sharing the image to twitter/wechat/weibo/FB/ins ? Thank you again.

razonyang commented 1 year ago

Didn't have experience about sharing images, could you please explain it in detail?

  1. Which URL should be used as the share link?
  2. What do you expect when clicking the share link?

Please note that there aren't pages for a single image, they are belonged to the posts or albums.

heitumo commented 1 year ago
  1. when we want to share image

we could just share the URL of https://hb-theme.hugomods.com/en/blog/2023/03/tutorial/

  1. Expect when clicking the share link, it could be just the post link that displays the image OR the link of the image. ( maybe sharing the post link is a better way to go since it include the image and the content)

Found Hugo + photo swipe

image image

this is achievable with Hugo and photoswipe (https://www.liwen.id.au/heg/) and beautifulhugo themes Thank you for the quick response.

razonyang commented 1 year ago

The example of liwen, it doesn't display the image I want to share (uses Logo instead). Is that expected?

You could share the image to tweet and see what's happen.

razonyang commented 1 year ago

Just did some research, I think it's impossible.

For example, the twitter cards use page's twitter:image meta tag.

See https://developer.twitter.com/en/docs/twitter-for-websites/cards/overview/summary-card-with-large-image.

But we won't/unable to generate pages for every single image, so when we're sharing the image, the post's thumbnail instead of the one we want to share will be shown.

EDIT: That makes sense for featured image only, since the featured image will be shown, there will be no ambiguity.

heitumo commented 1 year ago

Just did some research, I think it's impossible.

For example, the twitter cards use page's twitter:image meta tag.

See https://developer.twitter.com/en/docs/twitter-for-websites/cards/overview/summary-card-with-large-image.

But we won't/unable to generate pages for every single image, so when we're sharing the image, the post's thumbnail instead of the one we want to share will be shown.

EDIT: That makes sense for featured image only, since the featured image will be shown, there will be no ambiguity.

yes, even for Gallery images, we can show featured images? Not sure how it works under the hood comparing to featured image of a post, but an image is better than no image Thank you.

razonyang commented 1 year ago

we can show featured images?

Yes, it's implemented already, except the share button, you'll see the featured image when you tweet the post manually.

It may take time to implement, need to modularize this functionality, so that it can be reused in other places (not for image viewer only, the share button could be placed in content panel next or above/below the post content).

I couldn't give ETA, I'll start on it after finishing the docs.

razonyang commented 1 year ago

Implemented by #16, see https://hbstack.dev/en/docs/modules/gallery/overview/#album-social-share-image for detail.

hugo mod get github.com/hbstack/bigger-picture@v0.8.0

Preview: https://theme.hbstack.dev/en/gallery/sunrise/

Thanks for your idea.