@quintype/seo 1.46.5-liveblog-schema.2 → 1.46.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -2,6 +2,13 @@
2
2
 
3
3
  All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines.
4
4
 
5
+ ### [1.46.5](https://github.com/quintype/quintype-node-seo/compare/v1.46.4...v1.46.5) (2024-09-25)
6
+
7
+
8
+ ### Bug Fixes
9
+
10
+ * **Liveblog schema:** Remove duplicate keys for author and logo in schema ([#563](https://github.com/quintype/quintype-node-seo/issues/563)) ([9e417b9](https://github.com/quintype/quintype-node-seo/commit/9e417b9adf29e542417e2edb30c37be8ad5300a4))
11
+
5
12
  ### [1.46.4](https://github.com/quintype/quintype-node-seo/compare/v1.46.3...v1.46.4) (2024-08-14)
6
13
 
7
14
  ### [1.46.3](https://github.com/quintype/quintype-node-seo/compare/v1.46.2...v1.46.3) (2024-07-17)
package/dist/index.cjs.js CHANGED
@@ -470,16 +470,10 @@ function getSchemaBlogPosting(card = {}, headline = "", image = "", structuredDa
470
470
  });
471
471
  }
472
472
 
473
- function getSchemaPublisher(organization, orgUrl, includeLogo = true) {
473
+ function getSchemaPublisher(organization, orgUrl) {
474
474
  const id = { id: orgUrl };
475
- const { name, url, logo, sameAs } = organization;
476
- if (includeLogo) {
477
- return {
478
- publisher: Object.assign({}, getSchemaType("Organization"), getSchemaContext, organization, id)
479
- };
480
- }
481
475
  return {
482
- publisher: Object.assign({}, getSchemaType("Organization"), getSchemaContext, { name, url, sameAs }, id)
476
+ publisher: Object.assign({}, getSchemaType("Organization"), getSchemaContext, organization, id)
483
477
  };
484
478
  }
485
479
 
@@ -587,7 +581,7 @@ function imageUrl(publisherConfig, s3Key, width, height) {
587
581
  return `${imageSrc}/${s3Key}?w=${width}&h=${height}&auto=format%2Ccompress&fit=max&enlarge=true`;
588
582
  }
589
583
 
590
- function generateCommonData(structuredData = {}, story = {}, publisherConfig = {}, timezone, includeLogo) {
584
+ function generateCommonData(structuredData = {}, story = {}, publisherConfig = {}, timezone) {
591
585
  const storyUrl = story.url || `${publisherConfig["sketches-host"]}/${story.slug}`;
592
586
  const orgUrl = get__default["default"](structuredData, ["organization", "url"], "");
593
587
  const mainEntityUrl = Object.keys(story).length > 0 && structuredData.storyUrlAsMainEntityUrl ? storyUrl : get__default["default"](structuredData, ["organization", "url"], "");
@@ -598,7 +592,7 @@ function generateCommonData(structuredData = {}, story = {}, publisherConfig = {
598
592
  image: [imageUrl(publisherConfig, story["hero-image-s3-key"], imageWidth, imageHeight)],
599
593
  url: `${publisherConfig["sketches-host"]}/${story.slug}`,
600
594
  datePublished: stripMillisecondsFromTime(new Date(story["first-published-at"]), timezone)
601
- }, getSchemaMainEntityOfPage(mainEntityUrl), getSchemaPublisher(structuredData.organization, orgUrl, includeLogo));
595
+ }, getSchemaMainEntityOfPage(mainEntityUrl), getSchemaPublisher(structuredData.organization, orgUrl));
602
596
  }
603
597
 
604
598
  function authorData(authors = [], authorSchema = [], publisherConfig = {}) {
@@ -639,7 +633,7 @@ function articleSectionObj(story) {
639
633
  }
640
634
  }
641
635
 
