Compare commits

...

4 Commits

Author SHA1 Message Date
782c9cd740 3.0.7 2020-11-05 17:27:10 +00:00
b8ab19a683 fix(core): update 2020-11-05 17:27:10 +00:00
e47869caed 3.0.6 2020-11-05 17:15:28 +00:00
4f06c5d7c5 fix(core): update 2020-11-05 17:15:27 +00:00
4 changed files with 16 additions and 3 deletions

2
package-lock.json generated
View File

@ -1,6 +1,6 @@
{
"name": "@pushrocks/websetup",
"version": "3.0.5",
"version": "3.0.7",
"lockfileVersion": 1,
"requires": true,
"dependencies": {

View File

@ -1,6 +1,6 @@
{
"name": "@pushrocks/websetup",
"version": "3.0.5",
"version": "3.0.7",
"private": false,
"description": "setup basic page properties",
"main": "dist_ts/index.js",

View File

@ -63,6 +63,8 @@ export class JsonLdTag extends Tag {
},
"description": newsArticleArg.author.firstName
};
const ldTag = new JsonLdTag(newsArticleArg);
return ldTag;
}
constructor(ldObjectArg: any) {

View File

@ -6,6 +6,8 @@ import * as plugins from './websetup.plugins';
export type TBaseLevelType = 'global' | 'base' | 'subpage';
export type TLevelState = 'enabled' | 'disabled';
export class TagLevel {
public tagManagerRef: TagManager;
@ -13,12 +15,17 @@ export class TagLevel {
public type: TBaseLevelType;
public tags: Tag[] = [];
public state: TLevelState = 'disabled';
constructor(tagManagerRefArg: TagManager, levelType: TBaseLevelType) {
this.tagManagerRef = tagManagerRefArg;
}
public addTag(tagArg: Tag) {
this.tags.push(tagArg);
if (this.state === 'enabled') {
tagArg.appendToDom();
}
}
public async addCompanyInfo(companyDataArg: plugins.tsclass.business.ICompany) {
@ -52,7 +59,9 @@ export class TagLevel {
);
}
public addPostInfo() {}
public addNewsArticleInfo(articleArg: plugins.tsclass.content.IArticle) {
this.addTag(JsonLdTag.createNewsArticleLd(articleArg));
}
public async enable() {
if (this.title) {
@ -61,11 +70,13 @@ export class TagLevel {
for (const tagArg of this.tags) {
tagArg.appendToDom();
}
this.state = 'enabled';
}
public async disable() {
for (const tagArg of this.tags) {
tagArg.removeFromDom();
}
this.state = 'disabled';
}
}