Skip to content

Commit 08503a8

Browse files
authored
Make og:type article for markdown pages (#3146) (#3147)
1 parent c89c382 commit 08503a8

File tree

2 files changed

+9
-2
lines changed

2 files changed

+9
-2
lines changed

src/components/MarkdownPage/MarkdownPage.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,7 @@ const MarkdownPage = ({
7474
}}>
7575
<TitleAndMetaTags
7676
ogDescription={ogDescription}
77+
ogType="article"
7778
canonicalUrl={createCanonicalUrl(markdownRemark.fields.slug)}
7879
title={`${titlePrefix}${titlePostfix}`}
7980
/>

src/components/TitleAndMetaTags/TitleAndMetaTags.js

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ type Props = {
1717
title: string,
1818
ogDescription: string,
1919
canonicalUrl: string,
20+
ogType: string,
2021
};
2122

2223
// only provide alternate links to pages in languages where 95-100% of core content has been translated
@@ -45,11 +46,16 @@ const defaultPage = canonicalUrl => {
4546
return canonicalUrl.replace(urlRoot, 'https://reactjs.org');
4647
};
4748

48-
const TitleAndMetaTags = ({title, ogDescription, canonicalUrl}: Props) => {
49+
const TitleAndMetaTags = ({
50+
title,
51+
ogDescription,
52+
canonicalUrl,
53+
ogType = 'website',
54+
}: Props) => {
4955
return (
5056
<Helmet title={title}>
5157
<meta property="og:title" content={title} />
52-
<meta property="og:type" content="website" />
58+
<meta property="og:type" content={ogType} />
5359
{canonicalUrl && <meta property="og:url" content={canonicalUrl} />}
5460
<meta property="og:image" content="https://reactjs.org/logo-og.png" />
5561
<meta

0 commit comments

Comments
 (0)