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

docs: fix references to undefined data variable #22820

Merged
merged 1 commit into from
Apr 6, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 6 additions & 8 deletions docs/tutorial/seo-and-social-sharing-cards-tutorial/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ function SEO({ description, lang, meta }) {
// highlight-start
{
name: "keywords",
content: data.site.siteMetadata.keywords.join(","),
content: site.siteMetadata.keywords.join(","),
},
// highlight-end
]}
Expand Down Expand Up @@ -176,7 +176,7 @@ function SEO({ description, lang, meta, image: metaImage, title }) {
// highlight-start
const image =
metaImage && metaImage.src
? `${data.site.siteMetadata.siteUrl}${metaImage.src}`
? `${site.siteMetadata.siteUrl}${metaImage.src}`
: null
// highlight-end

Expand All @@ -194,7 +194,7 @@ function SEO({ description, lang, meta, image: metaImage, title }) {
},
{
name: "keywords",
content: data.site.siteMetadata.keywords.join(","),
content: site.siteMetadata.keywords.join(","),
},
{
property: `og:title`,
Expand Down Expand Up @@ -318,12 +318,10 @@ function SEO({ description, lang, meta, image: metaImage, title, pathname }) {
const metaDescription = description || site.siteMetadata.description
const image =
metaImage && metaImage.src
? `${data.site.siteMetadata.siteUrl}${metaImage.src}`
? `${site.siteMetadata.siteUrl}${metaImage.src}`
: null
// highlight-start
const canonical = pathname
? `${data.site.siteMetadata.siteUrl}${pathname}`
: null
const canonical = pathname ? `${site.siteMetadata.siteUrl}${pathname}` : null
// highlight-end

return (
Expand Down Expand Up @@ -352,7 +350,7 @@ function SEO({ description, lang, meta, image: metaImage, title, pathname }) {
},
{
name: "keywords",
content: data.site.siteMetadata.keywords.join(","),
content: site.siteMetadata.keywords.join(","),
},
{
property: `og:title`,
Expand Down