fix(core): update

This commit is contained in:
2020-11-06 01:11:26 +00:00
parent 0294895f78
commit 7fa14ceabd
5 changed files with 51 additions and 29 deletions

View File

@@ -35,35 +35,33 @@ export class JsonLdTag extends Tag {
return ldTag;
}
public static createNewsArticleLd (newsArticleArg: plugins.tsclass.content.IArticle) {
public static createNewsArticleJsonLd(newsArticleArg: plugins.tsclass.content.IArticle) {
const newsArticleLd = {
"@context": "https://schema.org",
"@type": "NewsArticle",
"mainEntityOfPage": {
"@type": "WebPage",
"@id": window.location.href
'@context': 'https://schema.org',
'@type': 'NewsArticle',
mainEntityOfPage: {
'@type': 'WebPage',
'@id': window.location.href,
},
"headline": "Article headline",
"image": [
newsArticleArg.featuredImageUrl
],
"datePublished": new Date(newsArticleArg.timestamp).toISOString(),
"dateModified": new Date(newsArticleArg.timestamp).toISOString(),
"author": {
"@type": "Person",
"name": `${newsArticleArg.author.firstName} ${newsArticleArg.author.surName}`
headline: 'Article headline',
image: [newsArticleArg.featuredImageUrl],
datePublished: new Date(newsArticleArg.timestamp).toISOString(),
dateModified: new Date(newsArticleArg.timestamp).toISOString(),
author: {
'@type': 'Person',
name: `${newsArticleArg.author.firstName} ${newsArticleArg.author.surName}`,
},
"publisher": {
"@type": "Organization",
"name": newsArticleArg.author.surName, // TODO
"logo": {
"@type": "ImageObject",
"url": newsArticleArg.author.surName // TODO
}
publisher: {
'@type': 'Organization',
name: newsArticleArg.author.surName, // TODO
logo: {
'@type': 'ImageObject',
url: newsArticleArg.author.surName, // TODO
},
},
"description": newsArticleArg.author.firstName
description: newsArticleArg.author.firstName,
};
const ldTag = new JsonLdTag(newsArticleArg);
const ldTag = new JsonLdTag(newsArticleLd);
return ldTag;
}