@quintype/seo 1.46.3-fix-video-schema.2 → 1.46.3
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,8 @@
|
|
|
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.3](https://github.com/quintype/quintype-node-seo/compare/v1.46.2...v1.46.3) (2024-07-17)
|
|
6
|
+
|
|
5
7
|
### [1.46.2](https://github.com/quintype/quintype-node-seo/compare/v1.46.1...v1.46.2) (2024-06-12)
|
|
6
8
|
|
|
7
9
|
### [1.46.1](https://github.com/quintype/quintype-node-seo/compare/v1.46.0...v1.46.1) (2024-06-11)
|
package/dist/index.cjs.js
CHANGED
|
@@ -755,7 +755,7 @@ function generateLiveBlogPostingData(structuredData = {}, story = {}, publisherC
|
|
|
755
755
|
}
|
|
756
756
|
|
|
757
757
|
function getEmbedUrl(cards) {
|
|
758
|
-
const
|
|
758
|
+
const playerUrlMapping = {
|
|
759
759
|
"dailymotion-embed-script": "dailymotion-url",
|
|
760
760
|
"instagram": "instagram-url",
|
|
761
761
|
"facebook-video": "facebook-url",
|
|
@@ -767,12 +767,12 @@ function getEmbedUrl(cards) {
|
|
|
767
767
|
for (const card of cards) {
|
|
768
768
|
const storyElements = get__default["default"](card, ["story-elements"], []);
|
|
769
769
|
for (const elem of storyElements) {
|
|
770
|
-
if (elem.subtype &&
|
|
771
|
-
const
|
|
772
|
-
if (elem.metadata && elem.metadata[
|
|
773
|
-
return elem.metadata[
|
|
770
|
+
if (elem.subtype && elem.subtype in playerUrlMapping) {
|
|
771
|
+
const playerUrlField = playerUrlMapping[elem.subtype];
|
|
772
|
+
if (elem.metadata && elem.metadata[playerUrlField]) {
|
|
773
|
+
return elem.metadata[playerUrlField];
|
|
774
774
|
}
|
|
775
|
-
}
|
|
775
|
+
} if (elem.type === "youtube-video" && elem.subtype === null) {
|
|
776
776
|
if (elem.url) {
|
|
777
777
|
return elem.url;
|
|
778
778
|
}
|
package/package.json
CHANGED
|
@@ -263,7 +263,7 @@ function generateLiveBlogPostingData(structuredData = {}, story = {}, publisherC
|
|
|
263
263
|
}
|
|
264
264
|
|
|
265
265
|
function getEmbedUrl(cards) {
|
|
266
|
-
const
|
|
266
|
+
const playerUrlMapping = {
|
|
267
267
|
"dailymotion-embed-script": "dailymotion-url",
|
|
268
268
|
"instagram": "instagram-url",
|
|
269
269
|
"facebook-video": "facebook-url",
|
|
@@ -275,12 +275,13 @@ function getEmbedUrl(cards) {
|
|
|
275
275
|
for (const card of cards) {
|
|
276
276
|
const storyElements = get(card, ["story-elements"], []);
|
|
277
277
|
for (const elem of storyElements) {
|
|
278
|
-
if (elem.subtype &&
|
|
279
|
-
const
|
|
280
|
-
if (elem.metadata && elem.metadata[
|
|
281
|
-
return elem.metadata[
|
|
278
|
+
if (elem.subtype && elem.subtype in playerUrlMapping) {
|
|
279
|
+
const playerUrlField = playerUrlMapping[elem.subtype];
|
|
280
|
+
if (elem.metadata && elem.metadata[playerUrlField]) {
|
|
281
|
+
return elem.metadata[playerUrlField];
|
|
282
282
|
}
|
|
283
|
-
}
|
|
283
|
+
};
|
|
284
|
+
if (elem.type === "youtube-video" && elem.subtype === null) {
|
|
284
285
|
if (elem.url) {
|
|
285
286
|
return elem.url;
|
|
286
287
|
}
|