@quintype/seo 1.40.6-embed-url.2 → 1.40.6-embed-url.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/.vscode/settings.json
CHANGED
package/dist/index.cjs.js
CHANGED
|
@@ -822,9 +822,21 @@ function generateLiveBlogPostingData(structuredData = {}, story = {}, publisherC
|
|
|
822
822
|
|
|
823
823
|
function getEmbedUrl(cards) {
|
|
824
824
|
// get the first story element which has the embed url
|
|
825
|
-
|
|
826
|
-
|
|
827
|
-
|
|
825
|
+
|
|
826
|
+
let storyElemIndex;
|
|
827
|
+
|
|
828
|
+
const card = cards.find(card => {
|
|
829
|
+
const storyElements = card["story-elements"];
|
|
830
|
+
return storyElements.find((elem, index) => {
|
|
831
|
+
if (elem["embed-url"]) {
|
|
832
|
+
storyElemIndex = index;
|
|
833
|
+
return elem["embed-url"];
|
|
834
|
+
}
|
|
835
|
+
return false;
|
|
836
|
+
});
|
|
837
|
+
});
|
|
838
|
+
if (card) {
|
|
839
|
+
const storyElement = card['story-elements'][storyElemIndex];
|
|
828
840
|
return storyElement["embed-url"];
|
|
829
841
|
}
|
|
830
842
|
return "";
|
package/package.json
CHANGED
|
@@ -256,12 +256,22 @@ function generateLiveBlogPostingData(structuredData = {}, story = {}, publisherC
|
|
|
256
256
|
|
|
257
257
|
function getEmbedUrl(cards) {
|
|
258
258
|
// get the first story element which has the embed url
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
return
|
|
259
|
+
|
|
260
|
+
let storyElemIndex;
|
|
261
|
+
|
|
262
|
+
const card = cards.find((card) => {
|
|
263
|
+
const storyElements = card["story-elements"];
|
|
264
|
+
return storyElements.find((elem, index) => {
|
|
265
|
+
if (elem["embed-url"]) {
|
|
266
|
+
storyElemIndex = index;
|
|
267
|
+
return elem["embed-url"];
|
|
268
|
+
}
|
|
269
|
+
return false;
|
|
270
|
+
});
|
|
271
|
+
});
|
|
272
|
+
if (card) {
|
|
273
|
+
const storyElement = card['story-elements'][storyElemIndex]
|
|
274
|
+
return storyElement["embed-url"];
|
|
265
275
|
}
|
|
266
276
|
return "";
|
|
267
277
|
}
|