fix(metadata): update package metadata and align company schema integration with latest tsclass types
This commit is contained in:
@@ -4,7 +4,7 @@ import * as interfaces from './interfaces/index.js';
|
||||
import { Tag } from './websetup.classes.tag.js';
|
||||
|
||||
export class JsonLdTag extends Tag {
|
||||
public static createCompanyJsonLd(companyDataArg: plugins.tsclass.business.ICompany) {
|
||||
public static createCompanyJsonLd(companyDataArg: plugins.tsclass.business.TCompany) {
|
||||
// STATIC
|
||||
// lets care about linked data
|
||||
const companyLd = {
|
||||
@@ -12,24 +12,26 @@ export class JsonLdTag extends Tag {
|
||||
'@type': 'Corporation',
|
||||
name: companyDataArg.name,
|
||||
alternateName: companyDataArg.name.replace(' GmbH', ''),
|
||||
url: companyDataArg.contact.website,
|
||||
logo: companyDataArg.contact.logoUrl,
|
||||
url: companyDataArg.website,
|
||||
logo: companyDataArg.logoUrl,
|
||||
contactPoint: {
|
||||
'@type': 'ContactPoint',
|
||||
telephone: companyDataArg.contact.phone,
|
||||
telephone: companyDataArg.phone,
|
||||
contactType: 'customer service',
|
||||
areaServed: 'DE',
|
||||
availableLanguage: ['en', 'German'],
|
||||
},
|
||||
sameAs: [],
|
||||
sameAs: [] as string[],
|
||||
};
|
||||
|
||||
if (companyDataArg.contact.facebookUrl) {
|
||||
companyLd.sameAs.push(companyDataArg.contact.facebookUrl);
|
||||
const facebookUrl = companyDataArg.socials?.find((socialArg) => socialArg.type === 'facebook')?.url;
|
||||
if (facebookUrl) {
|
||||
companyLd.sameAs.push(facebookUrl);
|
||||
}
|
||||
|
||||
if (companyDataArg.contact.twitterUrl) {
|
||||
companyLd.sameAs.push(companyDataArg.contact.twitterUrl);
|
||||
const twitterUrl = companyDataArg.socials?.find((socialArg) => socialArg.type === 'twitter')?.url;
|
||||
if (twitterUrl) {
|
||||
companyLd.sameAs.push(twitterUrl);
|
||||
}
|
||||
|
||||
const ldTag = new JsonLdTag(companyLd);
|
||||
@@ -67,7 +69,7 @@ export class JsonLdTag extends Tag {
|
||||
}
|
||||
public static createProductJsonLd(
|
||||
productArg: plugins.tsclass.saas.IProduct,
|
||||
publisherArg: plugins.tsclass.business.ICompany
|
||||
publisherArg?: plugins.tsclass.business.TCompany
|
||||
) {
|
||||
const productLd = {
|
||||
'@context': 'https://schema.org',
|
||||
@@ -87,7 +89,7 @@ export class JsonLdTag extends Tag {
|
||||
priceCurrency: 'EUR',
|
||||
},
|
||||
},
|
||||
publisher: this.createCompanyJsonLd(publisherArg).elementRef.textContent,
|
||||
publisher: publisherArg ? this.createCompanyJsonLd(publisherArg).elementRef.textContent : undefined,
|
||||
screenshot: 'https://www.social.io/screenshot.png',
|
||||
url: 'https://www.social.io/',
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user