Skip to content
New 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

Weird display of image while sharing blogs on Twitter #356

Closed
utkarsh2102 opened this issue Jun 26, 2020 · 7 comments
Closed

Weird display of image while sharing blogs on Twitter #356

utkarsh2102 opened this issue Jun 26, 2020 · 7 comments

Comments

@utkarsh2102
Copy link
Contributor

image

This looks..bad, I think. I am not sure what renders it likes this because the original image used is really small (see: https://utkarsh2102.com/posts/foss-in-may-20/).

I am not sure what's the fix either. Any ideas?

@utkarsh2102
Copy link
Contributor Author

Maybe something relevant: https://stackoverflow.com/questions/17825195/twitter-share-button-but-with-image
But I am not sure 😅

@luizdepra
Copy link
Owner

Yup! You can tweak that kind of thing with twitter card data.
Hugo already supports it, but this theme yet not. But it is possible to add it.

https://gohugo.io/templates/internal/#twitter-cards

@utkarsh2102
Copy link
Contributor Author

Aha!
Would you be interested to have it here as well?

@luizdepra
Copy link
Owner

Sure, why not? :)

@luizdepra
Copy link
Owner

I'm going to add twitter cards and other kind of social media things into the v2 roadmap.

@pduchnovsky
Copy link
Contributor

pduchnovsky commented Nov 11, 2020

Twitter cards are working fine for me, I only add this to 'header' of new page/post.md and it works:

---
images:
    - /images/something.jpg
---

Or this, depending how do you prefer it :)

+++
images = ["/images/something.jpg"]
+++

As for 'default' twitter card (shown if not specified in post/page, or on homepage), this works in global config:

[params]
    images = ["/images/something.jpg"]

Validated by https://cards-dev.twitter.com/validator
image

If your image is small however, it will cause such issues I guess.. since these images should be at least 640×320px

@luizdepra
Copy link
Owner

I think this is related with the resolution of the image used right? Going to close this issue, but if it still persist let me know.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants