Skip to content

Commit 6f17ac8

Browse files
author
Marcy Sutton
authored
fix: social sharing for blog posts (#22535)
* use lg. social image for twitter, other platforms * chore: remove extra TOC from gatsby-image doc * keep resize for backcompat, downsize img to 1500
1 parent f252dda commit 6f17ac8

File tree

4 files changed

+5
-13
lines changed

4 files changed

+5
-13
lines changed
Loading

docs/blog/2020-03-23-introducing-gatsby-web-creators/index.md

+2-1
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,9 @@
22
title: Introducing Gatsby Web Creators
33
date: 2020-03-23
44
author: "Marcy Sutton"
5-
image: "images/abstract-social-sq.png"
5+
image: "images/gatsby-web-creators.jpg"
66
imageTitle: Calling curious and creative people
7+
twittercard: "summary_large_image"
78
showImageInArticle: false
89
excerpt: "Gatsby Web Creators is a free livestream series aimed at curious people aged 13 and up, starting Wednesday, March 25. Twice a week for the next 5 weeks, Gatsby Learning Team members and their special guests will teach the basic skills involved for creating web pages, starting with HTML and CSS, and gradually building up to JavaScript."
910
tags:

docs/docs/gatsby-image.md

-11
Original file line numberDiff line numberDiff line change
@@ -8,17 +8,6 @@ Part of what makes Gatsby sites so fast is its recommended approach to handling
88
99
Demo: [https://using-gatsby-image.gatsbyjs.org/](https://using-gatsby-image.gatsbyjs.org/)
1010

11-
## In this doc
12-
13-
- [Setting up Gatsby Image](#setting-up-gatsby-image)
14-
- [Types of images with gatsby-image](#types-of-images-with-gatsby-image)
15-
- [Fixed images and parameters](#images-with-a-fixed-width-and-height)
16-
- [Fluid images and parameters](#images-that-stretch-across-a-fluid-container)
17-
- [Resized images](#resized-images)
18-
- [Shared query parameters](#shared-query-parameters)
19-
- [Image query fragments](#image-query-fragments)
20-
- [Gatsby Image props](#gatsby-image-props)
21-
2211
## Setting up Gatsby Image
2312

2413
To start working with Gatsby Image, install the `gatsby-image` package along with necessary plugins `gatsby-transformer-sharp` and `gatsby-plugin-sharp`. Reference the packages in your `gatsby-config.js` file. You can also provide additional options to [`gatsby-plugin-sharp`](/packages/gatsby-plugin-sharp/) in your config file.

www/src/templates/template-blog-post.js

+3-1
Original file line numberDiff line numberDiff line change
@@ -64,8 +64,9 @@ class BlogPostTemplate extends React.Component {
6464
/>
6565
<meta name="description" content={post.fields.excerpt} />
6666

67-
<meta property="og:description" content={post.fields.excerpt} />
6867
<meta name="twitter:description" content={post.fields.excerpt} />
68+
<meta name="twitter:card" content={post.frontmatter.twittercard || 'summary'} />
69+
<meta property="og:description" content={post.fields.excerpt} />
6970
<meta property="og:title" content={post.frontmatter.title} />
7071
<meta property="og:url" content={href} />
7172
{post.frontmatter.image && (
@@ -260,6 +261,7 @@ export const pageQuery = graphql`
260261
imageAuthorLink
261262
imageTitle
262263
showImageInArticle
264+
twittercard
263265
author {
264266
id
265267
bio

0 commit comments

Comments
 (0)