From bd8585aa42b5d61ba85ed5db67be5aaf82c200e6 Mon Sep 17 00:00:00 2001 From: Philipp Kunz Date: Mon, 8 May 2023 10:07:33 +0200 Subject: [PATCH] fix(core): update --- ts/00_commitinfo_data.ts | 2 +- ts/websetup.classes.tag.opengraphtag.ts | 10 ++++++++++ ts/websetup.classes.taglevel.ts | 1 + 3 files changed, 12 insertions(+), 1 deletion(-) diff --git a/ts/00_commitinfo_data.ts b/ts/00_commitinfo_data.ts index d83e506..1e0c37f 100644 --- a/ts/00_commitinfo_data.ts +++ b/ts/00_commitinfo_data.ts @@ -3,6 +3,6 @@ */ export const commitinfo = { name: '@pushrocks/websetup', - version: '3.0.17', + version: '3.0.18', description: 'setup basic page properties' } diff --git a/ts/websetup.classes.tag.opengraphtag.ts b/ts/websetup.classes.tag.opengraphtag.ts index e47caea..749fd56 100644 --- a/ts/websetup.classes.tag.opengraphtag.ts +++ b/ts/websetup.classes.tag.opengraphtag.ts @@ -11,6 +11,16 @@ export class OpengraphTag extends Tag { return tagArray; } + public static createProductOgTags(productArg: plugins.tsclass.saas.IProduct) { + const tagArray: OpengraphTag[] = []; + tagArray.push(new OpengraphTag('og:url', globalThis.location.href)); + tagArray.push(new OpengraphTag('og:title', productArg.name)); + tagArray.push(new OpengraphTag('og:site_name', productArg.name)) + tagArray.push(new OpengraphTag('og:description', productArg.description)); + tagArray.push(new OpengraphTag('og:image', productArg.logoLink)); + return tagArray; + } + constructor(propertyNameArg: string, contentArg: string) { super(); const openGraphElement = document.createElement('meta'); diff --git a/ts/websetup.classes.taglevel.ts b/ts/websetup.classes.taglevel.ts index dc58962..8899a4c 100644 --- a/ts/websetup.classes.taglevel.ts +++ b/ts/websetup.classes.taglevel.ts @@ -82,6 +82,7 @@ export class TagLevel { public addProductInfo(productArg: plugins.tsclass.saas.IProduct, companyArg: plugins.tsclass.business.ICompany) { this.addTag(JsonLdTag.createProductJsonLd(productArg, companyArg)); + this.addTag(OpengraphTag.createProductOgTags(productArg)); } public async enable() {