@gudhub/ssg-web-components-library 1.0.96 → 1.0.98

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.96",
3
+ "version": "1.0.98",
4
4
  "description": "",
5
5
  "main": "index.js",
6
6
  "type": "module",
@@ -1,12 +1,12 @@
1
1
  import html from './blog-banner.html';
2
2
  import './blog-banner.scss';
3
3
 
4
- import {initBlogConfig} from '../initBlogConfig.js';
4
+ import { initBlogConfig } from '../initBlogConfig.js';
5
5
 
6
6
  class BlogBanner extends GHComponent {
7
-
8
7
  constructor() {
9
8
  super();
9
+
10
10
  const homepageAttr = this.getAttribute('data-homepage');
11
11
  try {
12
12
  this.homepageObj = homepageAttr && JSON.parse(homepageAttr);
@@ -31,7 +31,6 @@ class BlogBanner extends GHComponent {
31
31
  // this.json = await super.getGhData(this.ghId, 'pages', window.getConfig().chapters.pages.app_id, window.getConfig().chapters.pages.blog_main_page_item_id);
32
32
  const response = await gudhub.getDocument({ app_id: window.getConfig().chapters.pages.app_id, item_id: window.getConfig().chapters.pages.blog_main_page_item_id, element_id: window.getConfig().chapters.pages.json_field_id });
33
33
  this.json = JSON.parse(response.data)[this.ghId];
34
-
35
34
  } else {
36
35
  this.page = false;
37
36
  this.ghId = this.getAttribute('data-gh-id') || null;
@@ -46,7 +45,10 @@ class BlogBanner extends GHComponent {
46
45
  breadcrumbsTitle.innerHTML = this.json.title;
47
46
 
48
47
  this.breadcrumbs = JSON.stringify([
49
- this.homepageObj,
48
+ this.homepageObj ?? {
49
+ title: 'Головна',
50
+ link: '/'
51
+ },
50
52
  {
51
53
  title: breadcrumbsTitle.innerText
52
54
  }