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

feat(open_graph): different URLs for og:image and twitter:image #4748

Merged
merged 1 commit into from
Sep 22, 2021
Merged

feat(open_graph): different URLs for og:image and twitter:image #4748

merged 1 commit into from
Sep 22, 2021

Conversation

KentarouTakeda
Copy link
Contributor

@KentarouTakeda KentarouTakeda commented Aug 1, 2021

What does it do?

Fixed to be able to set different URLs for og:image and twitter:image.

Motivation

There is no aspect ratio specification in og:image.

On the other hand, twitter:image has an aspect ratio regulation according to the value of twitter:card.

  • summary_large_image

    Images for this Card support an aspect ratio of 2:1 with minimum dimensions of 300x157 or maximum of 4096x4096 pixels.

  • summary

    Images for this Card support an aspect ratio of 1:1 with minimum dimensions of 144x144 or maximum of 4096x4096 pixels.

We want to optimize the image display when an article is shared on SNS. For example, og:image should be set to an image that can be cropped anywhere, and twitter:image should be set to an image optimized for the aspect ratio of the card.

How to test

git clone -b BRANCH https://github.com/USER/hexo.git
cd hexo
npm install
npm test

Screenshots

Pull request tasks

  • Add test cases for the changes.
  • Passed the CI test.

@coveralls
Copy link

coveralls commented Aug 1, 2021

Coverage Status

Coverage increased (+0.002%) to 98.284% when pulling 2f1399a on KentarouTakeda:different-urls-for-ogimage-and-twitterimage into 042f862 on hexojs:master.

@SukkaW SukkaW merged commit a2ec6b2 into hexojs:master Sep 22, 2021
@KentarouTakeda
Copy link
Contributor Author

@tomap @SukkaW
Thank you for review and merge!!

@KentarouTakeda KentarouTakeda deleted the different-urls-for-ogimage-and-twitterimage branch September 24, 2021 15:07
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

Successfully merging this pull request may close these issues.

None yet

4 participants