@quintype/seo 1.40.10 → 1.40.11-blog-posting-schema.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/dist/index.cjs.js
CHANGED
|
@@ -370,10 +370,11 @@ function getSchemaHeader({ cssSelector }) {
|
|
|
370
370
|
}) : {};
|
|
371
371
|
}
|
|
372
372
|
|
|
373
|
-
function getSchemaBlogPosting(card = {}, author = {}, headline = "", image = "", structuredData = {}, story = {}, timezone) {
|
|
373
|
+
function getSchemaBlogPosting(card = {}, author = {}, headline = "", image = "", structuredData = {}, story = {}, timezone, articleBody) {
|
|
374
374
|
const { website: { url = "" } = {} } = structuredData;
|
|
375
375
|
const orgUrl = lodash.get(structuredData, ["organization", "url"], "");
|
|
376
376
|
return Object.assign({}, getSchemaType("BlogPosting"), getSchemaMainEntityOfPage(`${url}/${story.slug}`), getSchemaPublisher(structuredData.organization, orgUrl), {
|
|
377
|
+
articleBody: articleBody,
|
|
377
378
|
dateModified: stripMillisecondsFromTime(new Date(card["card-updated-at"]), timezone),
|
|
378
379
|
dateCreated: stripMillisecondsFromTime(new Date(card["card-added-at"]), timezone),
|
|
379
380
|
datePublished: stripMillisecondsFromTime(new Date(card["card-updated-at"]), timezone),
|
|
@@ -633,6 +634,8 @@ function generateLiveBlogPostingData(structuredData = {}, story = {}, publisherC
|
|
|
633
634
|
const imageWidth = 1200;
|
|
634
635
|
const imageHeight = 675;
|
|
635
636
|
const authorSchema = structuredData.authorSchema && structuredData.authorSchema(story) || [];
|
|
637
|
+
const storyKeysPresence = Object.keys(story).length > 0;
|
|
638
|
+
const articleBody = storyKeysPresence && getCompleteText(story, structuredData.stripHtmlFromArticleBody) || "";
|
|
636
639
|
return {
|
|
637
640
|
headline: story.headline,
|
|
638
641
|
description: story.summary || story.headline,
|
|
@@ -640,7 +643,8 @@ function generateLiveBlogPostingData(structuredData = {}, story = {}, publisherC
|
|
|
640
643
|
coverageEndTime: stripMillisecondsFromTime(new Date(story["last-published-at"]), timezone),
|
|
641
644
|
coverageStartTime: stripMillisecondsFromTime(new Date(story["first-published-at"]), timezone),
|
|
642
645
|
dateModified: stripMillisecondsFromTime(new Date(story["last-published-at"]), timezone),
|
|
643
|
-
|
|
646
|
+
|
|
647
|
+
liveBlogUpdate: story.cards.map(card => getSchemaBlogPosting(card, authorData(story.authors, authorSchema, publisherConfig), findStoryElementField(card, "title", "text", story.headline), imageUrl(publisherConfig, findStoryElementField(card, "image", "image-s3-key", story["hero-image-s3-key"]), imageWidth, imageHeight), structuredData, story, timezone, articleBody))
|
|
644
648
|
};
|
|
645
649
|
}
|
|
646
650
|
|
package/package.json
CHANGED
|
@@ -41,7 +41,8 @@ export function getSchemaBlogPosting(
|
|
|
41
41
|
image = "",
|
|
42
42
|
structuredData = {},
|
|
43
43
|
story = {},
|
|
44
|
-
timezone
|
|
44
|
+
timezone,
|
|
45
|
+
articleBody
|
|
45
46
|
) {
|
|
46
47
|
const { website: { url = "" } = {} } = structuredData;
|
|
47
48
|
const orgUrl = get(structuredData, ["organization", "url"], "");
|
|
@@ -51,6 +52,7 @@ export function getSchemaBlogPosting(
|
|
|
51
52
|
getSchemaMainEntityOfPage(`${url}/${story.slug}`),
|
|
52
53
|
getSchemaPublisher(structuredData.organization, orgUrl),
|
|
53
54
|
{
|
|
55
|
+
articleBody: articleBody,
|
|
54
56
|
dateModified: stripMillisecondsFromTime(new Date(card["card-updated-at"]), timezone),
|
|
55
57
|
dateCreated: stripMillisecondsFromTime(new Date(card["card-added-at"]), timezone),
|
|
56
58
|
datePublished: stripMillisecondsFromTime(new Date(card["card-updated-at"]), timezone),
|
|
@@ -228,6 +228,8 @@ function generateLiveBlogPostingData(structuredData = {}, story = {}, publisherC
|
|
|
228
228
|
const imageWidth = 1200;
|
|
229
229
|
const imageHeight = 675;
|
|
230
230
|
const authorSchema = (structuredData.authorSchema && structuredData.authorSchema(story)) || [];
|
|
231
|
+
const storyKeysPresence = Object.keys(story).length > 0;
|
|
232
|
+
const articleBody = (storyKeysPresence && getCompleteText(story, structuredData.stripHtmlFromArticleBody)) || "";
|
|
231
233
|
return {
|
|
232
234
|
headline: story.headline,
|
|
233
235
|
description: story.summary || story.headline,
|
|
@@ -235,6 +237,7 @@ function generateLiveBlogPostingData(structuredData = {}, story = {}, publisherC
|
|
|
235
237
|
coverageEndTime: stripMillisecondsFromTime(new Date(story["last-published-at"]), timezone),
|
|
236
238
|
coverageStartTime: stripMillisecondsFromTime(new Date(story["first-published-at"]), timezone),
|
|
237
239
|
dateModified: stripMillisecondsFromTime(new Date(story["last-published-at"]), timezone),
|
|
240
|
+
|
|
238
241
|
liveBlogUpdate: story.cards.map((card) =>
|
|
239
242
|
getSchemaBlogPosting(
|
|
240
243
|
card,
|
|
@@ -248,7 +251,8 @@ function generateLiveBlogPostingData(structuredData = {}, story = {}, publisherC
|
|
|
248
251
|
),
|
|
249
252
|
structuredData,
|
|
250
253
|
story,
|
|
251
|
-
timezone
|
|
254
|
+
timezone,
|
|
255
|
+
articleBody
|
|
252
256
|
)
|
|
253
257
|
),
|
|
254
258
|
};
|
|
@@ -891,12 +891,13 @@ describe("StructuredDataTags", function () {
|
|
|
891
891
|
sampleStoryData("live-blog", cards, sampleAuthorsData()),
|
|
892
892
|
{ url: url.parse("/") }
|
|
893
893
|
);
|
|
894
|
+
|
|
894
895
|
assertContains(
|
|
895
|
-
'<script type="application/ld+json">{"@context":"http://schema.org","@type":"BreadcrumbList","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https://madrid.quintype.io"},{"@type":"ListItem","position":2,"name":"Section Name","item":""},{"@type":"ListItem","position":3,"name":"Personalise or perish - Why publishers need to use personalised content","item":""}]}</script><script type="application/ld+json">{"headline":"Personalise or perish - Why publishers need to use personalised content","description":"Personalised content marketing is the slayer weapon in this war for attention and engagement.","author":"Greeshma","coverageEndTime":"2018-04-20T06:03:25Z","coverageStartTime":"2018-02-28T11:11:04Z","dateModified":"2018-04-20T06:03:25Z","liveBlogUpdate":[{"@type":"BlogPosting","mainEntityOfPage":{"@type":"WebPage","@id":"https://madrid.quintype.io/politics/2018/02/28/personalise-or-perish---why-publishers-need-to-use-personalised-content"},"publisher":{"@type":"Organization","@context":"http://schema.org","name":"Quintype","url":"http://www.quintype.com/","logo":"https://quintype.com/logo.png","sameAs":["https://www.facebook.com/quintype","https://twitter.com/quintype_inc","https://plus.google.com/+quintype","https://www.youtube.com/user/Quintype"],"id":"http://www.quintype.com/"},"dateModified":"2018-04-20T06:03:25Z","dateCreated":"2018-02-28T11:11:04Z","datePublished":"2018-04-20T06:03:25Z","author":[{"@type":"Person","givenName":"Greeshma","name":"Greeshma","url":"https://madrid.quintype.io/author/greeshma"}],"headline":"BQ Live: Hot Money","image":"https://images.assettype.com/bloombergquint/2018-07/99423a77-d39a-4803-94c9-1bdc33f95cc6/OI_July_4.PNG?w=1200&h=675&auto=format%2Ccompress&fit=max"}],"@type":"LiveBlogPosting","@context":"http://schema.org"}</script><script type="application/ld+json">{"headline":"Personalise or perish - Why publishers need to use personalised content","image":{"@type":"ImageObject","url":"https://images.assettype.com/quintype-demo/2018-03/a27aafbf-8a27-4f42-b78f-769eb04655d6/efa66751-e534-4a18-8ebe-e02189c356d9.jpg?w=1200&h=675&auto=format%2Ccompress&fit=max","width":"1200","height":"675"},"url":"https://madrid.quintype.io/politics/2018/02/28/personalise-or-perish---why-publishers-need-to-use-personalised-content","datePublished":"2018-02-28T11:11:04Z","mainEntityOfPage":{"@type":"WebPage","@id":"http://www.quintype.com/"},"publisher":{"@type":"Organization","@context":"http://schema.org","name":"Quintype","url":"http://www.quintype.com/","logo":"https://quintype.com/logo.png","sameAs":["https://www.facebook.com/quintype","https://twitter.com/quintype_inc","https://plus.google.com/+quintype","https://www.youtube.com/user/Quintype"],"id":"http://www.quintype.com/"},"author":[{"@type":"Person","givenName":"Greeshma","name":"Greeshma","url":"https://madrid.quintype.io/author/greeshma"}],"keywords":"","thumbnailUrl":"https://images.assettype.com/quintype-demo/2018-03/a27aafbf-8a27-4f42-b78f-769eb04655d6/efa66751-e534-4a18-8ebe-e02189c356d9.jpg?w=1200&h=675&auto=format%2Ccompress&fit=max","articleBody":"","dateCreated":"2018-02-28T11:11:04Z","dateModified":"2018-04-20T06:03:25Z","name":"Personalise or perish - Why publishers need to use personalised content","isPartOf":{"@type":"WebPage","url":"https://madrid.quintype.io/politics/2018/02/28/personalise-or-perish---why-publishers-need-to-use-personalised-content","primaryImageOfPage":{"@type":"ImageObject","url":"https://images.assettype.com/quintype-demo/2018-03/a27aafbf-8a27-4f42-b78f-769eb04655d6/efa66751-e534-4a18-8ebe-e02189c356d9.jpg?w=1200&h=675&auto=format%2Ccompress&fit=max","width":"1200","height":"675"}},"articleSection":"Section Name","alternativeHeadline":"","description":"Personalised content marketing is the slayer weapon in this war for attention and engagement.","hasPart":[{"@type":"WebPageElement","cssSelector":".paywall"}],"@type":"NewsArticle","@context":"http://schema.org"}</script>',
|
|
896
|
+
'<script type="application/ld+json">{"@context":"http://schema.org","@type":"BreadcrumbList","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https://madrid.quintype.io"},{"@type":"ListItem","position":2,"name":"Section Name","item":""},{"@type":"ListItem","position":3,"name":"Personalise or perish - Why publishers need to use personalised content","item":""}]}</script><script type="application/ld+json">{"headline":"Personalise or perish - Why publishers need to use personalised content","description":"Personalised content marketing is the slayer weapon in this war for attention and engagement.","author":"Greeshma","coverageEndTime":"2018-04-20T06:03:25Z","coverageStartTime":"2018-02-28T11:11:04Z","dateModified":"2018-04-20T06:03:25Z","liveBlogUpdate":[{"@type":"BlogPosting","mainEntityOfPage":{"@type":"WebPage","@id":"https://madrid.quintype.io/politics/2018/02/28/personalise-or-perish---why-publishers-need-to-use-personalised-content"},"publisher":{"@type":"Organization","@context":"http://schema.org","name":"Quintype","url":"http://www.quintype.com/","logo":"https://quintype.com/logo.png","sameAs":["https://www.facebook.com/quintype","https://twitter.com/quintype_inc","https://plus.google.com/+quintype","https://www.youtube.com/user/Quintype"],"id":"http://www.quintype.com/"},"articleBody":"","dateModified":"2018-04-20T06:03:25Z","dateCreated":"2018-02-28T11:11:04Z","datePublished":"2018-04-20T06:03:25Z","author":[{"@type":"Person","givenName":"Greeshma","name":"Greeshma","url":"https://madrid.quintype.io/author/greeshma"}],"headline":"BQ Live: Hot Money","image":"https://images.assettype.com/bloombergquint/2018-07/99423a77-d39a-4803-94c9-1bdc33f95cc6/OI_July_4.PNG?w=1200&h=675&auto=format%2Ccompress&fit=max"}],"@type":"LiveBlogPosting","@context":"http://schema.org"}</script><script type="application/ld+json">{"headline":"Personalise or perish - Why publishers need to use personalised content","image":{"@type":"ImageObject","url":"https://images.assettype.com/quintype-demo/2018-03/a27aafbf-8a27-4f42-b78f-769eb04655d6/efa66751-e534-4a18-8ebe-e02189c356d9.jpg?w=1200&h=675&auto=format%2Ccompress&fit=max","width":"1200","height":"675"},"url":"https://madrid.quintype.io/politics/2018/02/28/personalise-or-perish---why-publishers-need-to-use-personalised-content","datePublished":"2018-02-28T11:11:04Z","mainEntityOfPage":{"@type":"WebPage","@id":"http://www.quintype.com/"},"publisher":{"@type":"Organization","@context":"http://schema.org","name":"Quintype","url":"http://www.quintype.com/","logo":"https://quintype.com/logo.png","sameAs":["https://www.facebook.com/quintype","https://twitter.com/quintype_inc","https://plus.google.com/+quintype","https://www.youtube.com/user/Quintype"],"id":"http://www.quintype.com/"},"author":[{"@type":"Person","givenName":"Greeshma","name":"Greeshma","url":"https://madrid.quintype.io/author/greeshma"}],"keywords":"","thumbnailUrl":"https://images.assettype.com/quintype-demo/2018-03/a27aafbf-8a27-4f42-b78f-769eb04655d6/efa66751-e534-4a18-8ebe-e02189c356d9.jpg?w=1200&h=675&auto=format%2Ccompress&fit=max","articleBody":"","dateCreated":"2018-02-28T11:11:04Z","dateModified":"2018-04-20T06:03:25Z","name":"Personalise or perish - Why publishers need to use personalised content","isPartOf":{"@type":"WebPage","url":"https://madrid.quintype.io/politics/2018/02/28/personalise-or-perish---why-publishers-need-to-use-personalised-content","primaryImageOfPage":{"@type":"ImageObject","url":"https://images.assettype.com/quintype-demo/2018-03/a27aafbf-8a27-4f42-b78f-769eb04655d6/efa66751-e534-4a18-8ebe-e02189c356d9.jpg?w=1200&h=675&auto=format%2Ccompress&fit=max","width":"1200","height":"675"}},"articleSection":"Section Name","alternativeHeadline":"","description":"Personalised content marketing is the slayer weapon in this war for attention and engagement.","hasPart":[{"@type":"WebPageElement","cssSelector":".paywall"}],"@type":"NewsArticle","@context":"http://schema.org"}</script>',
|
|
896
897
|
string
|
|
897
898
|
);
|
|
898
899
|
assertContains(
|
|
899
|
-
'<script type="application/ld+json">{"@context":"http://schema.org","@type":"BreadcrumbList","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https://madrid.quintype.io"},{"@type":"ListItem","position":2,"name":"Section Name","item":""},{"@type":"ListItem","position":3,"name":"Personalise or perish - Why publishers need to use personalised content","item":""}]}</script><script type="application/ld+json">{"headline":"Personalise or perish - Why publishers need to use personalised content","description":"Personalised content marketing is the slayer weapon in this war for attention and engagement.","author":"Greeshma","coverageEndTime":"2018-04-20T06:03:25Z","coverageStartTime":"2018-02-28T11:11:04Z","dateModified":"2018-04-20T06:03:25Z","liveBlogUpdate":[{"@type":"BlogPosting","mainEntityOfPage":{"@type":"WebPage","@id":"https://madrid.quintype.io/politics/2018/02/28/personalise-or-perish---why-publishers-need-to-use-personalised-content"},"publisher":{"@type":"Organization","@context":"http://schema.org","name":"Quintype","url":"http://www.quintype.com/","logo":"https://quintype.com/logo.png","sameAs":["https://www.facebook.com/quintype","https://twitter.com/quintype_inc","https://plus.google.com/+quintype","https://www.youtube.com/user/Quintype"],"id":"http://www.quintype.com/"},"dateModified":"2018-04-20T06:03:25Z","dateCreated":"2018-02-28T11:11:04Z","datePublished":"2018-04-20T06:03:25Z","author":[{"@type":"Person","givenName":"Greeshma","name":"Greeshma","url":"https://madrid.quintype.io/author/greeshma"}],"headline":"BQ Live: Hot Money","image":"https://images.assettype.com/bloombergquint/2018-07/99423a77-d39a-4803-94c9-1bdc33f95cc6/OI_July_4.PNG?w=1200&h=675&auto=format%2Ccompress&fit=max"}],"@type":"LiveBlogPosting","@context":"http://schema.org"}</script><script type="application/ld+json">{"headline":"Personalise or perish - Why publishers need to use personalised content","image":{"@type":"ImageObject","url":"https://images.assettype.com/quintype-demo/2018-03/a27aafbf-8a27-4f42-b78f-769eb04655d6/efa66751-e534-4a18-8ebe-e02189c356d9.jpg?w=1200&h=675&auto=format%2Ccompress&fit=max","width":"1200","height":"675"},"url":"https://madrid.quintype.io/politics/2018/02/28/personalise-or-perish---why-publishers-need-to-use-personalised-content","datePublished":"2018-02-28T11:11:04Z","mainEntityOfPage":{"@type":"WebPage","@id":"http://www.quintype.com/"},"publisher":{"@type":"Organization","@context":"http://schema.org","name":"Quintype","url":"http://www.quintype.com/","logo":"https://quintype.com/logo.png","sameAs":["https://www.facebook.com/quintype","https://twitter.com/quintype_inc","https://plus.google.com/+quintype","https://www.youtube.com/user/Quintype"],"id":"http://www.quintype.com/"},"author":[{"@type":"Person","givenName":"Greeshma","name":"Greeshma","url":"https://madrid.quintype.io/author/greeshma"}],"keywords":"","thumbnailUrl":"https://images.assettype.com/quintype-demo/2018-03/a27aafbf-8a27-4f42-b78f-769eb04655d6/efa66751-e534-4a18-8ebe-e02189c356d9.jpg?w=1200&h=675&auto=format%2Ccompress&fit=max","articleBody":"","dateCreated":"2018-02-28T11:11:04Z","dateModified":"2018-04-20T06:03:25Z","name":"Personalise or perish - Why publishers need to use personalised content","isPartOf":{"@type":"WebPage","url":"https://madrid.quintype.io/politics/2018/02/28/personalise-or-perish---why-publishers-need-to-use-personalised-content","primaryImageOfPage":{"@type":"ImageObject","url":"https://images.assettype.com/quintype-demo/2018-03/a27aafbf-8a27-4f42-b78f-769eb04655d6/efa66751-e534-4a18-8ebe-e02189c356d9.jpg?w=1200&h=675&auto=format%2Ccompress&fit=max","width":"1200","height":"675"}},"articleSection":"Section Name","alternativeHeadline":"","description":"Personalised content marketing is the slayer weapon in this war for attention and engagement.","hasPart":[{"@type":"WebPageElement","cssSelector":".paywall"}],"@type":"NewsArticle","@context":"http://schema.org"}</script>',
|
|
900
|
+
'<script type="application/ld+json">{"@context":"http://schema.org","@type":"BreadcrumbList","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https://madrid.quintype.io"},{"@type":"ListItem","position":2,"name":"Section Name","item":""},{"@type":"ListItem","position":3,"name":"Personalise or perish - Why publishers need to use personalised content","item":""}]}</script><script type="application/ld+json">{"headline":"Personalise or perish - Why publishers need to use personalised content","description":"Personalised content marketing is the slayer weapon in this war for attention and engagement.","author":"Greeshma","coverageEndTime":"2018-04-20T06:03:25Z","coverageStartTime":"2018-02-28T11:11:04Z","dateModified":"2018-04-20T06:03:25Z","liveBlogUpdate":[{"@type":"BlogPosting","mainEntityOfPage":{"@type":"WebPage","@id":"https://madrid.quintype.io/politics/2018/02/28/personalise-or-perish---why-publishers-need-to-use-personalised-content"},"publisher":{"@type":"Organization","@context":"http://schema.org","name":"Quintype","url":"http://www.quintype.com/","logo":"https://quintype.com/logo.png","sameAs":["https://www.facebook.com/quintype","https://twitter.com/quintype_inc","https://plus.google.com/+quintype","https://www.youtube.com/user/Quintype"],"id":"http://www.quintype.com/"},"articleBody":"","dateModified":"2018-04-20T06:03:25Z","dateCreated":"2018-02-28T11:11:04Z","datePublished":"2018-04-20T06:03:25Z","author":[{"@type":"Person","givenName":"Greeshma","name":"Greeshma","url":"https://madrid.quintype.io/author/greeshma"}],"headline":"BQ Live: Hot Money","image":"https://images.assettype.com/bloombergquint/2018-07/99423a77-d39a-4803-94c9-1bdc33f95cc6/OI_July_4.PNG?w=1200&h=675&auto=format%2Ccompress&fit=max"}],"@type":"LiveBlogPosting","@context":"http://schema.org"}</script><script type="application/ld+json">{"headline":"Personalise or perish - Why publishers need to use personalised content","image":{"@type":"ImageObject","url":"https://images.assettype.com/quintype-demo/2018-03/a27aafbf-8a27-4f42-b78f-769eb04655d6/efa66751-e534-4a18-8ebe-e02189c356d9.jpg?w=1200&h=675&auto=format%2Ccompress&fit=max","width":"1200","height":"675"},"url":"https://madrid.quintype.io/politics/2018/02/28/personalise-or-perish---why-publishers-need-to-use-personalised-content","datePublished":"2018-02-28T11:11:04Z","mainEntityOfPage":{"@type":"WebPage","@id":"http://www.quintype.com/"},"publisher":{"@type":"Organization","@context":"http://schema.org","name":"Quintype","url":"http://www.quintype.com/","logo":"https://quintype.com/logo.png","sameAs":["https://www.facebook.com/quintype","https://twitter.com/quintype_inc","https://plus.google.com/+quintype","https://www.youtube.com/user/Quintype"],"id":"http://www.quintype.com/"},"author":[{"@type":"Person","givenName":"Greeshma","name":"Greeshma","url":"https://madrid.quintype.io/author/greeshma"}],"keywords":"","thumbnailUrl":"https://images.assettype.com/quintype-demo/2018-03/a27aafbf-8a27-4f42-b78f-769eb04655d6/efa66751-e534-4a18-8ebe-e02189c356d9.jpg?w=1200&h=675&auto=format%2Ccompress&fit=max","articleBody":"","dateCreated":"2018-02-28T11:11:04Z","dateModified":"2018-04-20T06:03:25Z","name":"Personalise or perish - Why publishers need to use personalised content","isPartOf":{"@type":"WebPage","url":"https://madrid.quintype.io/politics/2018/02/28/personalise-or-perish---why-publishers-need-to-use-personalised-content","primaryImageOfPage":{"@type":"ImageObject","url":"https://images.assettype.com/quintype-demo/2018-03/a27aafbf-8a27-4f42-b78f-769eb04655d6/efa66751-e534-4a18-8ebe-e02189c356d9.jpg?w=1200&h=675&auto=format%2Ccompress&fit=max","width":"1200","height":"675"}},"articleSection":"Section Name","alternativeHeadline":"","description":"Personalised content marketing is the slayer weapon in this war for attention and engagement.","hasPart":[{"@type":"WebPageElement","cssSelector":".paywall"}],"@type":"NewsArticle","@context":"http://schema.org"}</script>',
|
|
900
901
|
ampPageString
|
|
901
902
|
);
|
|
902
903
|
});
|
|
@@ -924,11 +925,11 @@ describe("StructuredDataTags", function () {
|
|
|
924
925
|
{ url: url.parse("/") }
|
|
925
926
|
);
|
|
926
927
|
assertContains(
|
|
927
|
-
'<script type="application/ld+json">{"@context":"http://schema.org","@type":"BreadcrumbList","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https://madrid.quintype.io"},{"@type":"ListItem","position":2,"name":"Section Name","item":""},{"@type":"ListItem","position":3,"name":"Personalise or perish - Why publishers need to use personalised content","item":""}]}</script><script type="application/ld+json">{"headline":"Personalise or perish - Why publishers need to use personalised content","description":"Personalised content marketing is the slayer weapon in this war for attention and engagement.","author":"Greeshma","coverageEndTime":"2018-04-20T06:03:25Z","coverageStartTime":"2018-02-28T11:11:04Z","dateModified":"2018-04-20T06:03:25Z","liveBlogUpdate":[{"@type":"BlogPosting","mainEntityOfPage":{"@type":"WebPage","@id":"https://madrid.quintype.io/politics/2018/02/28/personalise-or-perish---why-publishers-need-to-use-personalised-content"},"publisher":{"@type":"Organization","@context":"http://schema.org","name":"Quintype","url":"http://www.quintype.com/","logo":"https://quintype.com/logo.png","sameAs":["https://www.facebook.com/quintype","https://twitter.com/quintype_inc","https://plus.google.com/+quintype","https://www.youtube.com/user/Quintype"],"id":"http://www.quintype.com/"},"dateModified":"2018-04-20T06:03:25Z","dateCreated":"2018-02-28T11:11:04Z","datePublished":"2018-04-20T06:03:25Z","author":[{"@type":"Person","givenName":"Greeshma","name":"Greeshma","url":"https://madrid.quintype.io/author/greeshma"}],"headline":"Personalise or perish - Why publishers need to use personalised content","image":"https://images.assettype.com/quintype-demo/2018-03/a27aafbf-8a27-4f42-b78f-769eb04655d6/efa66751-e534-4a18-8ebe-e02189c356d9.jpg?w=1200&h=675&auto=format%2Ccompress&fit=max"}],"@type":"LiveBlogPosting","@context":"http://schema.org"}</script><script type="application/ld+json">{"headline":"Personalise or perish - Why publishers need to use personalised content","image":{"@type":"ImageObject","url":"https://images.assettype.com/quintype-demo/2018-03/a27aafbf-8a27-4f42-b78f-769eb04655d6/efa66751-e534-4a18-8ebe-e02189c356d9.jpg?w=1200&h=675&auto=format%2Ccompress&fit=max","width":"1200","height":"675"},"url":"https://madrid.quintype.io/politics/2018/02/28/personalise-or-perish---why-publishers-need-to-use-personalised-content","datePublished":"2018-02-28T11:11:04Z","mainEntityOfPage":{"@type":"WebPage","@id":"http://www.quintype.com/"},"publisher":{"@type":"Organization","@context":"http://schema.org","name":"Quintype","url":"http://www.quintype.com/","logo":"https://quintype.com/logo.png","sameAs":["https://www.facebook.com/quintype","https://twitter.com/quintype_inc","https://plus.google.com/+quintype","https://www.youtube.com/user/Quintype"],"id":"http://www.quintype.com/"},"author":[{"@type":"Person","givenName":"Greeshma","name":"Greeshma","url":"https://madrid.quintype.io/author/greeshma"}],"keywords":"","thumbnailUrl":"https://images.assettype.com/quintype-demo/2018-03/a27aafbf-8a27-4f42-b78f-769eb04655d6/efa66751-e534-4a18-8ebe-e02189c356d9.jpg?w=1200&h=675&auto=format%2Ccompress&fit=max","articleBody":"","dateCreated":"2018-02-28T11:11:04Z","dateModified":"2018-04-20T06:03:25Z","name":"Personalise or perish - Why publishers need to use personalised content","isPartOf":{"@type":"WebPage","url":"https://madrid.quintype.io/politics/2018/02/28/personalise-or-perish---why-publishers-need-to-use-personalised-content","primaryImageOfPage":{"@type":"ImageObject","url":"https://images.assettype.com/quintype-demo/2018-03/a27aafbf-8a27-4f42-b78f-769eb04655d6/efa66751-e534-4a18-8ebe-e02189c356d9.jpg?w=1200&h=675&auto=format%2Ccompress&fit=max","width":"1200","height":"675"}},"articleSection":"Section Name","alternativeHeadline":"","description":"Personalised content marketing is the slayer weapon in this war for attention and engagement.","hasPart":[{"@type":"WebPageElement","cssSelector":".paywall"}],"@type":"NewsArticle","@context":"http://schema.org"}</script>',
|
|
928
|
+
'<script type="application/ld+json">{"@context":"http://schema.org","@type":"BreadcrumbList","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https://madrid.quintype.io"},{"@type":"ListItem","position":2,"name":"Section Name","item":""},{"@type":"ListItem","position":3,"name":"Personalise or perish - Why publishers need to use personalised content","item":""}]}</script><script type="application/ld+json">{"headline":"Personalise or perish - Why publishers need to use personalised content","description":"Personalised content marketing is the slayer weapon in this war for attention and engagement.","author":"Greeshma","coverageEndTime":"2018-04-20T06:03:25Z","coverageStartTime":"2018-02-28T11:11:04Z","dateModified":"2018-04-20T06:03:25Z","liveBlogUpdate":[{"@type":"BlogPosting","mainEntityOfPage":{"@type":"WebPage","@id":"https://madrid.quintype.io/politics/2018/02/28/personalise-or-perish---why-publishers-need-to-use-personalised-content"},"publisher":{"@type":"Organization","@context":"http://schema.org","name":"Quintype","url":"http://www.quintype.com/","logo":"https://quintype.com/logo.png","sameAs":["https://www.facebook.com/quintype","https://twitter.com/quintype_inc","https://plus.google.com/+quintype","https://www.youtube.com/user/Quintype"],"id":"http://www.quintype.com/"},"articleBody":"","dateModified":"2018-04-20T06:03:25Z","dateCreated":"2018-02-28T11:11:04Z","datePublished":"2018-04-20T06:03:25Z","author":[{"@type":"Person","givenName":"Greeshma","name":"Greeshma","url":"https://madrid.quintype.io/author/greeshma"}],"headline":"Personalise or perish - Why publishers need to use personalised content","image":"https://images.assettype.com/quintype-demo/2018-03/a27aafbf-8a27-4f42-b78f-769eb04655d6/efa66751-e534-4a18-8ebe-e02189c356d9.jpg?w=1200&h=675&auto=format%2Ccompress&fit=max"}],"@type":"LiveBlogPosting","@context":"http://schema.org"}</script><script type="application/ld+json">{"headline":"Personalise or perish - Why publishers need to use personalised content","image":{"@type":"ImageObject","url":"https://images.assettype.com/quintype-demo/2018-03/a27aafbf-8a27-4f42-b78f-769eb04655d6/efa66751-e534-4a18-8ebe-e02189c356d9.jpg?w=1200&h=675&auto=format%2Ccompress&fit=max","width":"1200","height":"675"},"url":"https://madrid.quintype.io/politics/2018/02/28/personalise-or-perish---why-publishers-need-to-use-personalised-content","datePublished":"2018-02-28T11:11:04Z","mainEntityOfPage":{"@type":"WebPage","@id":"http://www.quintype.com/"},"publisher":{"@type":"Organization","@context":"http://schema.org","name":"Quintype","url":"http://www.quintype.com/","logo":"https://quintype.com/logo.png","sameAs":["https://www.facebook.com/quintype","https://twitter.com/quintype_inc","https://plus.google.com/+quintype","https://www.youtube.com/user/Quintype"],"id":"http://www.quintype.com/"},"author":[{"@type":"Person","givenName":"Greeshma","name":"Greeshma","url":"https://madrid.quintype.io/author/greeshma"}],"keywords":"","thumbnailUrl":"https://images.assettype.com/quintype-demo/2018-03/a27aafbf-8a27-4f42-b78f-769eb04655d6/efa66751-e534-4a18-8ebe-e02189c356d9.jpg?w=1200&h=675&auto=format%2Ccompress&fit=max","articleBody":"","dateCreated":"2018-02-28T11:11:04Z","dateModified":"2018-04-20T06:03:25Z","name":"Personalise or perish - Why publishers need to use personalised content","isPartOf":{"@type":"WebPage","url":"https://madrid.quintype.io/politics/2018/02/28/personalise-or-perish---why-publishers-need-to-use-personalised-content","primaryImageOfPage":{"@type":"ImageObject","url":"https://images.assettype.com/quintype-demo/2018-03/a27aafbf-8a27-4f42-b78f-769eb04655d6/efa66751-e534-4a18-8ebe-e02189c356d9.jpg?w=1200&h=675&auto=format%2Ccompress&fit=max","width":"1200","height":"675"}},"articleSection":"Section Name","alternativeHeadline":"","description":"Personalised content marketing is the slayer weapon in this war for attention and engagement.","hasPart":[{"@type":"WebPageElement","cssSelector":".paywall"}],"@type":"NewsArticle","@context":"http://schema.org"}</script>',
|
|
928
929
|
string
|
|
929
930
|
);
|
|
930
931
|
assertContains(
|
|
931
|
-
'<script type="application/ld+json">{"@context":"http://schema.org","@type":"BreadcrumbList","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https://madrid.quintype.io"},{"@type":"ListItem","position":2,"name":"Section Name","item":""},{"@type":"ListItem","position":3,"name":"Personalise or perish - Why publishers need to use personalised content","item":""}]}</script><script type="application/ld+json">{"headline":"Personalise or perish - Why publishers need to use personalised content","description":"Personalised content marketing is the slayer weapon in this war for attention and engagement.","author":"Greeshma","coverageEndTime":"2018-04-20T06:03:25Z","coverageStartTime":"2018-02-28T11:11:04Z","dateModified":"2018-04-20T06:03:25Z","liveBlogUpdate":[{"@type":"BlogPosting","mainEntityOfPage":{"@type":"WebPage","@id":"https://madrid.quintype.io/politics/2018/02/28/personalise-or-perish---why-publishers-need-to-use-personalised-content"},"publisher":{"@type":"Organization","@context":"http://schema.org","name":"Quintype","url":"http://www.quintype.com/","logo":"https://quintype.com/logo.png","sameAs":["https://www.facebook.com/quintype","https://twitter.com/quintype_inc","https://plus.google.com/+quintype","https://www.youtube.com/user/Quintype"],"id":"http://www.quintype.com/"},"dateModified":"2018-04-20T06:03:25Z","dateCreated":"2018-02-28T11:11:04Z","datePublished":"2018-04-20T06:03:25Z","author":[{"@type":"Person","givenName":"Greeshma","name":"Greeshma","url":"https://madrid.quintype.io/author/greeshma"}],"headline":"Personalise or perish - Why publishers need to use personalised content","image":"https://images.assettype.com/quintype-demo/2018-03/a27aafbf-8a27-4f42-b78f-769eb04655d6/efa66751-e534-4a18-8ebe-e02189c356d9.jpg?w=1200&h=675&auto=format%2Ccompress&fit=max"}],"@type":"LiveBlogPosting","@context":"http://schema.org"}</script><script type="application/ld+json">{"headline":"Personalise or perish - Why publishers need to use personalised content","image":{"@type":"ImageObject","url":"https://images.assettype.com/quintype-demo/2018-03/a27aafbf-8a27-4f42-b78f-769eb04655d6/efa66751-e534-4a18-8ebe-e02189c356d9.jpg?w=1200&h=675&auto=format%2Ccompress&fit=max","width":"1200","height":"675"},"url":"https://madrid.quintype.io/politics/2018/02/28/personalise-or-perish---why-publishers-need-to-use-personalised-content","datePublished":"2018-02-28T11:11:04Z","mainEntityOfPage":{"@type":"WebPage","@id":"http://www.quintype.com/"},"publisher":{"@type":"Organization","@context":"http://schema.org","name":"Quintype","url":"http://www.quintype.com/","logo":"https://quintype.com/logo.png","sameAs":["https://www.facebook.com/quintype","https://twitter.com/quintype_inc","https://plus.google.com/+quintype","https://www.youtube.com/user/Quintype"],"id":"http://www.quintype.com/"},"author":[{"@type":"Person","givenName":"Greeshma","name":"Greeshma","url":"https://madrid.quintype.io/author/greeshma"}],"keywords":"","thumbnailUrl":"https://images.assettype.com/quintype-demo/2018-03/a27aafbf-8a27-4f42-b78f-769eb04655d6/efa66751-e534-4a18-8ebe-e02189c356d9.jpg?w=1200&h=675&auto=format%2Ccompress&fit=max","articleBody":"","dateCreated":"2018-02-28T11:11:04Z","dateModified":"2018-04-20T06:03:25Z","name":"Personalise or perish - Why publishers need to use personalised content","isPartOf":{"@type":"WebPage","url":"https://madrid.quintype.io/politics/2018/02/28/personalise-or-perish---why-publishers-need-to-use-personalised-content","primaryImageOfPage":{"@type":"ImageObject","url":"https://images.assettype.com/quintype-demo/2018-03/a27aafbf-8a27-4f42-b78f-769eb04655d6/efa66751-e534-4a18-8ebe-e02189c356d9.jpg?w=1200&h=675&auto=format%2Ccompress&fit=max","width":"1200","height":"675"}},"articleSection":"Section Name","alternativeHeadline":"","description":"Personalised content marketing is the slayer weapon in this war for attention and engagement.","hasPart":[{"@type":"WebPageElement","cssSelector":".paywall"}],"@type":"NewsArticle","@context":"http://schema.org"}</script>',
|
|
932
|
+
'<script type="application/ld+json">{"@context":"http://schema.org","@type":"BreadcrumbList","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https://madrid.quintype.io"},{"@type":"ListItem","position":2,"name":"Section Name","item":""},{"@type":"ListItem","position":3,"name":"Personalise or perish - Why publishers need to use personalised content","item":""}]}</script><script type="application/ld+json">{"headline":"Personalise or perish - Why publishers need to use personalised content","description":"Personalised content marketing is the slayer weapon in this war for attention and engagement.","author":"Greeshma","coverageEndTime":"2018-04-20T06:03:25Z","coverageStartTime":"2018-02-28T11:11:04Z","dateModified":"2018-04-20T06:03:25Z","liveBlogUpdate":[{"@type":"BlogPosting","mainEntityOfPage":{"@type":"WebPage","@id":"https://madrid.quintype.io/politics/2018/02/28/personalise-or-perish---why-publishers-need-to-use-personalised-content"},"publisher":{"@type":"Organization","@context":"http://schema.org","name":"Quintype","url":"http://www.quintype.com/","logo":"https://quintype.com/logo.png","sameAs":["https://www.facebook.com/quintype","https://twitter.com/quintype_inc","https://plus.google.com/+quintype","https://www.youtube.com/user/Quintype"],"id":"http://www.quintype.com/"},"articleBody":"","dateModified":"2018-04-20T06:03:25Z","dateCreated":"2018-02-28T11:11:04Z","datePublished":"2018-04-20T06:03:25Z","author":[{"@type":"Person","givenName":"Greeshma","name":"Greeshma","url":"https://madrid.quintype.io/author/greeshma"}],"headline":"Personalise or perish - Why publishers need to use personalised content","image":"https://images.assettype.com/quintype-demo/2018-03/a27aafbf-8a27-4f42-b78f-769eb04655d6/efa66751-e534-4a18-8ebe-e02189c356d9.jpg?w=1200&h=675&auto=format%2Ccompress&fit=max"}],"@type":"LiveBlogPosting","@context":"http://schema.org"}</script><script type="application/ld+json">{"headline":"Personalise or perish - Why publishers need to use personalised content","image":{"@type":"ImageObject","url":"https://images.assettype.com/quintype-demo/2018-03/a27aafbf-8a27-4f42-b78f-769eb04655d6/efa66751-e534-4a18-8ebe-e02189c356d9.jpg?w=1200&h=675&auto=format%2Ccompress&fit=max","width":"1200","height":"675"},"url":"https://madrid.quintype.io/politics/2018/02/28/personalise-or-perish---why-publishers-need-to-use-personalised-content","datePublished":"2018-02-28T11:11:04Z","mainEntityOfPage":{"@type":"WebPage","@id":"http://www.quintype.com/"},"publisher":{"@type":"Organization","@context":"http://schema.org","name":"Quintype","url":"http://www.quintype.com/","logo":"https://quintype.com/logo.png","sameAs":["https://www.facebook.com/quintype","https://twitter.com/quintype_inc","https://plus.google.com/+quintype","https://www.youtube.com/user/Quintype"],"id":"http://www.quintype.com/"},"author":[{"@type":"Person","givenName":"Greeshma","name":"Greeshma","url":"https://madrid.quintype.io/author/greeshma"}],"keywords":"","thumbnailUrl":"https://images.assettype.com/quintype-demo/2018-03/a27aafbf-8a27-4f42-b78f-769eb04655d6/efa66751-e534-4a18-8ebe-e02189c356d9.jpg?w=1200&h=675&auto=format%2Ccompress&fit=max","articleBody":"","dateCreated":"2018-02-28T11:11:04Z","dateModified":"2018-04-20T06:03:25Z","name":"Personalise or perish - Why publishers need to use personalised content","isPartOf":{"@type":"WebPage","url":"https://madrid.quintype.io/politics/2018/02/28/personalise-or-perish---why-publishers-need-to-use-personalised-content","primaryImageOfPage":{"@type":"ImageObject","url":"https://images.assettype.com/quintype-demo/2018-03/a27aafbf-8a27-4f42-b78f-769eb04655d6/efa66751-e534-4a18-8ebe-e02189c356d9.jpg?w=1200&h=675&auto=format%2Ccompress&fit=max","width":"1200","height":"675"}},"articleSection":"Section Name","alternativeHeadline":"","description":"Personalised content marketing is the slayer weapon in this war for attention and engagement.","hasPart":[{"@type":"WebPageElement","cssSelector":".paywall"}],"@type":"NewsArticle","@context":"http://schema.org"}</script>',
|
|
932
933
|
ampPageString
|
|
933
934
|
);
|
|
934
935
|
});
|
|
@@ -965,12 +966,13 @@ describe("StructuredDataTags", function () {
|
|
|
965
966
|
sampleStoryData("live-blog", cards, sampleAuthorsData(), options),
|
|
966
967
|
{ url: url.parse("/") }
|
|
967
968
|
);
|
|
969
|
+
|
|
968
970
|
assertContains(
|
|
969
|
-
'<script type="application/ld+json">{"@context":"http://schema.org","@type":"BreadcrumbList","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https://madrid.quintype.io"},{"@type":"ListItem","position":2,"name":"Section Name","item":""},{"@type":"ListItem","position":3,"name":"Personalise or perish - Why publishers need to use personalised content","item":""}]}</script><script type="application/ld+json">{"headline":"Personalise or perish - Why publishers need to use personalised content","description":"Personalised content marketing is the slayer weapon in this war for attention and engagement.","author":"Greeshma","coverageEndTime":"2018-04-20T06:03:25Z","coverageStartTime":"2018-02-28T11:11:04Z","dateModified":"2018-04-20T06:03:25Z","liveBlogUpdate":[{"@type":"BlogPosting","mainEntityOfPage":{"@type":"WebPage","@id":"https://madrid.quintype.io/politics/2018/02/28/personalise-or-perish---why-publishers-need-to-use-personalised-content"},"publisher":{"@type":"Organization","@context":"http://schema.org","name":"Quintype","url":"http://www.quintype.com/","logo":"https://quintype.com/logo.png","sameAs":["https://www.facebook.com/quintype","https://twitter.com/quintype_inc","https://plus.google.com/+quintype","https://www.youtube.com/user/Quintype"],"id":"http://www.quintype.com/"},"dateModified":"2018-04-20T06:03:25Z","dateCreated":"2018-02-28T11:11:04Z","datePublished":"2018-04-20T06:03:25Z","author":[{"@type":"Person","givenName":"Greeshma","name":"Greeshma","url":"https://madrid.quintype.io/author/greeshma"}],"headline":"Personalise or perish - Why publishers need to use personalised content","image":"https://images.assettype.com/quintype-demo/2018-03/a27aafbf-8a27-4f42-b78f-769eb04655d6/efa66751-e534-4a18-8ebe-e02189c356d9.jpg?w=1200&h=675&auto=format%2Ccompress&fit=max"}],"@type":"LiveBlogPosting","@context":"http://schema.org"}</script><script type="application/ld+json">{"headline":"Personalise or perish - Why publishers need to use personalised content","image":{"@type":"ImageObject","url":"https://images.assettype.com/quintype-demo/2018-03/a27aafbf-8a27-4f42-b78f-769eb04655d6/efa66751-e534-4a18-8ebe-e02189c356d9.jpg?w=1200&h=675&auto=format%2Ccompress&fit=max","width":"1200","height":"675"},"url":"https://madrid.quintype.io/politics/2018/02/28/personalise-or-perish---why-publishers-need-to-use-personalised-content","datePublished":"2018-02-28T11:11:04Z","mainEntityOfPage":{"@type":"WebPage","@id":"http://www.quintype.com/"},"publisher":{"@type":"Organization","@context":"http://schema.org","name":"Quintype","url":"http://www.quintype.com/","logo":"https://quintype.com/logo.png","sameAs":["https://www.facebook.com/quintype","https://twitter.com/quintype_inc","https://plus.google.com/+quintype","https://www.youtube.com/user/Quintype"],"id":"http://www.quintype.com/"},"author":[{"@type":"Person","givenName":"Greeshma","name":"Greeshma","url":"https://madrid.quintype.io/author/greeshma"}],"keywords":"","thumbnailUrl":"https://images.assettype.com/quintype-demo/2018-03/a27aafbf-8a27-4f42-b78f-769eb04655d6/efa66751-e534-4a18-8ebe-e02189c356d9.jpg?w=1200&h=675&auto=format%2Ccompress&fit=max","articleBody":"","dateCreated":"2018-02-28T11:11:04Z","dateModified":"2018-04-20T06:03:25Z","name":"Personalise or perish - Why publishers need to use personalised content","isPartOf":{"@type":"WebPage","url":"https://madrid.quintype.io/politics/2018/02/28/personalise-or-perish---why-publishers-need-to-use-personalised-content","primaryImageOfPage":{"@type":"ImageObject","url":"https://images.assettype.com/quintype-demo/2018-03/a27aafbf-8a27-4f42-b78f-769eb04655d6/efa66751-e534-4a18-8ebe-e02189c356d9.jpg?w=1200&h=675&auto=format%2Ccompress&fit=max","width":"1200","height":"675"}},"articleSection":"Section Name","alternativeHeadline":"","description":"Personalised content marketing is the slayer weapon in this war for attention and engagement.","hasPart":[{"@type":"WebPageElement","cssSelector":".paywall"}],"@type":"NewsArticle","@context":"http://schema.org"}</script>',
|
|
971
|
+
'<script type="application/ld+json">{"@context":"http://schema.org","@type":"BreadcrumbList","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https://madrid.quintype.io"},{"@type":"ListItem","position":2,"name":"Section Name","item":""},{"@type":"ListItem","position":3,"name":"Personalise or perish - Why publishers need to use personalised content","item":""}]}</script><script type="application/ld+json">{"headline":"Personalise or perish - Why publishers need to use personalised content","description":"Personalised content marketing is the slayer weapon in this war for attention and engagement.","author":"Greeshma","coverageEndTime":"2018-04-20T06:03:25Z","coverageStartTime":"2018-02-28T11:11:04Z","dateModified":"2018-04-20T06:03:25Z","liveBlogUpdate":[{"@type":"BlogPosting","mainEntityOfPage":{"@type":"WebPage","@id":"https://madrid.quintype.io/politics/2018/02/28/personalise-or-perish---why-publishers-need-to-use-personalised-content"},"publisher":{"@type":"Organization","@context":"http://schema.org","name":"Quintype","url":"http://www.quintype.com/","logo":"https://quintype.com/logo.png","sameAs":["https://www.facebook.com/quintype","https://twitter.com/quintype_inc","https://plus.google.com/+quintype","https://www.youtube.com/user/Quintype"],"id":"http://www.quintype.com/"},"articleBody":"","dateModified":"2018-04-20T06:03:25Z","dateCreated":"2018-02-28T11:11:04Z","datePublished":"2018-04-20T06:03:25Z","author":[{"@type":"Person","givenName":"Greeshma","name":"Greeshma","url":"https://madrid.quintype.io/author/greeshma"}],"headline":"Personalise or perish - Why publishers need to use personalised content","image":"https://images.assettype.com/quintype-demo/2018-03/a27aafbf-8a27-4f42-b78f-769eb04655d6/efa66751-e534-4a18-8ebe-e02189c356d9.jpg?w=1200&h=675&auto=format%2Ccompress&fit=max"}],"@type":"LiveBlogPosting","@context":"http://schema.org"}</script><script type="application/ld+json">{"headline":"Personalise or perish - Why publishers need to use personalised content","image":{"@type":"ImageObject","url":"https://images.assettype.com/quintype-demo/2018-03/a27aafbf-8a27-4f42-b78f-769eb04655d6/efa66751-e534-4a18-8ebe-e02189c356d9.jpg?w=1200&h=675&auto=format%2Ccompress&fit=max","width":"1200","height":"675"},"url":"https://madrid.quintype.io/politics/2018/02/28/personalise-or-perish---why-publishers-need-to-use-personalised-content","datePublished":"2018-02-28T11:11:04Z","mainEntityOfPage":{"@type":"WebPage","@id":"http://www.quintype.com/"},"publisher":{"@type":"Organization","@context":"http://schema.org","name":"Quintype","url":"http://www.quintype.com/","logo":"https://quintype.com/logo.png","sameAs":["https://www.facebook.com/quintype","https://twitter.com/quintype_inc","https://plus.google.com/+quintype","https://www.youtube.com/user/Quintype"],"id":"http://www.quintype.com/"},"author":[{"@type":"Person","givenName":"Greeshma","name":"Greeshma","url":"https://madrid.quintype.io/author/greeshma"}],"keywords":"","thumbnailUrl":"https://images.assettype.com/quintype-demo/2018-03/a27aafbf-8a27-4f42-b78f-769eb04655d6/efa66751-e534-4a18-8ebe-e02189c356d9.jpg?w=1200&h=675&auto=format%2Ccompress&fit=max","articleBody":"","dateCreated":"2018-02-28T11:11:04Z","dateModified":"2018-04-20T06:03:25Z","name":"Personalise or perish - Why publishers need to use personalised content","isPartOf":{"@type":"WebPage","url":"https://madrid.quintype.io/politics/2018/02/28/personalise-or-perish---why-publishers-need-to-use-personalised-content","primaryImageOfPage":{"@type":"ImageObject","url":"https://images.assettype.com/quintype-demo/2018-03/a27aafbf-8a27-4f42-b78f-769eb04655d6/efa66751-e534-4a18-8ebe-e02189c356d9.jpg?w=1200&h=675&auto=format%2Ccompress&fit=max","width":"1200","height":"675"}},"articleSection":"Section Name","alternativeHeadline":"","description":"Personalised content marketing is the slayer weapon in this war for attention and engagement.","hasPart":[{"@type":"WebPageElement","cssSelector":".paywall"}],"@type":"NewsArticle","@context":"http://schema.org"}</script>',
|
|
970
972
|
string
|
|
971
973
|
);
|
|
972
974
|
assertContains(
|
|
973
|
-
'<script type="application/ld+json">{"@context":"http://schema.org","@type":"BreadcrumbList","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https://madrid.quintype.io"},{"@type":"ListItem","position":2,"name":"Section Name","item":""},{"@type":"ListItem","position":3,"name":"Personalise or perish - Why publishers need to use personalised content","item":""}]}</script><script type="application/ld+json">{"headline":"Personalise or perish - Why publishers need to use personalised content","description":"Personalised content marketing is the slayer weapon in this war for attention and engagement.","author":"Greeshma","coverageEndTime":"2018-04-20T06:03:25Z","coverageStartTime":"2018-02-28T11:11:04Z","dateModified":"2018-04-20T06:03:25Z","liveBlogUpdate":[{"@type":"BlogPosting","mainEntityOfPage":{"@type":"WebPage","@id":"https://madrid.quintype.io/politics/2018/02/28/personalise-or-perish---why-publishers-need-to-use-personalised-content"},"publisher":{"@type":"Organization","@context":"http://schema.org","name":"Quintype","url":"http://www.quintype.com/","logo":"https://quintype.com/logo.png","sameAs":["https://www.facebook.com/quintype","https://twitter.com/quintype_inc","https://plus.google.com/+quintype","https://www.youtube.com/user/Quintype"],"id":"http://www.quintype.com/"},"dateModified":"2018-04-20T06:03:25Z","dateCreated":"2018-02-28T11:11:04Z","datePublished":"2018-04-20T06:03:25Z","author":[{"@type":"Person","givenName":"Greeshma","name":"Greeshma","url":"https://madrid.quintype.io/author/greeshma"}],"headline":"Personalise or perish - Why publishers need to use personalised content","image":"https://images.assettype.com/quintype-demo/2018-03/a27aafbf-8a27-4f42-b78f-769eb04655d6/efa66751-e534-4a18-8ebe-e02189c356d9.jpg?w=1200&h=675&auto=format%2Ccompress&fit=max"}],"@type":"LiveBlogPosting","@context":"http://schema.org"}</script><script type="application/ld+json">{"headline":"Personalise or perish - Why publishers need to use personalised content","image":{"@type":"ImageObject","url":"https://images.assettype.com/quintype-demo/2018-03/a27aafbf-8a27-4f42-b78f-769eb04655d6/efa66751-e534-4a18-8ebe-e02189c356d9.jpg?w=1200&h=675&auto=format%2Ccompress&fit=max","width":"1200","height":"675"},"url":"https://madrid.quintype.io/politics/2018/02/28/personalise-or-perish---why-publishers-need-to-use-personalised-content","datePublished":"2018-02-28T11:11:04Z","mainEntityOfPage":{"@type":"WebPage","@id":"http://www.quintype.com/"},"publisher":{"@type":"Organization","@context":"http://schema.org","name":"Quintype","url":"http://www.quintype.com/","logo":"https://quintype.com/logo.png","sameAs":["https://www.facebook.com/quintype","https://twitter.com/quintype_inc","https://plus.google.com/+quintype","https://www.youtube.com/user/Quintype"],"id":"http://www.quintype.com/"},"author":[{"@type":"Person","givenName":"Greeshma","name":"Greeshma","url":"https://madrid.quintype.io/author/greeshma"}],"keywords":"","thumbnailUrl":"https://images.assettype.com/quintype-demo/2018-03/a27aafbf-8a27-4f42-b78f-769eb04655d6/efa66751-e534-4a18-8ebe-e02189c356d9.jpg?w=1200&h=675&auto=format%2Ccompress&fit=max","articleBody":"","dateCreated":"2018-02-28T11:11:04Z","dateModified":"2018-04-20T06:03:25Z","name":"Personalise or perish - Why publishers need to use personalised content","isPartOf":{"@type":"WebPage","url":"https://madrid.quintype.io/politics/2018/02/28/personalise-or-perish---why-publishers-need-to-use-personalised-content","primaryImageOfPage":{"@type":"ImageObject","url":"https://images.assettype.com/quintype-demo/2018-03/a27aafbf-8a27-4f42-b78f-769eb04655d6/efa66751-e534-4a18-8ebe-e02189c356d9.jpg?w=1200&h=675&auto=format%2Ccompress&fit=max","width":"1200","height":"675"}},"articleSection":"Section Name","alternativeHeadline":"","description":"Personalised content marketing is the slayer weapon in this war for attention and engagement.","hasPart":[{"@type":"WebPageElement","cssSelector":".paywall"}],"@type":"NewsArticle","@context":"http://schema.org"}</script>',
|
|
975
|
+
'<script type="application/ld+json">{"@context":"http://schema.org","@type":"BreadcrumbList","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https://madrid.quintype.io"},{"@type":"ListItem","position":2,"name":"Section Name","item":""},{"@type":"ListItem","position":3,"name":"Personalise or perish - Why publishers need to use personalised content","item":""}]}</script><script type="application/ld+json">{"headline":"Personalise or perish - Why publishers need to use personalised content","description":"Personalised content marketing is the slayer weapon in this war for attention and engagement.","author":"Greeshma","coverageEndTime":"2018-04-20T06:03:25Z","coverageStartTime":"2018-02-28T11:11:04Z","dateModified":"2018-04-20T06:03:25Z","liveBlogUpdate":[{"@type":"BlogPosting","mainEntityOfPage":{"@type":"WebPage","@id":"https://madrid.quintype.io/politics/2018/02/28/personalise-or-perish---why-publishers-need-to-use-personalised-content"},"publisher":{"@type":"Organization","@context":"http://schema.org","name":"Quintype","url":"http://www.quintype.com/","logo":"https://quintype.com/logo.png","sameAs":["https://www.facebook.com/quintype","https://twitter.com/quintype_inc","https://plus.google.com/+quintype","https://www.youtube.com/user/Quintype"],"id":"http://www.quintype.com/"},"articleBody":"","dateModified":"2018-04-20T06:03:25Z","dateCreated":"2018-02-28T11:11:04Z","datePublished":"2018-04-20T06:03:25Z","author":[{"@type":"Person","givenName":"Greeshma","name":"Greeshma","url":"https://madrid.quintype.io/author/greeshma"}],"headline":"Personalise or perish - Why publishers need to use personalised content","image":"https://images.assettype.com/quintype-demo/2018-03/a27aafbf-8a27-4f42-b78f-769eb04655d6/efa66751-e534-4a18-8ebe-e02189c356d9.jpg?w=1200&h=675&auto=format%2Ccompress&fit=max"}],"@type":"LiveBlogPosting","@context":"http://schema.org"}</script><script type="application/ld+json">{"headline":"Personalise or perish - Why publishers need to use personalised content","image":{"@type":"ImageObject","url":"https://images.assettype.com/quintype-demo/2018-03/a27aafbf-8a27-4f42-b78f-769eb04655d6/efa66751-e534-4a18-8ebe-e02189c356d9.jpg?w=1200&h=675&auto=format%2Ccompress&fit=max","width":"1200","height":"675"},"url":"https://madrid.quintype.io/politics/2018/02/28/personalise-or-perish---why-publishers-need-to-use-personalised-content","datePublished":"2018-02-28T11:11:04Z","mainEntityOfPage":{"@type":"WebPage","@id":"http://www.quintype.com/"},"publisher":{"@type":"Organization","@context":"http://schema.org","name":"Quintype","url":"http://www.quintype.com/","logo":"https://quintype.com/logo.png","sameAs":["https://www.facebook.com/quintype","https://twitter.com/quintype_inc","https://plus.google.com/+quintype","https://www.youtube.com/user/Quintype"],"id":"http://www.quintype.com/"},"author":[{"@type":"Person","givenName":"Greeshma","name":"Greeshma","url":"https://madrid.quintype.io/author/greeshma"}],"keywords":"","thumbnailUrl":"https://images.assettype.com/quintype-demo/2018-03/a27aafbf-8a27-4f42-b78f-769eb04655d6/efa66751-e534-4a18-8ebe-e02189c356d9.jpg?w=1200&h=675&auto=format%2Ccompress&fit=max","articleBody":"","dateCreated":"2018-02-28T11:11:04Z","dateModified":"2018-04-20T06:03:25Z","name":"Personalise or perish - Why publishers need to use personalised content","isPartOf":{"@type":"WebPage","url":"https://madrid.quintype.io/politics/2018/02/28/personalise-or-perish---why-publishers-need-to-use-personalised-content","primaryImageOfPage":{"@type":"ImageObject","url":"https://images.assettype.com/quintype-demo/2018-03/a27aafbf-8a27-4f42-b78f-769eb04655d6/efa66751-e534-4a18-8ebe-e02189c356d9.jpg?w=1200&h=675&auto=format%2Ccompress&fit=max","width":"1200","height":"675"}},"articleSection":"Section Name","alternativeHeadline":"","description":"Personalised content marketing is the slayer weapon in this war for attention and engagement.","hasPart":[{"@type":"WebPageElement","cssSelector":".paywall"}],"@type":"NewsArticle","@context":"http://schema.org"}</script>',
|
|
974
976
|
ampPageString
|
|
975
977
|
);
|
|
976
978
|
});
|
|
@@ -1138,7 +1140,7 @@ describe("StructuredDataTags", function () {
|
|
|
1138
1140
|
'<script type="application/ld+json">{"@context":"http://schema.org","@type":"BreadcrumbList","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https://madrid.quintype.io"},{"@type":"ListItem","position":2,"name":"Section Name","item":""},{"@type":"ListItem","position":3,"name":"Personalise or perish - Why publishers need to use personalised content","item":""}]}</script><script type="application/ld+json">{"headline":"Personalise or perish - Why publishers need to use personalised content","image":{"@type":"ImageObject","url":"https://images.assettype.com/quintype-demo/2018-03/a27aafbf-8a27-4f42-b78f-769eb04655d6/efa66751-e534-4a18-8ebe-e02189c356d9.jpg?w=1200&h=675&auto=format%2Ccompress&fit=max","width":"1200","height":"675"},"url":"https://madrid.quintype.io/politics/2018/02/28/personalise-or-perish---why-publishers-need-to-use-personalised-content","datePublished":"2018-02-28T11:11:04Z","mainEntityOfPage":{"@type":"WebPage","@id":"http://www.quintype.com/"},"publisher":{"@type":"Organization","@context":"http://schema.org","name":"Quintype","url":"http://www.quintype.com/","logo":"https://quintype.com/logo.png","sameAs":["https://www.facebook.com/quintype","https://twitter.com/quintype_inc","https://plus.google.com/+quintype","https://www.youtube.com/user/Quintype"],"id":"http://www.quintype.com/"},"author":[{"@type":"Person","givenName":"Greeshma","name":"Greeshma"}],"keywords":"","thumbnailUrl":"https://images.assettype.com/quintype-demo/2018-03/a27aafbf-8a27-4f42-b78f-769eb04655d6/efa66751-e534-4a18-8ebe-e02189c356d9.jpg?w=1200&h=675&auto=format%2Ccompress&fit=max","articleBody":"","dateCreated":"2018-02-28T11:11:04Z","dateModified":"2018-04-20T06:03:25Z","name":"Personalise or perish - Why publishers need to use personalised content","isPartOf":{"@type":"WebPage","url":"https://madrid.quintype.io/politics/2018/02/28/personalise-or-perish---why-publishers-need-to-use-personalised-content","primaryImageOfPage":{"@type":"ImageObject","url":"https://images.assettype.com/quintype-demo/2018-03/a27aafbf-8a27-4f42-b78f-769eb04655d6/efa66751-e534-4a18-8ebe-e02189c356d9.jpg?w=1200&h=675&auto=format%2Ccompress&fit=max","width":"1200","height":"675"}},"articleSection":"Section Name","@type":"Article","@context":"http://schema.org"}</script>';
|
|
1139
1141
|
assertContains(
|
|
1140
1142
|
articleTag +
|
|
1141
|
-
|
|
1143
|
+
'<script type="application/ld+json">{"actors":[{"@type":"Person","givenName":"Aishwarya Dutta","name":"Aishwarya Dutta"},{"@type":"Person","givenName":"Shariq Hassan","name":"Shariq Hassan"},{"@type":"Person","givenName":"Nithya","name":"Nithya"},{"@type":"Person","givenName":"Ramya (NSK)","name":"Ramya (NSK)"}],"directors":[{"@type":"Person","givenName":"Ritvika","name":"Ritvika"},{"@type":"Person","givenName":"Nithya","name":"Nithya"}],"name":"sarkar","sameAs":"","description":"ABCD","producer":[{"@type":"Person","givenName":"Vajpayee","name":"Vajpayee"},{"@type":"Person","givenName":"Ritvika","name":"Ritvika"},{"@type":"Person","givenName":"Mumtaj","name":"Mumtaj"}],"image":"http://thumbor-stg.assettype.com/vikatandry2/2019-03/97ff1197-f723-4745-8394-442c0f1b1dfa/0.jpg","dateCreated":"2019-03-26T11:34:37.425Z","@type":"Movie","@context":"http://schema.org"}</script>',
|
|
1142
1144
|
tags
|
|
1143
1145
|
);
|
|
1144
1146
|
assertContains(
|
package/dist/index.cjs.min.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var lodash=require("lodash"),React=require("react"),ReactDomServer=require("react-dom/server"),get=require("lodash/get"),url=require("url"),dateFnsTz=require("date-fns-tz"),isUndefined=require("lodash/isUndefined"),omitBy=require("lodash/omitBy"),quintypeJs=require("quintype-js");function _interopDefaultLegacy(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var React__default=_interopDefaultLegacy(React),ReactDomServer__default=_interopDefaultLegacy(ReactDomServer),get__default=_interopDefaultLegacy(get),isUndefined__default=_interopDefaultLegacy(isUndefined),omitBy__default=_interopDefaultLegacy(omitBy);function objectToTags(object){return lodash.entries(object).filter(([key,value])=>value).map(([key,value])=>({[getPropertyName(key)]:key,content:value}))}function getPropertyName(key){return key.startsWith("fb:")||key.startsWith("og:")?"property":"name"}function stripMillisecondsFromTime(date,timezone){const toReturn=date.toJSON();if(!toReturn)return toReturn;const zonedTime=timezone&&dateFnsTz.utcToZonedTime(date,timezone),formatZonedTime=zonedTime&&dateFnsTz.format(zonedTime,"yyyy-MM-dd'T'HH:mm:ssXXX",{timeZone:timezone}),formatToReturn=toReturn.split(".")[0]+"Z";return timezone?formatZonedTime:formatToReturn}function getQueryParams(url$1){const urlObj=new url.URL(url$1),search_params=new url.URLSearchParams(urlObj.search),getWidth=search_params.get("w")||"",getHeight=search_params.get("h")||"";return{width:getWidth,height:getHeight}}function isStoryPublic(story){return void 0===story.access||null===story.access||"public"===story.access}function showAmpTag({ampStoryPages:ampStoryPages=!0},pageType,story){return!(!ampStoryPages||"story-page"!==pageType)&&!("public"===ampStoryPages&&!isStoryPublic(story))}const getDomain=(url,domainSlug)=>{const domain=domainSlug?new URL(url).origin:"";try{return domain}catch(err){return""}};function StoryAmpTags(seoConfig,config,pageType,data={},opts){const story=get__default.default(data,["data","story"],{}),{currentHostUrl:currentHostUrl="",domainSlug:domainSlug}=data,ampUrlAppend=seoConfig.appendHostToAmpUrl?getDomain(currentHostUrl,domainSlug)||config["sketches-host"]:"",storySlug=seoConfig.decodeAmpUrl?decodeURIComponent(story.slug):encodeURIComponent(story.slug),ampUrl="visual-story"===story["story-template"]?`${ampUrlAppend}/${storySlug}`:`${ampUrlAppend}/amp/story/${storySlug}`;return showAmpTag(seoConfig,pageType,story)?[{tag:"link",rel:"amphtml",href:ampUrl}]:[]}function AuthorTags(seoConfig,config,pageType,data,{url:url}){return"story-page"!=pageType||"story-page-amp"!=pageType?[]:[{name:"twitter:creator",content:lodash.get(data,["data","story","author-name"])}]}function getTitle$1(config){return config["publisher-settings"]?config["publisher-settings"].title:config["publisher-name"]}function generateStaticData(config){const title=getTitle$1(config),themeConfig=config["theme-attributes"]||{},publicIntegrations=get__default.default(config,["public-integrations"],{}),staticData={"twitter:site":title,"twitter:domain":config["sketches-host"],"twitter:app:name:ipad":themeConfig.twitter_app_name_ipad,"twitter:app:name:googleplay":themeConfig.twitter_app_name_googleplay,"twitter:app:id:googleplay":themeConfig.twitter_app_id_googleplay,"twitter:app:name:iphone":themeConfig.twitter_app_name_iphone,"twitter:app:id:iphone":themeConfig.twitter_app_id_iphone,"apple-itunes-app":themeConfig.apple_itunes_app,"google-play-app":themeConfig.google_play_app,"fb:app_id":get__default.default(publicIntegrations,["facebook","app-id"])||get__default.default(themeConfig,["fb_app_id"]),"fb:pages":themeConfig.fb_pages,"og:site_name":title};return omitBy__default.default(staticData,isUndefined__default.default)}function generateImageObject(config={}){const{"theme-attributes":themeConfig={}}=config;return{"@context":"http://schema.org","@type":"ImageObject",author:config["publisher-name"],contentUrl:themeConfig.logo,url:themeConfig.logo,name:"logo",width:themeConfig.logo&&getQueryParams(themeConfig.logo).width,height:themeConfig.logo&&getQueryParams(themeConfig.logo).height}}function generateStructuredData(config={}){const title=getTitle$1(config),{"theme-attributes":themeConfig,"social-links":socialLinks,"seo-metadata":seoMetadata=[]}=config,homePageSeo=seoMetadata.find(page=>"home"===page["owner-type"])||{},{"page-title":pageTitle="",description:description="",keywords:keywords=""}=get__default.default(homePageSeo,["data"],{});if(!themeConfig||!themeConfig.logo)return{};let enableStructuredDataForNewsArticle=themeConfig.structured_data_news_article||!1;return config.hasOwnProperty("enableStructuredDataForNewsArticle")&&void 0!==config.enableStructuredDataForNewsArticle&&(enableStructuredDataForNewsArticle=config.enableStructuredDataForNewsArticle),{organization:{name:title,url:config["sketches-host"],logo:generateImageObject(config),sameAs:socialLinks?Object.values(socialLinks):[]},enableNewsArticle:!!enableStructuredDataForNewsArticle,storyUrlAsMainEntityUrl:!!enableStructuredDataForNewsArticle,enableVideo:!themeConfig.structured_data_enable_video,enableLiveBlog:!themeConfig.structured_data_enable_live_blog,website:{url:config["sketches-host"],searchpath:"search?q={query}",queryinput:"required name=query",name:pageTitle||title,headline:description,keywords:keywords}}}function pickImageFromCard(story,cardId){const{metadata:metadata={}}=story.cards.find(card=>card.id===cardId)||{};if(metadata&&!lodash.isEmpty(metadata)&&lodash.get(metadata,["social-share","image","key"],!1)){const alt=metadata["social-share"].image.attribution||metadata["social-share"].title||metadata["social-share"].message||getAttribution(story);return{image:new quintypeJs.FocusedImage(metadata["social-share"].image.key,metadata["social-share"].image.metadata||{}),alt:alt}}}function getAttribution(story){return story["hero-image-attribution"]||story.summary||lodash.get(story,["alternative","home","default","headline"])||story.headline}function pickImageFromStory({story:story,config:config,seoConfig:seoConfig}){function getAlt(type,key,fallback){return lodash.get(story,["alternative",`${type}`,"default","hero-image",`${key}`],fallback)}const alt=getAttribution(story),fallbackSocialImage=lodash.get(seoConfig,["fallbackSocialImage"]),altHeroImg=getAlt("home","hero-image-s3-key",null),altSocialHeroImg=getAlt("social","hero-image-s3-key",null),storyHeroImage=lodash.get(story,["hero-image-s3-key"]),logo_url=lodash.get(config,["theme-attributes","logo_url"]),logo=lodash.get(config,["theme-attributes","logo"]);if(altSocialHeroImg){const metadata=getAlt("social","hero-image-metadata",{});return{image:new quintypeJs.FocusedImage(altSocialHeroImg,metadata),alt:alt}}if(altHeroImg){const metadata=getAlt("home","hero-image-metadata",{});return{image:new quintypeJs.FocusedImage(altHeroImg,metadata),alt:alt}}if(storyHeroImage){const metadata=lodash.get(story,["hero-image-metadata"],{});return{image:new quintypeJs.FocusedImage(storyHeroImage,metadata),alt:alt}}return fallbackSocialImage?{image:fallbackSocialImage,alt:alt,includesHost:!0}:logo_url?{image:logo_url,alt:alt,includesHost:!0}:logo?{image:logo,alt:alt,includesHost:!0}:{image:void 0,alt:void 0}}function pickImageFromCollection(collection){const coverImage=lodash.get(collection,["metadata","cover-image"])||{};if(!coverImage["cover-image-s3-key"])return{};const alt=collection.summary||collection.name||null;return{image:new quintypeJs.FocusedImage(coverImage["cover-image-s3-key"],coverImage["cover-image-metadata"]||{}),alt:alt}}function pickImage({pageType:pageType,config:config,seoConfig:seoConfig,data:data,url:url}){if("story-page"===pageType&&url.query&&url.query.cardId){const story=lodash.get(data,["data","story"])||{};return pickImageFromCard(story,url.query.cardId)||pickImageFromStory({story:story,seoConfig:seoConfig,config:config})}if("visual-story"===pageType&&url.query&&url.query.cardId){const story=lodash.get(data,["story"])||{};return pickImageFromCard(story,url.query.cardId)||pickImageFromStory({story:story,seoConfig:seoConfig,config:config})}if("story-page"===pageType||"story-page-amp"===pageType){const story=lodash.get(data,["data","story"])||{};return pickImageFromStory({story:story,seoConfig:seoConfig,config:config})}if("visual-story"===pageType){const story=lodash.get(data,["story"])||{};return pickImageFromStory({story:story,seoConfig:seoConfig,config:config})}return lodash.get(data,["data","collection"])?pickImageFromCollection(lodash.get(data,["data","collection"])):{image:void 0,alt:void 0}}function ImageTags(seoConfig,config,pageType,data,{url:url={}}){const{image:image,alt:alt,includesHost:includesHost=!1}=pickImage({pageType:pageType,data:data,url:url,seoConfig:seoConfig,config:config});if(!image)return[];const tags=[];return seoConfig.enableTwitterCards&&(tags.push({name:"twitter:image",content:includesHost?image:`https://${config["cdn-image"]}/${image.path([16,9],{w:1200,auto:"format,compress",ogImage:!0,enlarge:!0})}`}),alt&&tags.push({property:"twitter:image:alt",content:alt})),seoConfig.enableOgTags&&(tags.push({property:"og:image",content:includesHost?image:`https://${config["cdn-image"]}/${image.path([40,21],{w:1200,auto:"format,compress",ogImage:!0,enlarge:!0})}`}),tags.push({property:"og:image:width",content:1200}),lodash.get(image,["metadata","focus-point"])&&tags.push({property:"og:image:height",content:630}),alt&&tags.push({property:"og:image:alt",content:alt})),tags}function StaticTags(seoConfig,config,pageType,data,{url:url}){return objectToTags(seoConfig.staticTags||{})}const getSchemaContext={"@context":"http://schema.org"};function getSchemaType(type){return{"@type":type}}function getSchemaPerson(name,url=""){return Object.assign({},getSchemaType("Person"),{givenName:name,name:name},url&&{url:url})}function getSchemaFooter({cssSelector:cssSelector}){return cssSelector?Object.assign({},getSchemaContext,getSchemaType("WPFooter"),{cssSelector:cssSelector}):{}}function getSchemaHeader({cssSelector:cssSelector}){return cssSelector?Object.assign({},getSchemaContext,getSchemaType("WPHeader"),{cssSelector:cssSelector}):{}}function getSchemaBlogPosting(card={},author={},headline="",image="",structuredData={},story={},timezone){const{website:{url:url=""}={}}=structuredData,orgUrl=lodash.get(structuredData,["organization","url"],"");return Object.assign({},getSchemaType("BlogPosting"),getSchemaMainEntityOfPage(`${url}/${story.slug}`),getSchemaPublisher(structuredData.organization,orgUrl),{dateModified:stripMillisecondsFromTime(new Date(card["card-updated-at"]),timezone),dateCreated:stripMillisecondsFromTime(new Date(card["card-added-at"]),timezone),datePublished:stripMillisecondsFromTime(new Date(card["card-updated-at"]),timezone),author:author,headline:headline,image:image})}function getSchemaPublisher(organization,orgUrl){const id={id:orgUrl};return{publisher:Object.assign({},getSchemaType("Organization"),getSchemaContext,organization,id)}}function getSchemaMainEntityOfPage(id){return{mainEntityOfPage:Object.assign({},getSchemaType("WebPage"),{"@id":id})}}function getSchemaMovieReview(movieObject={}){const movieCreatedAt=lodash.get(movieObject,["created-at"],null),actors=lodash.get(movieObject,["actors"],[]).map(actor=>getSchemaPerson(actor.name)),directors=lodash.get(movieObject,["directors"],[]).map(director=>getSchemaPerson(director.name)),producers=lodash.get(movieObject,["producers"],[]).map(producer=>getSchemaPerson(producer.name));return{actors:actors,directors:directors,name:lodash.get(movieObject,["name"],""),sameAs:lodash.get(movieObject,["sameAs"],""),description:lodash.get(movieObject,["meta-description"],""),producer:producers,image:lodash.get(movieObject,["photo","0","url"],""),dateCreated:movieCreatedAt?new Date(movieCreatedAt).toISOString():""}}function getSchemaWebsite(website={}){const{url:url,searchpath:searchpath,name:name,headline:headline,keywords:keywords,queryinput:queryinput}=website;return Object.assign({},getSchemaContext,getSchemaType("WebSite"),{url:url,interactivityType:"mixed",name:name,headline:headline,keywords:keywords,copyrightHolder:Object.assign({},getSchemaType("Organization"),{name:name}),potentialAction:{"@type":"SearchAction",target:`${url}/${searchpath}`,"query-input":queryinput}},getSchemaMainEntityOfPage(url))}function getSchemaListItem(position=0,name="",url=""){return Object.assign({},getSchemaType("ListItem"),{position:position,name:name,item:url})}function getSchemaBreadcrumbList(breadcrumbsDataList){const itemListElement=breadcrumbsDataList.map(({name:name="",url:url=""},index)=>getSchemaListItem(index+1,name,url));return Object.assign({},getSchemaContext,getSchemaType("BreadcrumbList"),{itemListElement:itemListElement})}function getMovieEntityTags(movieJson){return getSchemaMovieReview(movieJson)}function generateTagsForEntity(entity,ldJson){if(entity.type&&"movie"===entity.type.toLowerCase())return ldJson("Movie",getMovieEntityTags(entity))}function getLdJsonFields(type,fields){return Object.assign({},fields,getSchemaType(type),getSchemaContext)}function ldJson(type,fields){const json=JSON.stringify(getLdJsonFields(type,fields)).replace(/</g,"<").replace(/>/g,">");return{tag:"script",type:"application/ld+json",dangerouslySetInnerHTML:{__html:json}}}function imageUrl(publisherConfig,s3Key,width,height){const imageSrc=/^https?.*/.test(publisherConfig["cdn-image"])?publisherConfig["cdn-image"]:`https://${publisherConfig["cdn-image"]}`;return`${imageSrc}/${s3Key}?w=${width=width||""}&h=${height=height||""}&auto=format%2Ccompress&fit=max`}function generateCommonData(structuredData={},story={},publisherConfig={},timezone){const storyUrl=story.url||`${publisherConfig["sketches-host"]}/${story.slug}`,orgUrl=get__default.default(structuredData,["organization","url"],""),mainEntityUrl=Object.keys(story).length>0&&structuredData.storyUrlAsMainEntityUrl?storyUrl:get__default.default(structuredData,["organization","url"],""),imageWidth=1200,imageHeight=675;return Object.assign({},{headline:story.headline,image:[imageUrl(publisherConfig,story["hero-image-s3-key"],1200,675)],url:`${publisherConfig["sketches-host"]}/${story.slug}`,datePublished:stripMillisecondsFromTime(new Date(story["first-published-at"]),timezone)},getSchemaMainEntityOfPage(mainEntityUrl),getSchemaPublisher(structuredData.organization,orgUrl))}function authorData(authors=[],authorSchema=[],publisherConfig={}){return authorSchema.length>0?authorSchema.map(author=>getSchemaPerson(author.name,author.url)):authors.map(author=>{const authorUrl=author.slug?`${publisherConfig["sketches-host"]}/author/${author.slug}`:null;return getSchemaPerson(author.name,authorUrl)})}function getTextElementsOfCards(story){if(story&&story.cards)return story.cards.reduce((acc,currentCard)=>acc.concat(currentCard["story-elements"].filter(element=>"text"===element.type)),[])}function getPlainText(text=""){return text.replace(/<[^>]+>/g,"")}function getCompleteText(story,stripHtmlFromArticleBody){const textArray=[];getTextElementsOfCards(story).forEach(item=>{const textContent=stripHtmlFromArticleBody?getPlainText(item.text):item.text;textArray.push(textContent)});const completeCardText=textArray.join(".");return completeCardText}function articleSectionObj(story){if("video"!==story["story-template"])return{articleSection:get__default.default(story,["sections","0","display-name"],"")}}function generateArticleData(structuredData={},story={},publisherConfig={},timezone){const metaKeywords=story.seo&&story.seo["meta-keywords"]||[],authors=story.authors&&0!==story.authors.length?story.authors:[{name:story["author-name"]||""}],storyKeysPresence=Object.keys(story).length>0,imageWidth=1200,imageHeight=675,storyAccessType=storyAccess(story.access),authorSchema=structuredData.authorSchema&&structuredData.authorSchema(story)||[];return Object.assign({},generateCommonData(structuredData,story,publisherConfig,timezone),{author:authorData(authors,authorSchema,publisherConfig),keywords:metaKeywords.join(","),thumbnailUrl:imageUrl(publisherConfig,story["hero-image-s3-key"],1200,675),articleBody:storyKeysPresence&&getCompleteText(story,structuredData.stripHtmlFromArticleBody)||"",dateCreated:stripMillisecondsFromTime(new Date(story["first-published-at"]),timezone),dateModified:stripMillisecondsFromTime(new Date(story["last-published-at"]),timezone),name:storyKeysPresence&&story.headline||"",image:generateArticleImageData(story["hero-image-s3-key"],publisherConfig),isAccessibleForFree:storyAccessType,isPartOf:generateIsPartOfDataForArticle(story,publisherConfig)},articleSectionObj(story))}function generateArticleImageData(image,publisherConfig={}){const imageWidth=1200,imageHeight=675,articleImage=imageUrl(publisherConfig,image,1200,675);return Object.assign({},{"@type":"ImageObject",url:articleImage},getQueryParams(articleImage))}function storyAccess(access){return null===access||"public"===access||"login"===access||"subscription"!==access&&void 0}function generateIsPartOfDataForArticle(story={},publisherConfig={}){return Object.assign({},{"@type":"WebPage",url:`${publisherConfig["sketches-host"]}/${story.slug}`,primaryImageOfPage:generateArticleImageData(story["hero-image-s3-key"],publisherConfig)})}function generateIsPartOfDataForNewsArticle(story={},publisherConfig={},pageType="",structuredData={}){const publisherName=publisherConfig["publisher-name"],productId=`${publisherConfig["publisher-name"]}${structuredData.isShowcaseProduct?".com:showcase":".com:basic"}`,isPartOfData=generateIsPartOfDataForArticle(story,publisherConfig);return structuredData.isSubscriptionsEnabled?Object.assign(isPartOfData,{"@type":["WebPage","CreativeWork","Product"],name:publisherName,productID:productId}):"story-page-amp"===pageType&&structuredData.isAmpSubscriptionsEnabled?Object.assign({},{"@type":["WebPage","CreativeWork","Product"],name:publisherName,productID:productId,url:`${publisherConfig["sketches-host"]}/${story.slug}`,primaryImageOfPage:generateArticleImageData(story["hero-image-s3-key"],publisherConfig)}):isPartOfData}function generateHasPartData(storyAccess){return storyAccess?{}:{hasPart:[{"@type":"WebPageElement",isAccessibleForFree:storyAccess,cssSelector:".paywall"}]}}function generateNewsArticleData(structuredData={},story={},publisherConfig={},pageType=""){const{alternative:alternative={}}=story.alternative||{},storyAccessType=storyAccess(story.access);return Object.assign({},{alternativeHeadline:alternative.home&&alternative.home.default?alternative.home.default.headline:"",description:story.summary,isAccessibleForFree:storyAccessType,isPartOf:generateIsPartOfDataForNewsArticle(story,publisherConfig,pageType,structuredData)},generateHasPartData(storyAccessType))}function findStoryElementField(card,type,field,defaultValue){const elements=card["story-elements"].filter(e=>e.type==type||e.subtype==type);return elements.length>0?elements[0][field]:defaultValue}function generateLiveBlogPostingData(structuredData={},story={},publisherConfig={},timezone){const imageWidth=1200,imageHeight=675,authorSchema=structuredData.authorSchema&&structuredData.authorSchema(story)||[];return{headline:story.headline,description:story.summary||story.headline,author:story["author-name"],coverageEndTime:stripMillisecondsFromTime(new Date(story["last-published-at"]),timezone),coverageStartTime:stripMillisecondsFromTime(new Date(story["first-published-at"]),timezone),dateModified:stripMillisecondsFromTime(new Date(story["last-published-at"]),timezone),liveBlogUpdate:story.cards.map(card=>getSchemaBlogPosting(card,authorData(story.authors,authorSchema,publisherConfig),findStoryElementField(card,"title","text",story.headline),imageUrl(publisherConfig,findStoryElementField(card,"image","image-s3-key",story["hero-image-s3-key"]),1200,675),structuredData,story,timezone))}}function getEmbedUrl(cards){let embedUrl="";return cards.find(card=>{const storyElements=get__default.default(card,["story-elements"],[]);return storyElements.find(elem=>!!elem["embed-url"]&&(embedUrl=elem["embed-url"],!0))}),embedUrl}function generateVideoArticleData(structuredData={},story={},publisherConfig={},timezone){const metaKeywords=story.seo&&story.seo["meta-keywords"]||[],storyCards=get__default.default(story,["cards"],[]),embedUrl=getEmbedUrl(storyCards),socialShareMsg=get__default.default(story,["summary"],""),metaDescription=get__default.default(story,["seo","meta-description"],""),subHeadline=get__default.default(story,["subheadline"],""),headline=get__default.default(story,["headline"],""),imageWidth=1200,imageHeight=675,authorSchema=structuredData.authorSchema&&structuredData.authorSchema(story)||[];return Object.assign({},generateCommonData(structuredData,story,publisherConfig,timezone),{author:authorData(story.authors,authorSchema,publisherConfig),keywords:metaKeywords.join(","),dateCreated:stripMillisecondsFromTime(new Date(story["first-published-at"]),timezone),dateModified:stripMillisecondsFromTime(new Date(story["last-published-at"]),timezone),description:socialShareMsg||metaDescription||subHeadline||headline,name:story.headline,thumbnailUrl:[imageUrl(publisherConfig,story["hero-image-s3-key"],1200,675)],uploadDate:stripMillisecondsFromTime(new Date(story["last-published-at"]),timezone),embedUrl:embedUrl})}function generateWebSiteData(structuredData={},story={},publisherConfig={}){return getSchemaWebsite(structuredData.website)}function generateBreadcrumbListData(pageType="",publisherConfig={},data={}){const{"sketches-host":domain="",sections:sections=[]}=publisherConfig;let breadcrumbsDataList=[{name:"Home",url:domain}];function addCrumb(crumbsDataList=[],currentSection={}){if(!currentSection["parent-id"])return crumbsDataList;const parentSection=sections.find(section=>section.id===currentSection["parent-id"]);if(!parentSection)return crumbsDataList;const{"section-url":url="",name:name=""}=parentSection;return crumbsDataList.unshift({url:url,name:name}),addCrumb(crumbsDataList,parentSection)}function getSectionPageCrumbs(section={}){const{"section-url":url="",name:name=""}=section,crumbsDataList=[{url:url,name:name}];return addCrumb(crumbsDataList,section)}function getStoryPageCrumbs({headline:headline="",url:url="",sections:[storySection]}={}){let sectionCrumbsDataList=[];return storySection&&(sectionCrumbsDataList=getSectionPageCrumbs(storySection)),sectionCrumbsDataList.push({name:headline,url:url}),sectionCrumbsDataList}function getBreadCrumbs(breadcrumb={}){const crumbsDataList=[{url:breadcrumb.url,name:breadcrumb.name}];return addCrumb(crumbsDataList)}if(data.breadcrumbs&&"name"in data.breadcrumbs&&"url"in data.breadcrumbs)return breadcrumbsDataList=breadcrumbsDataList.concat(getBreadCrumbs(data.breadcrumbs)),getSchemaBreadcrumbList(breadcrumbsDataList);switch(pageType){case"section-page":breadcrumbsDataList=breadcrumbsDataList.concat(getSectionPageCrumbs(data.section));break;case"story-page":case"story-page-amp":breadcrumbsDataList=breadcrumbsDataList.concat(getStoryPageCrumbs(data.story))}return getSchemaBreadcrumbList(breadcrumbsDataList)}function StructuredDataTags({structuredData:structuredData={}},config,pageType,response={},{url:url}){const tags=[],{story:story={},timezone:timezone=null}=response.data||{},entities=get__default.default(response,["data","linkedEntities"],null)||[],{config:publisherConfig={}}=response;publisherConfig["publisher-settings"];const isStructuredDataEmpty=0===Object.keys(structuredData).length,enableBreadcrumbList=get__default.default(structuredData,["enableBreadcrumbList"],!0),structuredDataTags=get__default.default(structuredData,["structuredDataTags"],[]);let articleData={};if(isStructuredDataEmpty||(articleData=generateArticleData(structuredData,story,publisherConfig,timezone),structuredDataTags.map(type=>{pageType===type&&(tags.push(ldJson("Organization",structuredData.organization)),structuredData.website&&tags.push(ldJson("Website",Object.assign({},generateWebSiteData(structuredData,story,publisherConfig)))))})),isStructuredDataEmpty||"home-page"!==pageType||(tags.push(ldJson("Organization",structuredData.organization)),structuredData.website&&tags.push(ldJson("Website",Object.assign({},generateWebSiteData(structuredData,story,publisherConfig))))),!isStructuredDataEmpty&&enableBreadcrumbList&&tags.push(ldJson("BreadcrumbList",generateBreadcrumbListData(pageType,publisherConfig,response.data))),!isStructuredDataEmpty&&"story-page"===pageType){const newsArticleTags=generateNewsArticleTags();newsArticleTags?tags.push(storyTags(),newsArticleTags):tags.push(storyTags())}if(!isStructuredDataEmpty&&"story-page-amp"===pageType){const newsArticleTags=generateNewsArticleTags();newsArticleTags?tags.push(storyTags(),newsArticleTags):tags.push(storyTags())}if(!isStructuredDataEmpty&&structuredData.header&&tags.push(ldJson("WPHeader",getSchemaHeader(structuredData.header))),!isStructuredDataEmpty&&structuredData.footer&&tags.push(ldJson("WPFooter",getSchemaFooter(structuredData.footer))),entities.length>0)for(let entity of entities){const entityTags=generateTagsForEntity(entity,ldJson);entityTags&&tags.push(entityTags)}function generateNewsArticleTags(){if(structuredData.enableNewsArticle)return ldJson("NewsArticle",Object.assign({},articleData,generateNewsArticleData(structuredData,story,publisherConfig,pageType)))}function storyTags(){return structuredData.enableLiveBlog&&"live-blog"===story["story-template"]?ldJson("LiveBlogPosting",Object.assign({},generateLiveBlogPostingData(structuredData,story,publisherConfig,timezone))):structuredData.enableVideo&&"video"===story["story-template"]?ldJson("VideoObject",generateVideoArticleData(structuredData,story,publisherConfig,timezone)):"withoutArticleSchema"!==structuredData.enableNewsArticle?ldJson("Article",articleData):{}}return tags}function buildTagsFromStory(config,story,url={},data={}){if(!story)return;function getStoryCardMetadata(cardId){const{metadata:metadata={}}=story.cards.find(card=>card.id===cardId)||{},urlWithCardId=`${config["sketches-host"]}/${story.slug}?cardId=${cardId}`;return metadata&&!lodash.isEmpty(metadata)&&metadata["social-share"]?{title:metadata["social-share"].title||story.headline,description:metadata["social-share"].message||story.summary,ogUrl:urlWithCardId,ogTitle:metadata["social-share"].title||story.headline,ogDescription:metadata["social-share"].message||story.summary}:metadata}const seo=story.seo||{},storyUrl=story.url||`${config["sketches-host"]}/${story.slug}`,customSeo=lodash.get(data,["data","customSeo"],{}),authors=lodash.get(story,["authors"],[]).map(author=>author.name),title=customSeo.title||seo["meta-title"]||story.headline,pageTitle=customSeo["page-title"]||seo["meta-title"]||story.headline,description=customSeo.description||seo["meta-description"]||story.summary,keywords=(customSeo.keywords||seo["meta-keywords"]||(story.tags||[]).map(tag=>tag.name)).join(","),ogUrl=customSeo.ogUrl||lodash.get(seo,["og","url"])||storyUrl,getOgTitle=customSeo.ogTitle||lodash.get(story,["alternative","social","default","headline"],story.headline)||story.headline,ogDescription=customSeo.ogDescription||story.summary,storyMetaData={title:title,"page-title":pageTitle,description:description,keywords:keywords,canonicalUrl:story["canonical-url"]||storyUrl,ogUrl:ogUrl,ogTitle:getOgTitle,ogDescription:ogDescription,storyUrl:storyUrl,author:authors};if(url.query&&url.query.cardId){const storyCardMetadata=getStoryCardMetadata(url.query.cardId);return Object.assign({},storyMetaData,storyCardMetadata)}return storyMetaData}function buildTagsFromTopic(config,tag,url={},data){if(lodash.isEmpty(tag))return;const customSeo=lodash.get(data,["data","customSeo"],{}),tagName=customSeo.title||tag["meta-title"]||tag.name,pageTitle=customSeo["page-title"]||tagName,tagDescription=customSeo.description||tag["meta-description"],description=`Read stories listed under on ${tag.name}`,tagUrl=`${config["sketches-host"]}${url.pathname}`,canonicalSlug=tag["canonical-slug"]||url.pathname,canonicalUrl=`${config["sketches-host"]}${canonicalSlug}`,ogTitle=customSeo.ogTitle||tagName,ogDescription=customSeo.ogDescription||description,topicMetaData={title:tagName,"page-title":pageTitle,description:tagDescription||description,keywords:tagName,canonicalUrl:canonicalUrl,ogUrl:tagUrl,ogTitle:ogTitle,ogDescription:ogDescription};return topicMetaData}function buildTagsFromAuthor(config,author,url={},data){if(lodash.isEmpty(author))return;const customSeo=lodash.get(data,["data","customSeo"],{}),title=customSeo.title||author.name,pageTitle=customSeo["page-title"]||title,description=customSeo.description||author.bio||`View all articles written by ${title}`,ogTitle=customSeo.ogTitle||author.name,authorUrl=`${config["sketches-host"]}${url.pathname}`,ogDescription=customSeo.ogDescription||description;return{title:title,"page-title":pageTitle,description:description,keywords:`${title},${config["publisher-name"]}`,canonicalUrl:authorUrl,ogUrl:authorUrl,ogTitle:ogTitle,ogDescription:ogDescription}}function buildCustomTags(customTags={},pageType=""){const configObject=customTags[pageType];return configObject||{}}function buildTagsFromStaticPage(config,page,url={},data){const seoData=lodash.get(page,["metadata","seo"],{}),customSeo=lodash.get(data,["data","customSeo"],{});if(lodash.isEmpty(seoData)&&lodash.isEmpty(customSeo))return;const{"meta-title":metaTitle,"meta-description":metaDescription,"meta-keywords":keywords}=seoData,title=customSeo.title||metaTitle||page.title,pageTitle=customSeo["page-title"]||title,description=customSeo.description||metaDescription,ogTitle=customSeo.ogTitle||title,staticPageUrl=`${config["sketches-host"]}${url.pathname}`,ogDescription=customSeo.ogDescription||description;return{title:title,"page-title":pageTitle,description:description,keywords:`${title},${config["publisher-name"]}`,canonicalUrl:staticPageUrl,ogUrl:staticPageUrl,ogTitle:ogTitle,ogDescription:ogDescription,keywords:customSeo.keywords||keywords}}function getSeoData(config,pageType,data,url={},seoConfig={}){function findRelevantConfig(ownerType,ownerId=null){const seoMetadata=config["seo-metadata"].find(page=>page["owner-type"]===ownerType&&page["owner-id"]===ownerId)||{},{sections:sections=[]}=config,section=sections.find(section=>"section"==ownerType&§ion.id===ownerId)||{},customSeo=lodash.get(data,["data","customSeo"],{});if(seoMetadata.data||section.id||!lodash.isEmpty(customSeo)){const result=Object.assign({},{"page-title":customSeo["page-title"]||section.name,title:customSeo.title||section.name,canonicalUrl:customSeo.canonicalUrl||section["section-url"]||void 0},seoMetadata.data);if(!result.description){const homeSeoData=config["seo-metadata"].find(page=>"home"===page["owner-type"])||{data:{description:""}};result.description=customSeo.description||homeSeoData.data.description}return result.ogTitle=customSeo.ogTitle||result.title,result.ogDescription=customSeo.ogDescription||result.description,result}}if(seoConfig.customTags&&seoConfig.customTags[pageType])return buildCustomTags(seoConfig.customTags,pageType);function getShellSeoData(config){const seoMetadata=config["seo-metadata"].find(meta=>"home"===meta["owner-type"])||{};return Object.assign({},seoMetadata.data,{canonicalUrl:SKIP_CANONICAL})}switch(pageType){case"home-page":return findRelevantConfig("home");case"section-page":return findRelevantConfig("section",lodash.get(data,["data","section","id"]))||getSeoDataFromCollection(config,data)||getSeoData(config,"home-page",data,url);case"collection-page":return getSeoDataFromCollection(config,data)||getSeoData(config,"home-page",data,url);case"tag-page":return buildTagsFromTopic(config,lodash.get(data,["data","tag"]),url,data)||getSeoData(config,"home-page",data,url);case"story-page":return buildTagsFromStory(config,lodash.get(data,["data","story"]),url,data)||getSeoData(config,"home-page",data,url);case"visual-story":return buildTagsFromStory(config,lodash.get(data,["story"]),url,data)||getSeoData(config,"home-page",data,url);case"story-page-amp":return buildTagsFromStory(config,lodash.get(data,["data","story"]),url,data)||getSeoData(config,"home-page",data,url);case"author-page":return buildTagsFromAuthor(config,lodash.get(data,["data","author"],{}),url,data)||getSeoData(config,"home-page",data,url);case"static-page":return buildTagsFromStaticPage(config,lodash.get(data,["data","page"],{}),url,data)||getSeoData(config,"home-page",data,url);case"shell":return getShellSeoData(config);default:return getSeoData(config,"home-page",data,url)}}function getSeoDataFromCollection(config,data){if(lodash.get(data,["data","collection","name"])){let{name:name,summary:summary}=lodash.get(data,["data","collection"]);const customSeo=lodash.get(data,["data","customSeo"],{});summary||(summary=(getSeoData(config,"home-page",data)||{}).description);const title=customSeo.title||name,pageTitle=customSeo["page-title"]||name,ogTitle=customSeo.ogTitle||title,description=customSeo.description||summary,ogDescription=customSeo.ogDescription||summary;return{"page-title":pageTitle,title:title,ogTitle:ogTitle,description:description,ogDescription:ogDescription,canonicalUrl:SKIP_CANONICAL}}}const SKIP_CANONICAL="__SKIP__CANONICAL__";function TextTags(seoConfig,config,pageType,data,{url:url}){const seoData=getSeoData(config,pageType,data,url,seoConfig),customSeo=lodash.get(data,["data","customSeo"],{});if(!seoData)return[];const currentUrl=`${config["sketches-host"]}${url.pathname}`,basicTags={description:customSeo.description||seoData.description,title:customSeo.title||seoData.title,keywords:customSeo.keywords||seoData.keywords},ogUrl=customSeo.ogUrl||seoData.ogUrl||seoData.canonicalUrl||currentUrl,ogTags=seoConfig.enableOgTags?{"og:type":"story-page"===pageType||"story-page-amp"===pageType?"article":"website","og:url":ogUrl===SKIP_CANONICAL?void 0:ogUrl,"og:title":customSeo.ogTitle||seoData.ogTitle,"og:description":customSeo.ogDescription||seoData.ogDescription}:void 0,twitterTags=seoConfig.enableTwitterCards?{"twitter:card":"summary_large_image","twitter:title":customSeo.twitterTitle||seoData.ogTitle,"twitter:description":customSeo.twitterDescription||seoData.ogDescription}:void 0,allTags=Object.assign(basicTags,ogTags,twitterTags),commonTags=[{tag:"title",children:customSeo.title||data.title||seoData["page-title"]}],canonical=seoData.canonicalUrl||currentUrl;return canonical!=SKIP_CANONICAL&&commonTags.push({tag:"link",rel:"canonical",href:canonical}),"story-page"!==pageType&&"story-page-amp"!==pageType||commonTags.push({name:"author",content:seoData.author}),"story-page"!==pageType&&"story-page-amp"!==pageType||!seoConfig.enableNews||(commonTags.push({name:"news_keywords",content:seoData.keywords}),lodash.get(data,["data","story","seo","meta-google-news-standout"])&&commonTags.push({tag:"link",rel:"standout",href:seoData.storyUrl||currentUrl})),commonTags.concat(objectToTags(allTags))}function getTitle(seoConfig,config,pageType,data,params){const customSeo=lodash.get(data,["data","customSeo"],{});if(lodash.get(data,["title"]))return customSeo.title||lodash.get(data,["title"]);if(lodash.get(data,["data","title"]))return customSeo.title||lodash.get(data,["data","title"]);const seoData=getSeoData(config,pageType,data,void 0,seoConfig)||{};return customSeo.title||seoData["page-title"]}function tagToKey(tag){switch(tag.tag||"meta"){case"meta":return`meta-${tag.name||tag.itemprop||"name"}-${tag.property||"property"}`;case"link":return`link-${tag.rel}`;case"title":return"title";default:return Math.random().toString()}}class MetaTagList{constructor(tags){this.tags=tags}toString(){const uniqueTags=lodash.uniqBy(this.tags.reverse(),tagToKey).reverse();return ReactDomServer__default.default.renderToStaticMarkup(uniqueTags.map(tag=>React__default.default.createElement(tag.tag||"meta",lodash.omit(tag,"tag"))))}addTag(){return new MetaTagList(this.tags.concat([].slice.call(arguments)))}}class SEO{constructor(seoConfig={}){this.seoConfig=seoConfig,this.generators=(seoConfig.generators||[TextTags,ImageTags,AuthorTags,StaticTags,StructuredDataTags,StoryAmpTags]).concat(seoConfig.extraGenerators||[])}getMetaTags(config,pageType,data,params={}){return pageType=lodash.get(this.seoConfig,["pageTypeAliases",pageType],pageType),new MetaTagList(lodash.flatMap(this.generators,generator=>generator(this.seoConfig,config,pageType,data,params)))}getTitle(config,pageType,data,params={}){return getTitle(this.seoConfig,config,pageType,data)}}exports.AuthorTags=AuthorTags,exports.ImageTags=ImageTags,exports.MetaTagList=MetaTagList,exports.SEO=SEO,exports.StaticTags=StaticTags,exports.StoryAmpTags=StoryAmpTags,exports.StructuredDataTags=StructuredDataTags,exports.TextTags=TextTags,exports.generateStaticData=generateStaticData,exports.generateStructuredData=generateStructuredData;
|