Skip to content

Commit

Permalink
showcase metatag images size fix [#14469] (#14560)
Browse files Browse the repository at this point in the history
* 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/`)
  • Loading branch information
abhijithvijayan authored and fk committed Jun 10, 2019
1 parent c70420c commit 556b6cf
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 7 deletions.
21 changes: 20 additions & 1 deletion www/src/components/showcase-details.js
Original file line number Diff line number Diff line change
Expand Up @@ -251,7 +251,7 @@ const ShowcaseDetails = ({ parent, data, isModal, categories }) => (
}}
>
<Helmet>
<title>{data.sitesYaml.title}</title>
<title>{data.sitesYaml.title}: Showcase | GatsbyJS</title>
<meta
property="og:image"
content={`https://www.gatsbyjs.org${
Expand All @@ -266,6 +266,25 @@ const ShowcaseDetails = ({ parent, data, isModal, categories }) => (
.childImageSharp.resize.src
}`}
/>
<meta name="twitter:card" content="summary_large_image" />
<meta
name="og:title"
value={`${data.sitesYaml.title}: Showcase | GatsbyJS`}
/>
<meta
property="og:image:width"
content={
data.sitesYaml.childScreenshot.screenshotFile
.childImageSharp.resize.width
}
/>
<meta
property="og:image:height"
content={
data.sitesYaml.childScreenshot.screenshotFile
.childImageSharp.resize.height
}
/>
</Helmet>
<div
css={{
Expand Down
9 changes: 3 additions & 6 deletions www/src/templates/template-showcase-details.js
Original file line number Diff line number Diff line change
Expand Up @@ -111,13 +111,10 @@ export const pageQuery = graphql`
fluid(maxWidth: 700) {
...GatsbyImageSharpFluid_noBase64
}
resize(
width: 1500
height: 1500
cropFocus: CENTER
toFormat: JPG
) {
resize(width: 1200, height: 627, cropFocus: NORTH, toFormat: JPG) {
src
height
width
}
}
}
Expand Down

0 comments on commit 556b6cf

Please sign in to comment.