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

[www/showcase] "Showcase" entry uses square image as meta twitter:image #14469

Closed
fk opened this issue May 31, 2019 · 8 comments · Fixed by #14560
Closed

[www/showcase] "Showcase" entry uses square image as meta twitter:image #14469

fk opened this issue May 31, 2019 · 8 comments · Fixed by #14560
Labels
good first issue Issue that doesn't require previous experience with Gatsby help wanted Issue with a clear description that the community can help with.

Comments

@fk
Copy link
Contributor

fk commented May 31, 2019

E.g. for https://www.gatsbyjs.org/showcase/airbnb.io/ we are setting

as twitter:image.
Let's share the uncropped image instead:

@gatsbyjs gatsbyjs deleted a comment from gatsbot bot May 31, 2019
@wardpeet wardpeet added good first issue Issue that doesn't require previous experience with Gatsby help wanted Issue with a clear description that the community can help with. labels Jun 3, 2019
@odm275
Copy link

odm275 commented Jun 3, 2019

Hey! I'd like to give this a shot if possible.

@odm275
Copy link

odm275 commented Jun 3, 2019

Been trying to get started on this but I'm not exactly sure how. This is my first issue! If you could provide me with some extra context please.

@superhawk610
Copy link
Contributor

@odm275 the React component responsible for rendering the showcase details view can be found in www/src/components/showcase-details here. The meta tags responsible for setting og:image and twitter:image are set by react-helmet via the <Helmet /> component. You should be able to get it from there 😃

@abhijithvijayan
Copy link
Contributor

@superhawk610 How can I run this on dev mode, I tried running gatsby develop under www dir, but that kept on reaching watcher file count limit.

@wardpeet
Copy link
Contributor

wardpeet commented Jun 5, 2019

Watcher issues can be resolved by #11406 (comment).

as @superhawk610 mentioned the code is

<meta
property="og:image"
content={`https://www.gatsbyjs.org${
data.sitesYaml.childScreenshot.screenshotFile
.childImageSharp.resize.src
}`}
/>
<meta
name="twitter:image"
content={`https://www.gatsbyjs.org${
data.sitesYaml.childScreenshot.screenshotFile
.childImageSharp.resize.src
}`}
/>

And I believe we want to change data.sitesYaml.childScreenshot.screenshotFile.childImageSharp.resize.src into data.sitesYaml.childScreenshot.screenshotFile.publicURL

which also means you'll need to add publicURL to our graphql query

screenshotFile {
childImageSharp {
resize(width: 200, height: 200) {
src
}
}
}

@abhijithvijayan
Copy link
Contributor

abhijithvijayan commented Jun 5, 2019

@wardpeet I can take this. I was in fact looking for the original url for the image, as it was not possible to use the image urls from srcset of the main image shown.

@odm275
Copy link

odm275 commented Jun 5, 2019

@superhawk610 Thanks for the clarification! I think I got this.

@fk
Copy link
Contributor Author

fk commented Jun 6, 2019

Sorry for only being able to follow up here today! Thanks for helping out everybody!

@fk fk closed this as completed in #14560 Jun 10, 2019
fk pushed a commit that referenced this issue Jun 10, 2019
* showcase metatag images size fix [#14469]

* Rm `publicURL` from static query

* Pull resized image

* Don't create a square thumbnail, but a 1.91:1 landscape crop

* Tell Twitter to use the `summary_large_image` format

* Provide correct dimensions (`og:image:width/height`)

* Add `og:title`, adjust `<title>`…

…following what we do for starter detail pages (e.g. `/starters/gatsbyjs/gatsby-starter-blog/`)
mxxk pushed a commit to mxxk/gatsby that referenced this issue Jun 21, 2019
* showcase metatag images size fix [gatsbyjs#14469]

* Rm `publicURL` from static query

* Pull resized image

* Don't create a square thumbnail, but a 1.91:1 landscape crop

* Tell Twitter to use the `summary_large_image` format

* Provide correct dimensions (`og:image:width/height`)

* Add `og:title`, adjust `<title>`…

…following what we do for starter detail pages (e.g. `/starters/gatsbyjs/gatsby-starter-blog/`)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue Issue that doesn't require previous experience with Gatsby help wanted Issue with a clear description that the community can help with.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants