@quintype/seo 1.49.3-beta.0 → 1.50.0
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 +18 -1
- package/dist/index.cjs.js +29 -1
- package/package.json +5 -10
- package/src/structured-data/structured-data-tags.js +35 -1
- package/test/structured_data_tags_test.js +51 -49
package/CHANGELOG.md
CHANGED
|
@@ -2,7 +2,24 @@
|
|
|
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
|
-
|
|
5
|
+
## [1.50.0](https://github.com/quintype/quintype-node-seo/compare/v1.47.0...v1.50.0) (2025-12-04)
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
### Features
|
|
9
|
+
|
|
10
|
+
* add event schema support when eventDetails exist in story data ([#567](https://github.com/quintype/quintype-node-seo/issues/567)) ([941b86e](https://github.com/quintype/quintype-node-seo/commit/941b86eedd93845fd7a295341a75bd667c35fc85))
|
|
11
|
+
* **media-gallery:** add media gallery schema to visual stories ([#565](https://github.com/quintype/quintype-node-seo/issues/565)) ([34ded03](https://github.com/quintype/quintype-node-seo/commit/34ded036225af150d8085c6d108b5c8bbacece73))
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
### Bug Fixes
|
|
15
|
+
|
|
16
|
+
* change meta description in liveblog structured data ([0bafc42](https://github.com/quintype/quintype-node-seo/commit/0bafc42f3654dd5a588da8d944dcd59c9dd5162d))
|
|
17
|
+
* change meta description in liveblog structured data ([4185cf7](https://github.com/quintype/quintype-node-seo/commit/4185cf74422a478906a740037dc765b637d29e66))
|
|
18
|
+
* change meta description in liveblog structured data ([2792ce8](https://github.com/quintype/quintype-node-seo/commit/2792ce849e7a97b12d614f563ff1ee64c084982f))
|
|
19
|
+
* change meta description in liveblog structured data ([347a682](https://github.com/quintype/quintype-node-seo/commit/347a6825f06388d8e180642bee62e23535b3cae7))
|
|
20
|
+
* change meta description in liveblog structured data ([944252e](https://github.com/quintype/quintype-node-seo/commit/944252ed1256bd70847894d2c5b46ea717727d78))
|
|
21
|
+
* **schema:** fix media gallery schema ([#566](https://github.com/quintype/quintype-node-seo/issues/566)) ([549bd12](https://github.com/quintype/quintype-node-seo/commit/549bd12c2b788acb0f2017c807368c9f242e5c2e))
|
|
22
|
+
* support article schema when enableNewsArticle is not set to "withoutArticleSchema" value ([#569](https://github.com/quintype/quintype-node-seo/issues/569)) ([bfacda1](https://github.com/quintype/quintype-node-seo/commit/bfacda161f4d9b2e5d220acb1c3088081c0f04ec))
|
|
6
23
|
|
|
7
24
|
### [1.49.2](https://github.com/quintype/quintype-node-seo/compare/v1.49.1...v1.49.2) (2025-07-07)
|
|
8
25
|
|
package/dist/index.cjs.js
CHANGED
|
@@ -680,10 +680,38 @@ function generateArticleData(structuredData = {}, story = {}, publisherConfig =
|
|
|
680
680
|
dateModified: stripMillisecondsFromTime(new Date(story["last-published-at"]), timezone),
|
|
681
681
|
datePublished: stripMillisecondsFromTime(new Date(story["first-published-at"]), timezone),
|
|
682
682
|
name: storyKeysPresence && story.headline || "",
|
|
683
|
-
image:
|
|
683
|
+
image: generateArticleHeroImageData(story["hero-image-s3-key"], publisherConfig, story["hero-image-metadata"])
|
|
684
684
|
}, isAccessibleForFree, sponsor, { isPartOf: generateIsPartOfDataForArticle(story, publisherConfig) }, articleSectionObj(story));
|
|
685
685
|
}
|
|
686
686
|
|
|
687
|
+
function generateArticleHeroImageData(image, publisherConfig = {}, imageMetadata = {}) {
|
|
688
|
+
const imageWidth = 1200;
|
|
689
|
+
const imageHeights = [675, 900, 1200];
|
|
690
|
+
const hasFocusPoint = get__default["default"](imageMetadata, ["focus-point"], null);
|
|
691
|
+
|
|
692
|
+
const focusedImage = hasFocusPoint ? new quintypeJs.FocusedImage(image, imageMetadata) : null;
|
|
693
|
+
|
|
694
|
+
return imageHeights.map(height => {
|
|
695
|
+
let croppedImage = "";
|
|
696
|
+
const imageSrc = /^https?.*/.test(publisherConfig["cdn-image"]) ? publisherConfig["cdn-image"] : `https://${publisherConfig["cdn-image"]}`;
|
|
697
|
+
|
|
698
|
+
if (focusedImage) {
|
|
699
|
+
const path = focusedImage.path([imageWidth, height], {
|
|
700
|
+
w: imageWidth,
|
|
701
|
+
h: height,
|
|
702
|
+
auto: "format,compress",
|
|
703
|
+
fit: "crop"
|
|
704
|
+
});
|
|
705
|
+
croppedImage = `${imageSrc}/${path}`;
|
|
706
|
+
}
|
|
707
|
+
const finalUrl = focusedImage ? croppedImage : imageUrl(publisherConfig, image, imageWidth, height);
|
|
708
|
+
return Object.assign({
|
|
709
|
+
"@type": "ImageObject",
|
|
710
|
+
url: finalUrl
|
|
711
|
+
}, getQueryParams(finalUrl));
|
|
712
|
+
});
|
|
713
|
+
}
|
|
714
|
+
|
|
687
715
|
function generateArticleImageData(image, publisherConfig = {}) {
|
|
688
716
|
const imageWidth = 1200;
|
|
689
717
|
const imageHeight = 675;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@quintype/seo",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.50.0",
|
|
4
4
|
"description": "SEO Modules for Quintype",
|
|
5
5
|
"main": "dist/index.cjs.js",
|
|
6
6
|
"repository": "https://github.com/quintype/quintype-node-seo",
|
|
@@ -14,7 +14,7 @@
|
|
|
14
14
|
"coverage": "nyc --all --reporter=html npm test",
|
|
15
15
|
"docs": "rimraf docs && jsdoc -c jsdoc.json",
|
|
16
16
|
"prepack": "npm run build",
|
|
17
|
-
"prepublishOnly": "npm install
|
|
17
|
+
"prepublishOnly": "npm install && npm test && ./bin-dev-scripts/standard-version-release.sh",
|
|
18
18
|
"test": "npm run build && mocha test",
|
|
19
19
|
"sync-files-to": "npx onchange --verbose --await-write-finish=2000 'src/**/*' -- ./bin-dev-scripts/sync-to.sh "
|
|
20
20
|
},
|
|
@@ -33,7 +33,7 @@
|
|
|
33
33
|
"eslint-plugin-promise": "^5.1.0",
|
|
34
34
|
"eslint-plugin-react": "^7.12.4",
|
|
35
35
|
"eslint-plugin-standard": "^5.0.0",
|
|
36
|
-
"gh-pages": "^
|
|
36
|
+
"gh-pages": "^3.2.2",
|
|
37
37
|
"husky": "^7.0.0",
|
|
38
38
|
"jsdoc": "^3.6.10",
|
|
39
39
|
"lint-staged": "^11.0.0",
|
|
@@ -42,8 +42,8 @@
|
|
|
42
42
|
"nyc": "^15.0.0",
|
|
43
43
|
"onchange": "^7.0.2",
|
|
44
44
|
"prettier": "^2.2.1",
|
|
45
|
-
"react": "^
|
|
46
|
-
"react-dom": "^
|
|
45
|
+
"react": "^17.0.1",
|
|
46
|
+
"react-dom": "^17.0.1",
|
|
47
47
|
"rimraf": "^3.0.2",
|
|
48
48
|
"rollup": "^2.0.0",
|
|
49
49
|
"rollup-plugin-babel": "^3.0.2",
|
|
@@ -51,12 +51,7 @@
|
|
|
51
51
|
"structured-data-testing-tool": "^4.5.0",
|
|
52
52
|
"url": "^0.11.0"
|
|
53
53
|
},
|
|
54
|
-
"engines": {
|
|
55
|
-
"node": ">=20.0.0",
|
|
56
|
-
"npm": ">=10.0.0"
|
|
57
|
-
},
|
|
58
54
|
"dependencies": {
|
|
59
|
-
"@babel/traverse": "^7.28.4",
|
|
60
55
|
"date-fns": "^2.17.0",
|
|
61
56
|
"date-fns-tz": "^1.1.1",
|
|
62
57
|
"quintype-js": "^1.2.0"
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import get from "lodash/get";
|
|
2
|
+
import { FocusedImage } from "quintype-js";
|
|
2
3
|
import { getAllowedCards, getQueryParams, stripMillisecondsFromTime, stripQueryParams } from "../utils";
|
|
3
4
|
import { generateTagsForEntity } from "./entity";
|
|
4
5
|
import {
|
|
@@ -122,7 +123,7 @@ function generateArticleData(structuredData = {}, story = {}, publisherConfig =
|
|
|
122
123
|
dateModified: stripMillisecondsFromTime(new Date(story["last-published-at"]), timezone),
|
|
123
124
|
datePublished: stripMillisecondsFromTime(new Date(story["first-published-at"]), timezone),
|
|
124
125
|
name: (storyKeysPresence && story.headline) || "",
|
|
125
|
-
image:
|
|
126
|
+
image: generateArticleHeroImageData(story["hero-image-s3-key"], publisherConfig, story["hero-image-metadata"]),
|
|
126
127
|
},
|
|
127
128
|
isAccessibleForFree,
|
|
128
129
|
sponsor,
|
|
@@ -131,6 +132,39 @@ function generateArticleData(structuredData = {}, story = {}, publisherConfig =
|
|
|
131
132
|
);
|
|
132
133
|
}
|
|
133
134
|
|
|
135
|
+
function generateArticleHeroImageData(image, publisherConfig = {}, imageMetadata = {}) {
|
|
136
|
+
const imageWidth = 1200;
|
|
137
|
+
const imageHeights = [675, 900, 1200];
|
|
138
|
+
const hasFocusPoint = get(imageMetadata, ["focus-point"], null);
|
|
139
|
+
|
|
140
|
+
const focusedImage = hasFocusPoint ? new FocusedImage(image, imageMetadata) : null;
|
|
141
|
+
|
|
142
|
+
return imageHeights.map((height) => {
|
|
143
|
+
let croppedImage = "";
|
|
144
|
+
const imageSrc = /^https?.*/.test(publisherConfig["cdn-image"])
|
|
145
|
+
? publisherConfig["cdn-image"]
|
|
146
|
+
: `https://${publisherConfig["cdn-image"]}`;
|
|
147
|
+
|
|
148
|
+
if (focusedImage) {
|
|
149
|
+
const path = focusedImage.path([imageWidth, height], {
|
|
150
|
+
w: imageWidth,
|
|
151
|
+
h: height,
|
|
152
|
+
auto: "format,compress",
|
|
153
|
+
fit: "crop",
|
|
154
|
+
});
|
|
155
|
+
croppedImage = `${imageSrc}/${path}`;
|
|
156
|
+
}
|
|
157
|
+
const finalUrl = focusedImage ? croppedImage : imageUrl(publisherConfig, image, imageWidth, height);
|
|
158
|
+
return Object.assign(
|
|
159
|
+
{
|
|
160
|
+
"@type": "ImageObject",
|
|
161
|
+
url: finalUrl,
|
|
162
|
+
},
|
|
163
|
+
getQueryParams(finalUrl)
|
|
164
|
+
);
|
|
165
|
+
});
|
|
166
|
+
}
|
|
167
|
+
|
|
134
168
|
function generateArticleImageData(image, publisherConfig = {}) {
|
|
135
169
|
const imageWidth = 1200;
|
|
136
170
|
const imageHeight = 675;
|