Skip to content

Commit

Permalink
Page: publisher seemed to confuse Google's structured data
Browse files Browse the repository at this point in the history
  • Loading branch information
Gnito committed Feb 7, 2023
1 parent 77d2348 commit a2e2697
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions src/components/Page/Page.js
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,8 @@ class PageComponent extends Component {
// Schema attribute can be either single schema object or an array of objects
// This makes it possible to include several different items from the same page.
// E.g. Product, Place, Video
const schemaFromProps = Array.isArray(schema) ? schema : [schema];
const hasSchema = schema != null;
const schemaFromProps = hasSchema && Array.isArray(schema) ? schema : hasSchema ? [schema] : [];
const schemaArrayJSONString = JSON.stringify([
...schemaFromProps,
{
Expand All @@ -181,9 +182,6 @@ class PageComponent extends Component {
url: canonicalRootURL,
description: schemaDescription,
name: schemaTitle,
publisher: {
'@id': `${canonicalRootURL}#organization`,
},
},
]);

Expand Down

0 comments on commit a2e2697

Please sign in to comment.