@gudhub/ssg-web-components-library 1.0.21 → 1.0.23
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json
CHANGED
|
@@ -13,7 +13,6 @@ class CounterSectionWithText extends GHComponent {
|
|
|
13
13
|
this.ghId = this.getAttribute('data-gh-id') || null;
|
|
14
14
|
|
|
15
15
|
const getCurrentChapter = await window?.getCurrentChapter();
|
|
16
|
-
console.log('sdf', getCurrentChapter);
|
|
17
16
|
this.chapter = getCurrentChapter ? getCurrentChapter : 'pages';
|
|
18
17
|
|
|
19
18
|
this.json = await super.getGhData(this.ghId, this.chapter);
|
|
@@ -8,7 +8,6 @@ class HtmlTemplate extends GHComponent {
|
|
|
8
8
|
|
|
9
9
|
let chapter = await window.getCurrentChapter();
|
|
10
10
|
let ids = await super.findIds(chapter);
|
|
11
|
-
|
|
12
11
|
let customHtml;
|
|
13
12
|
|
|
14
13
|
try {
|
|
@@ -19,16 +18,21 @@ class HtmlTemplate extends GHComponent {
|
|
|
19
18
|
customHtml = await fetch(fileInfo.url);
|
|
20
19
|
customHtml = await customHtml.text();
|
|
21
20
|
} catch (error) {
|
|
22
|
-
console.log(error)
|
|
23
21
|
customHtml = false;
|
|
24
22
|
}
|
|
25
23
|
if (customHtml) {
|
|
26
24
|
const body = document.querySelector('body');
|
|
27
|
-
|
|
25
|
+
const wrapper = document.createElement('div');
|
|
26
|
+
wrapper.id = 'layout';
|
|
27
|
+
wrapper.innerHTML = customHtml;
|
|
28
|
+
|
|
29
|
+
body.appendChild(wrapper);
|
|
28
30
|
|
|
29
31
|
const links = body.querySelectorAll('link');
|
|
30
32
|
this.attachLinks(links);
|
|
31
33
|
}
|
|
34
|
+
|
|
35
|
+
this.remove();
|
|
32
36
|
}
|
|
33
37
|
|
|
34
38
|
attachLinks(links) {
|
|
@@ -48,7 +48,10 @@ class CanonicalComponent extends GHComponent {
|
|
|
48
48
|
let ids = await super.findIds('blog');
|
|
49
49
|
await this.findCanonical(ids.appId, ids.itemId, `/blog/${category}/${article}/`);
|
|
50
50
|
} else {
|
|
51
|
-
|
|
51
|
+
const getCurrentChapter = await window?.getCurrentChapter();
|
|
52
|
+
const currentChapter = getCurrentChapter ? getCurrentChapter : 'pages';
|
|
53
|
+
|
|
54
|
+
let ids = await super.findIds(currentChapter);
|
|
52
55
|
await this.findCanonical(ids.appId, ids.itemId, false);
|
|
53
56
|
}
|
|
54
57
|
}
|
|
@@ -53,14 +53,19 @@ class MetaTag extends GHComponent {
|
|
|
53
53
|
let ids = await super.findIds('blog');
|
|
54
54
|
await this.addTag(ids.appId, ids.itemId, `/blog/${category}/${article}/`, 'blog');
|
|
55
55
|
} else {
|
|
56
|
-
|
|
57
|
-
|
|
56
|
+
debugger;
|
|
57
|
+
const getCurrentChapter = await window?.getCurrentChapter();
|
|
58
|
+
const currentChapter = getCurrentChapter ? getCurrentChapter : 'pages';
|
|
59
|
+
|
|
60
|
+
let ids = await super.findIds(currentChapter);
|
|
61
|
+
await this.addTag(ids.appId, ids.itemId, false, currentChapter);
|
|
58
62
|
}
|
|
59
63
|
}
|
|
60
64
|
}
|
|
61
65
|
|
|
62
66
|
}
|
|
63
67
|
async addTag (appId, itemId, slug, chapter) {
|
|
68
|
+
debugger;
|
|
64
69
|
const app = await gudhub.getApp(appId);
|
|
65
70
|
const items = app.items_list;
|
|
66
71
|
let item;
|