Skip to content

Commit

Permalink
Page: rename contentType as openGraphType
Browse files Browse the repository at this point in the history
  • Loading branch information
Gnito committed Feb 7, 2023
1 parent 162bed8 commit bdce95d
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 10 deletions.
8 changes: 4 additions & 4 deletions src/components/Page/Page.js
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ class PageComponent extends Component {
scrollingDisabled,
referrer,
author,
contentType,
openGraphType,
description,
facebookImages,
published,
Expand Down Expand Up @@ -126,8 +126,8 @@ class PageComponent extends Component {

const metaToHead = metaTagProps({
author,
contentType,
description: metaDescription,
openGraphType,
facebookImages: facebookImgs,
twitterImages: twitterImgs,
published,
Expand Down Expand Up @@ -231,7 +231,7 @@ PageComponent.defaultProps = {
rootClassName: null,
children: null,
author: null,
contentType: 'website',
openGraphType: 'website',
description: null,
facebookImages: null,
twitterImages: null,
Expand All @@ -254,7 +254,7 @@ PageComponent.propTypes = {

// SEO related props
author: string,
contentType: string, // og:type
openGraphType: string, // og:type
description: string, // page description
facebookImages: arrayOf(
shape({
Expand Down
1 change: 0 additions & 1 deletion src/containers/ListingPage/ListingPage.js
Original file line number Diff line number Diff line change
Expand Up @@ -391,7 +391,6 @@ export class ListingPageComponent extends Component {
title={schemaTitle}
scrollingDisabled={scrollingDisabled}
author={authorDisplayName}
contentType="website"
description={description}
facebookImages={facebookImages}
twitterImages={twitterImages}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
exports[`ListingPage matches snapshot 1`] = `
<Page
author="user-1 display name"
contentType="website"
description="listing1 description"
facebookImages={Array []}
schema={
Expand Down
8 changes: 4 additions & 4 deletions src/util/seo.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@ const ensureOpenGraphLocale = locale => {
export const openGraphMetaProps = data => {
const {
canonicalRootURL,
contentType,
description,
openGraphType,
facebookAppId,
facebookImages,
locale,
Expand All @@ -28,12 +28,12 @@ export const openGraphMetaProps = data => {
url,
} = data;

if (!(title && description && contentType && url && facebookImages && canonicalRootURL)) {
if (!(title && description && openGraphType && url && facebookImages && canonicalRootURL)) {
/* eslint-disable no-console */
if (console && console.warn) {
console.warn(
`Can't create Open Graph meta tags:
title, description, contentType, url, facebookImages, and canonicalRootURL are needed.`
title, description, openGraphType, url, facebookImages, and canonicalRootURL are needed.`
);
}
/* eslint-enable no-console */
Expand All @@ -43,7 +43,7 @@ export const openGraphMetaProps = data => {
const openGraphMeta = [
{ property: 'og:description', content: description },
{ property: 'og:title', content: title },
{ property: 'og:type', content: contentType },
{ property: 'og:type', content: openGraphType },
{ property: 'og:url', content: url },
{ property: 'og:locale', content: ensureOpenGraphLocale(locale) },
];
Expand Down

0 comments on commit bdce95d

Please sign in to comment.