You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardexpand all lines: docs/tutorial/seo-and-social-sharing-cards-tutorial/index.md
+8-8
Original file line number
Diff line number
Diff line change
@@ -44,7 +44,7 @@ Using the power and flexibility of React, you can create a React component to po
44
44
>
45
45
> If you're not using those starters, [follow this guide for installation instructions][gatsby-plugin-react-helmet]
46
46
47
-
```js:title=src/components/seo.js
47
+
```jsx:title=src/components/seo.js
48
48
importReactfrom"react"
49
49
// highlight-start
50
50
importHelmetfrom"react-helmet"
@@ -80,7 +80,7 @@ export default SEO
80
80
81
81
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.
82
82
83
-
```js:title=src/components/seo.js
83
+
```jsx:title=src/components/seo.js
84
84
importReactfrom"react"
85
85
importHelmetfrom"react-helmet"
86
86
import { useStaticQuery, graphql } from"gatsby"
@@ -148,7 +148,7 @@ In addition to SEO for actual _search_ engines you also want those pretty cards
148
148
- Title for embedded results
149
149
- (Optionally) display an image and a card if an image is passed in to the component
150
150
151
-
```js:title=src/components/seo.js
151
+
```jsx:title=src/components/seo.js
152
152
importReactfrom"react"
153
153
importPropTypesfrom"prop-types"// highlight-line
154
154
importHelmetfrom"react-helmet"
@@ -288,10 +288,10 @@ To implement this functionality, you need to do the following:
288
288
289
289
1. Enable passing a `pathname` prop to your SEO component
290
290
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`
292
292
1. Tie into the `link` prop of `react-helmet` to create a `<link rel="canonical" >` tag
293
293
294
-
```js:title=src/components/seo.js
294
+
```jsx:title=src/components/seo.js
295
295
importReactfrom"react"
296
296
importPropTypesfrom"prop-types"
297
297
importHelmetfrom"react-helmet"
@@ -444,7 +444,7 @@ You created an extensible SEO component. It takes a `title` prop and then (optio
0 commit comments