642
- function generateArticleData(structuredData = {}, story = {}, publisherConfig = {}, timezone, includeLogo) {
636
+ function generateArticleData(structuredData = {}, story = {}, publisherConfig = {}, timezone) {
643
637
  const metaKeywords = story.seo && story.seo["meta-keywords"] || [];
644
638
  const authors = story.authors && story.authors.length !== 0 ? story.authors : [{ name: story["author-name"] || "" }];
645
639
  const storyKeysPresence = Object.keys(story).length > 0;
@@ -648,7 +642,7 @@ function generateArticleData(structuredData = {}, story = {}, publisherConfig =
648
642
  const storyAccessType = storyAccess(story["access"]);
649
643
  const authorSchema = structuredData.authorSchema && structuredData.authorSchema(story) || [];
650
644
  const isAccessibleForFree = storyAccessType ? {} : { isAccessibleForFree: storyAccessType };
651
- return Object.assign({}, generateCommonData(structuredData, story, publisherConfig, timezone, includeLogo), {
645
+ return Object.assign({}, generateCommonData(structuredData, story, publisherConfig, timezone), {
652
646
  author: authorData(authors, authorSchema, publisherConfig),
653
647
  keywords: metaKeywords.join(","),
654
648
  thumbnailUrl: imageUrl(publisherConfig, story["hero-image-s3-key"], imageWidth, imageHeight),
@@ -962,11 +956,9 @@ function StructuredDataTags({ structuredData = {} }, config, pageType, response
962
956
  const structuredDataTags = get__default["default"](structuredData, ["structuredDataTags"], []);
963
957
 
964
958
  let articleData = {};
965
- let articleDataWithoutLogo = {};
959
+
966
960
  if (!isStructuredDataEmpty) {
967
- const includeLogo = false;
968
- articleData = generateArticleData(structuredData, story, publisherConfig, timezone, includeLogo);
969
- articleDataWithoutLogo = generateArticleData(structuredData, story, publisherConfig, timezone, !includeLogo);
961
+ articleData = generateArticleData(structuredData, story, publisherConfig, timezone);
970
962
  structuredDataTags.map(type => {
971
963
  if (pageType === type) {
972
964
  tags.push(ldJson("Organization", structuredData.organization));
@@ -1033,7 +1025,7 @@ function StructuredDataTags({ structuredData = {} }, config, pageType, response
1033
1025
  }
1034
1026
 
1035
1027
  if (structuredData.enableNewsArticle !== "withoutArticleSchema") {
1036
- return ldJson("Article", articleDataWithoutLogo);
1028
+ return ldJson("Article", articleData);
1037
1029
  }
1038
1030
  return {};
1039
1031
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@quintype/seo",
3
- "version": "1.46.5-liveblog-schema.2",
3
+ "version": "1.46.5",
4
4
  "description": "SEO Modules for Quintype",
5
5
  "main": "dist/index.cjs.js",
6
6
  "repository": "https://github.com/quintype/quintype-node-seo",
@@ -54,16 +54,10 @@ export function getSchemaBlogPosting(
54
54
  });
55
55
  }
56
56
 
57
- export function getSchemaPublisher(organization, orgUrl, includeLogo = true) {
57
+ export function getSchemaPublisher(organization, orgUrl) {
58
58
  const id = { id: orgUrl };
59
- const { name, url, logo, sameAs } = organization;
60
- if (includeLogo) {
61
- return {
62
- publisher: Object.assign({}, getSchemaType("Organization"), getSchemaContext, organization, id),
63
- };
64
- }
65
59
  return {
66
- publisher: Object.assign({}, getSchemaType("Organization"), getSchemaContext, { name, url, sameAs }, id),
60
+ publisher: Object.assign({}, getSchemaType("Organization"), getSchemaContext, organization, id),
67
61
  };
68
62
  }
69
63
 
@@ -38,7 +38,7 @@ function imageUrl(publisherConfig, s3Key, width, height) {
38
38
  return `${imageSrc}/${s3Key}?w=${width}&h=${height}&auto=format%2Ccompress&fit=max&enlarge=true`;
39
39
  }
40
40
 
41
- function generateCommonData(structuredData = {}, story = {}, publisherConfig = {}, timezone, includeLogo) {
41
+ function generateCommonData(structuredData = {}, story = {}, publisherConfig = {}, timezone) {
42
42
  const storyUrl = story.url || `${publisherConfig["sketches-host"]}/${story.slug}`;
43
43
  const orgUrl = get(structuredData, ["organization", "url"], "");
44
44
  const mainEntityUrl =
@@ -56,7 +56,7 @@ function generateCommonData(structuredData = {}, story = {}, publisherConfig = {
56
56
  datePublished: stripMillisecondsFromTime(new Date(story["first-published-at"]), timezone),
57
57
  },
58
58
  getSchemaMainEntityOfPage(mainEntityUrl),
59
- getSchemaPublisher(structuredData.organization, orgUrl, includeLogo)
59
+ getSchemaPublisher(structuredData.organization, orgUrl)
60
60
  );
61
61
  }
62
62
 
@@ -98,7 +98,7 @@ function articleSectionObj(story) {
98
98
  }
99
99
  }
100
100
 
101
- function generateArticleData(structuredData = {}, story = {}, publisherConfig = {}, timezone, includeLogo) {
101
+ function generateArticleData(structuredData = {}, story = {}, publisherConfig = {}, timezone) {
102
102
  const metaKeywords = (story.seo && story.seo["meta-keywords"]) || [];
103
103
  const authors = story.authors && story.authors.length !== 0 ? story.authors : [{ name: story["author-name"] || "" }];
104
104
  const storyKeysPresence = Object.keys(story).length > 0;
@@ -109,7 +109,7 @@ function generateArticleData(structuredData = {}, story = {}, publisherConfig =
109
109
  const isAccessibleForFree = storyAccessType ? {} : { isAccessibleForFree: storyAccessType };
110
110
  return Object.assign(
111
111
  {},
112
- generateCommonData(structuredData, story, publisherConfig, timezone, includeLogo),
112
+ generateCommonData(structuredData, story, publisherConfig, timezone),
113
113
  {
114
114
  author: authorData(authors, authorSchema, publisherConfig),
115
115
  keywords: metaKeywords.join(","),
@@ -466,11 +466,9 @@ export function StructuredDataTags({ structuredData = {} }, config, pageType, re
466
466
  const structuredDataTags = get(structuredData, ["structuredDataTags"], []);
467
467
 
468
468
  let articleData = {};
469
- let articleDataWithoutLogo = {};
469
+
470
470
  if (!isStructuredDataEmpty) {
471
- const includeLogo = false;
472
- articleData = generateArticleData(structuredData, story, publisherConfig, timezone, includeLogo);
473
- articleDataWithoutLogo = generateArticleData(structuredData, story, publisherConfig, timezone, !includeLogo);
471
+ articleData = generateArticleData(structuredData, story, publisherConfig, timezone);
474
472
  structuredDataTags.map((type) => {
475
473
  if (pageType === type) {
476
474
  tags.push(ldJson("Organization", structuredData.organization));
@@ -543,7 +541,7 @@ export function StructuredDataTags({ structuredData = {} }, config, pageType, re
543
541
  }
544
542
 
545
543
  if (structuredData.enableNewsArticle !== "withoutArticleSchema") {
546
- return ldJson("Article", articleDataWithoutLogo);
544
+ return ldJson("Article", articleData);
547
545
  }
548
546
  return {};
549
547
  }