mirror of
https://github.com/reactjs/react.dev.git
synced 2026-02-23 20:23:08 +00:00
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user