@quintype/seo 1.40.5 → 1.40.6-embed-url.2
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
|
@@ -820,9 +820,20 @@ function generateLiveBlogPostingData(structuredData = {}, story = {}, publisherC
|
|
|
820
820
|
};
|
|
821
821
|
}
|
|
822
822
|
|
|
823
|
+
function getEmbedUrl(cards) {
|
|
824
|
+
// get the first story element which has the embed url
|
|
825
|
+
// one more comment
|
|
826
|
+
const storyElement = cards.flatMap(card => card["story-elements"]).find(elem => elem["embed-url"]);
|
|
827
|
+
if (storyElement) {
|
|
828
|
+
return storyElement["embed-url"];
|
|
829
|
+
}
|
|
830
|
+
return "";
|
|
831
|
+
}
|
|
832
|
+
|
|
823
833
|
function generateVideoArticleData(structuredData = {}, story = {}, publisherConfig = {}, timezone) {
|
|
824
834
|
const metaKeywords = story.seo && story.seo["meta-keywords"] || [];
|
|
825
|
-
const
|
|
835
|
+
const storyCards = get__default["default"](story, ["cards"], []);
|
|
836
|
+
const embedUrl = getEmbedUrl(storyCards);
|
|
826
837
|
const socialShareMsg = get__default["default"](story, ["summary"], "");
|
|
827
838
|
const metaDescription = get__default["default"](story, ["seo", "meta-description"], "");
|
|
828
839
|
const subHeadline = get__default["default"](story, ["subheadline"], "");
|
package/package.json
CHANGED
|
@@ -254,9 +254,23 @@ function generateLiveBlogPostingData(structuredData = {}, story = {}, publisherC
|
|
|
254
254
|
};
|
|
255
255
|
}
|
|
256
256
|
|
|
257
|
+
function getEmbedUrl(cards) {
|
|
258
|
+
// get the first story element which has the embed url
|
|
259
|
+
// one more comment
|
|
260
|
+
const storyElement = cards
|
|
261
|
+
.flatMap((card) => card["story-elements"])
|
|
262
|
+
.find((elem) => elem["embed-url"]);
|
|
263
|
+
if (storyElement) {
|
|
264
|
+
return storyElement["embed-url"];
|
|
265
|
+
}
|
|
266
|
+
return "";
|
|
267
|
+
}
|
|
268
|
+
|
|
269
|
+
|
|
257
270
|
function generateVideoArticleData(structuredData = {}, story = {}, publisherConfig = {}, timezone) {
|
|
258
271
|
const metaKeywords = (story.seo && story.seo["meta-keywords"]) || [];
|
|
259
|
-
const
|
|
272
|
+
const storyCards = get(story, ["cards"], []);
|
|
273
|
+
const embedUrl = getEmbedUrl(storyCards);
|
|
260
274
|
const socialShareMsg = get(story, ["summary"], "");
|
|
261
275
|
const metaDescription = get(story, ["seo", "meta-description"], "");
|
|
262
276
|
const subHeadline = get(story, ["subheadline"], "");
|
|
@@ -476,10 +490,7 @@ export function StructuredDataTags({ structuredData = {} }, config, pageType, re
|
|
|
476
490
|
}
|
|
477
491
|
|
|
478
492
|
if (structuredData.enableVideo && story["story-template"] === "video") {
|
|
479
|
-
return ldJson(
|
|
480
|
-
"VideoObject",
|
|
481
|
-
generateVideoArticleData(structuredData, story, publisherConfig, timezone)
|
|
482
|
-
);
|
|
493
|
+
return ldJson("VideoObject", generateVideoArticleData(structuredData, story, publisherConfig, timezone));
|
|
483
494
|
}
|
|
484
495
|
|
|
485
496
|
if (structuredData.enableNewsArticle !== "withoutArticleSchema") {
|