Skip to content

Commit

Permalink
added: META_SHARE_INFO brand variable to dynamically change meta shar…
Browse files Browse the repository at this point in the history
…ing info
  • Loading branch information
Gabriele Panico committed Oct 9, 2024
1 parent bea6318 commit a9507c5
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions src/app/chatbot-design-studio/BrandResources.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,15 @@ export class BrandResources {
var icon = document.querySelector("link[rel~='icon']") as HTMLElement;
icon.setAttribute('href', this.brand['FAVICON_URL'])

/** META sharing ELEMENTS */
if(this.brand['META_SHARE_INFO'] && this.brand['META_SHARE_INFO'].length > 0){
Object.keys(this.brand['META_SHARE_INFO']).forEach(key => {
var meta = document.querySelector("meta[property^='og:"+key.toLowerCase()+"']") as HTMLElement;
meta.setAttribute('content', this.brand['META_SHARE_INFO'][key])
})
}


/** CSS */
document.documentElement.style.setProperty('--base-brand-color', this.brand['BRAND_PRIMARY_COLOR']);

Expand Down

0 comments on commit a9507c5

Please sign in to comment.