David Barratt
5 years ago
committed by
GitHub
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with
9 additions and
2 deletions
-
src/components/MarkdownPage/MarkdownPage.js
-
src/components/TitleAndMetaTags/TitleAndMetaTags.js
|
|
@ -74,6 +74,7 @@ const MarkdownPage = ({ |
|
|
|
}}> |
|
|
|
<TitleAndMetaTags |
|
|
|
ogDescription={ogDescription} |
|
|
|
ogType="article" |
|
|
|
canonicalUrl={createCanonicalUrl(markdownRemark.fields.slug)} |
|
|
|
title={`${titlePrefix}${titlePostfix}`} |
|
|
|
/> |
|
|
|
|
|
@ -17,6 +17,7 @@ type Props = { |
|
|
|
title: string, |
|
|
|
ogDescription: string, |
|
|
|
canonicalUrl: string, |
|
|
|
ogType: string, |
|
|
|
}; |
|
|
|
|
|
|
|
// only provide alternate links to pages in languages where 95-100% of core content has been translated
|
|
|
@ -45,11 +46,16 @@ const defaultPage = canonicalUrl => { |
|
|
|
return canonicalUrl.replace(urlRoot, 'https://reactjs.org'); |
|
|
|
}; |
|
|
|
|
|
|
|
const TitleAndMetaTags = ({title, ogDescription, canonicalUrl}: Props) => { |
|
|
|
const TitleAndMetaTags = ({ |
|
|
|
title, |
|
|
|
ogDescription, |
|
|
|
canonicalUrl, |
|
|
|
ogType = 'website', |
|
|
|
}: Props) => { |
|
|
|
return ( |
|
|
|
<Helmet title={title}> |
|
|
|
<meta property="og:title" content={title} /> |
|
|
|
<meta property="og:type" content="website" /> |
|
|
|
<meta property="og:type" content={ogType} /> |
|
|
|
{canonicalUrl && <meta property="og:url" content={canonicalUrl} />} |
|
|
|
<meta property="og:image" content="https://reactjs.org/logo-og.png" /> |
|
|
|
<meta |
|
|
|