Skip to content

Commit 3ef38db

Browse files
mueschagatsbybot
and
gatsbybot
authoredMar 10, 2020
fix (#22104)
Co-authored-by: gatsbybot <mathews.kyle+gatsbybot@gmail.com>
1 parent f04af77 commit 3ef38db

File tree

1 file changed

+8
-8
lines changed
  • docs/tutorial/seo-and-social-sharing-cards-tutorial

1 file changed

+8
-8
lines changed
 

‎docs/tutorial/seo-and-social-sharing-cards-tutorial/index.md

+8-8
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ Using the power and flexibility of React, you can create a React component to po
4444
>
4545
> If you're not using those starters, [follow this guide for installation instructions][gatsby-plugin-react-helmet]
4646
47-
```js:title=src/components/seo.js
47+
```jsx:title=src/components/seo.js
4848
import React from "react"
4949
// highlight-start
5050
import Helmet from "react-helmet"
@@ -80,7 +80,7 @@ export default SEO
8080

8181
This component doesn't _do_ anything yet, but it's the foundation for a useful, extensible component. It leverages the `useStaticQuery` functionality enabled via Gatsby to query siteMetadata (e.g. details in `gatsby-config.js`) with description and keywords. At this point, the `SEO` component returns `null` to render nothing. Next, you will _actually_ render something and build out the prototype for this SEO component.
8282

83-
```js:title=src/components/seo.js
83+
```jsx:title=src/components/seo.js
8484
import React from "react"
8585
import Helmet from "react-helmet"
8686
import { useStaticQuery, graphql } from "gatsby"
@@ -148,7 +148,7 @@ In addition to SEO for actual _search_ engines you also want those pretty cards
148148
- Title for embedded results
149149
- (Optionally) display an image and a card if an image is passed in to the component
150150

151-
```js:title=src/components/seo.js
151+
```jsx:title=src/components/seo.js
152152
import React from "react"
153153
import PropTypes from "prop-types" // highlight-line
154154
import Helmet from "react-helmet"
@@ -288,10 +288,10 @@ To implement this functionality, you need to do the following:
288288

289289
1. Enable passing a `pathname` prop to your SEO component
290290
1. Prefix your `pathname` prop with your `siteUrl` (from `gatsby-config.js`)
291-
- A canonical link should be _absolute_ (e.g. https://your-site.com/canonical-link), so you will need to prefix with this `siteUrl`
291+
- A canonical link should be _absolute_ (e.g. `https://your-site.com/canonical-link`), so you will need to prefix with this `siteUrl`
292292
1. Tie into the `link` prop of `react-helmet` to create a `<link rel="canonical" >` tag
293293

294-
```js:title=src/components/seo.js
294+
```jsx:title=src/components/seo.js
295295
import React from "react"
296296
import PropTypes from "prop-types"
297297
import Helmet from "react-helmet"
@@ -444,7 +444,7 @@ You created an extensible SEO component. It takes a `title` prop and then (optio
444444

445445
### In a page component
446446

447-
```js:title=src/pages/index.js
447+
```jsx:title=src/pages/index.js
448448
import React from "react"
449449

450450
import Layout from "../components/layout"
@@ -477,7 +477,7 @@ mkdir -p content/blog/2019-01-04-hello-world-seo
477477
touch content/blog/2019-01-04-hello-world-seo/index.md
478478
```
479479

480-
```md:title=content/blog/2019-01-04-hello-world-seo/index.md
480+
```markdown:title=content/blog/2019-01-04-hello-world-seo/index.md
481481
---
482482
date: 2019-01-04
483483
featured: images/featured.jpg
@@ -498,7 +498,7 @@ Make sure to use appropriately sized images for social sharing. Facebook and Twi
498498

499499
#### Querying with GraphQL
500500

501-
```js:title=src/templates/blog-post.js
501+
```jsx:title=src/templates/blog-post.js
502502
import React from "react"
503503
import { Link, graphql } from "gatsby"
504504

0 commit comments

Comments
 (0)