@gudhub/ssg-web-components-library 1.0.104 → 1.0.106

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
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@gudhub/ssg-web-components-library",
3
- "version": "1.0.104",
3
+ "version": "1.0.106",
4
4
  "description": "",
5
5
  "main": "index.js",
6
6
  "type": "module",
@@ -32,7 +32,7 @@ class CategoryBanner extends GHComponent {
32
32
  const items = await gudhub.getItems(ids.appId);
33
33
  const item = items.find(item => item.item_id == ids.itemId);
34
34
 
35
- let description = await fetch(`https://gudhub.com/userdata/${ids.appId}/${item.fields.find(field => field.field_id == window.getConfig().chapters.blog.description_field_id).field_value}.html?t=${new Date().getTime()}`);
35
+ let description = await fetch(`https://app.gudhub.com/userdata/${ids.appId}/${item.fields.find(field => field.field_id == window.getConfig().chapters.blog.description_field_id).field_value}.html?t=${new Date().getTime()}`);
36
36
  description = await description.text();
37
37
 
38
38
  let div = document.createElement('div');
@@ -111,7 +111,7 @@ class CommentsComponent extends GHComponent {
111
111
 
112
112
  if (comment.name && comment.text) {
113
113
  const { api_app_id } = window.getConfig().chapters.blog;
114
- const response = await fetch(`https://gudhub.com/api/services/prod/api/${api_app_id}/add-comment`, {
114
+ const response = await fetch(`https://app.gudhub.com/api/services/api/${api_app_id}/add-comment`, {
115
115
  method: 'POST',
116
116
  headers: {
117
117
  'Content-Type': 'application/json'
@@ -309,7 +309,7 @@ class PostsTemplate extends GHComponent {
309
309
 
310
310
  const { api_app_id } = window.getConfig().chapters.blog;
311
311
 
312
- const response = await fetch(`https://gudhub.com/api/services/prod/api/${api_app_id}/articles`);
312
+ const response = await fetch(`https://app.gudhub.com/api/services/api/${api_app_id}/articles`);
313
313
  const data = await response.json();
314
314
  let articles = data.articlesAndComments.articles;
315
315
  let comments = data.articlesAndComments.comments;
@@ -334,7 +334,7 @@ class PostsTemplate extends GHComponent {
334
334
  }
335
335
 
336
336
  if (this.type === 'category') {
337
- const categoriesResponse = await fetch(`https://gudhub.com/api/services/prod/api/${api_app_id}/categories`)
337
+ const categoriesResponse = await fetch(`https://app.gudhub.com/api/services/api/${api_app_id}/categories`)
338
338
  let categories = await categoriesResponse.json();
339
339
  categories = categories.categories;
340
340
  let category = window.location.pathname;
@@ -364,7 +364,7 @@ class PostsTemplate extends GHComponent {
364
364
  return articles;
365
365
  }
366
366
  if (this.type === 'author') {
367
- const authorsResponse = await fetch(`https://gudhub.com/api/services/prod/api/${api_app_id}/authors`)
367
+ const authorsResponse = await fetch(`https://app.gudhub.com/api/services/api/${api_app_id}/authors`)
368
368
  let authors = await authorsResponse.json();
369
369
  authors = authors.authors;
370
370
  const author = window.location.pathname;
@@ -409,7 +409,7 @@ class PostsTemplate extends GHComponent {
409
409
  async fetchIntro(posts) {
410
410
  const { api_app_id, intro_field_id, app_id } = window.getConfig().chapters.blog;
411
411
  const fetchData = async (index, item_id) => {
412
- const responseIntro = await fetch(`https://gudhub.com/api/services/prod/api/${api_app_id}/get-intro?app_id=${app_id}&item_id=${item_id}&element_id=${intro_field_id}`);
412
+ const responseIntro = await fetch(`https://app.gudhub.com/api/services/api/${api_app_id}/get-intro?app_id=${app_id}&item_id=${item_id}&element_id=${intro_field_id}`);
413
413
  const dataIntro = await responseIntro.json();
414
414
  let introItems = JSON.parse(dataIntro.data).blocks[0].data;
415
415
  posts[index].intro = introItems;
@@ -473,7 +473,7 @@ class PostsTemplate extends GHComponent {
473
473
  if (!articles[0].author_slug) {
474
474
 
475
475
  const { api_app_id } = window.getConfig().chapters.blog;
476
- const authorsResponse = await fetch(`https://gudhub.com/api/services/prod/api/${api_app_id}/authors`)
476
+ const authorsResponse = await fetch(`https://app.gudhub.com/api/services/api/${api_app_id}/authors`)
477
477
  authors = await authorsResponse.json();
478
478
  authors = authors.authors;
479
479
  }
@@ -26,8 +26,6 @@ class BreadcrumbsComponent extends GHComponent {
26
26
 
27
27
  this.items === null ? console.error(`Didn't find current route in config, current URL: ${currentUrl}`) : null;
28
28
 
29
- console.log("this.items:", this.items);
30
-
31
29
  if (this.items) {
32
30
  super.render(html);
33
31
  }
@@ -42,7 +42,7 @@ We have two different ways to use this component:
42
42
  | `alt` | Alternative text for the image | `string`<br>`"Description of image"` |
43
43
  | `title` | Image title (shown as tooltip) | `string`<br>`"My Image Title"` |
44
44
  | `lazyload` | Enables native browser lazy loading (`loading="lazy"`) | `boolean` (just include the attribute) |
45
- | `data-url` | Remote image URL | `string`<br>`https://gudhub.com/userdata/29883/1083204.jpg` |
45
+ | `data-url` | Remote image URL | `string`<br>`https://app.gudhub.com/userdata/29883/1083204.jpg` |
46
46
  | `data-rerender` | Enables client-side rerendering after SSR *(currently not working❗❗❗)* | `boolean` (just include the attribute) |
47
47
  | `width` | Image width | `string`<br>`"300"` |
48
48
  | `height` | Image height | `string`<br>`"200"` |
@@ -102,13 +102,13 @@ class MetaTag extends GHComponent {
102
102
  let titleValue = item.fields.find(findedField => findedField.field_id == titleId).field_value;
103
103
  let descriptionValue = item.fields.find(findedField => findedField.field_id == descriptionId).field_value;
104
104
  let slugValue = item.fields.find(findedField => findedField.field_id == slugId).field_value;
105
- let imageValue = (!slugValue.includes('/blog/') && !slugValue.includes('/service-areas/')) ? item.fields.find(findedField => findedField.field_id == imageUrl).field_value : false;
105
+ let imageValue = (!slugValue.includes('/blog/') && !slugValue.includes('/service-areas/') && !slugValue.includes('/courses/')) ? item.fields.find(findedField => findedField.field_id == imageUrl).field_value : false;
106
106
 
107
- // value = isNaN(value) ? value : await this.getContent(`https://gudhub.com/userdata/${window.getConfig().chapters[chapter].app_id}/${value}.html`);
107
+ // value = isNaN(value) ? value : await this.getContent(`https://app.gudhub.com/userdata/${window.getConfig().chapters[chapter].app_id}/${value}.html`);
108
108
  titleValue = isNaN(titleValue) ? titleValue : await this.getContent(`https://app.gudhub.com/userdata/${window.getConfig().chapters[chapter].app_id}/${titleValue}.html`);
109
109
  descriptionValue = isNaN(descriptionValue) ? descriptionValue : await this.getContent(`https://app.gudhub.com/userdata/${window.getConfig().chapters[chapter].app_id}/${descriptionValue}.html`);
110
110
  slugValue = isNaN(slugValue) ? slugValue : await this.getContent(`https://app.gudhub.com/userdata/${window.getConfig().chapters[chapter].app_id}/${slugValue}.html`);
111
- imageValue = (!slugValue.includes('/blog/') && !slugValue.includes('/service-areas/')) ? isNaN(imageValue) ? imageValue : await this.getContent(`https://app.gudhub.com/userdata/${window.getConfig() .chapters[chapter].app_id}/${imageValue}.html`) : false;
111
+ imageValue = (!slugValue.includes('/blog/') && !slugValue.includes('/service-areas/') && !slugValue.includes('/courses/')) ? isNaN(imageValue) ? imageValue : await this.getContent(`https://app.gudhub.com/userdata/${window.getConfig() .chapters[chapter].app_id}/${imageValue}.html`) : false;
112
112
 
113
113
  //TITLE
114
114
  if ( !document.querySelector('title') ) {
@@ -140,7 +140,7 @@ class MetaTag extends GHComponent {
140
140
  }
141
141
 
142
142
 
143
- if ((!slugValue.includes('/blog/') && !slugValue.includes('/service-areas/'))) {
143
+ if ((!slugValue.includes('/blog/') && !slugValue.includes('/service-areas/') && !slugValue.includes('/courses/'))) {
144
144
  if ( !document.querySelector('[name="twitter:image"]') ) {
145
145
  const twitterMetaSiteImage = document.createElement('meta');
146
146
  twitterMetaSiteImage.setAttribute('name', 'twitter:image');