gatsby-core-theme 44.5.1 → 44.5.2
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/CHANGELOG.md +10 -0
- package/package.json +1 -1
- package/src/resolver/modules.mjs +29 -9
- package/src/services/api.mjs +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,13 @@
|
|
|
1
|
+
## [44.5.2](https://gitlab.com/g2m-gentoo/team-floyd/themes/gatsby-themes/compare/v44.5.1...v44.5.2) (2025-10-28)
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
### Bug Fixes
|
|
5
|
+
|
|
6
|
+
* fix the logic for the preview ([a9aa055](https://gitlab.com/g2m-gentoo/team-floyd/themes/gatsby-themes/commit/a9aa055d8d686d33494594fb60e98342e84a1518))
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
* Merge branch 'en-160-preview' into 'master' ([4e7e6cb](https://gitlab.com/g2m-gentoo/team-floyd/themes/gatsby-themes/commit/4e7e6cb74294ace70ba99cba91a0220633e17b9f))
|
|
10
|
+
|
|
1
11
|
## [44.5.1](https://gitlab.com/g2m-gentoo/team-floyd/themes/gatsby-themes/compare/v44.5.0...v44.5.1) (2025-10-22)
|
|
2
12
|
|
|
3
13
|
|
package/package.json
CHANGED
package/src/resolver/modules.mjs
CHANGED
|
@@ -525,12 +525,22 @@ export function shouldSavePrefilled(module = {}, siteName) {
|
|
|
525
525
|
);
|
|
526
526
|
}
|
|
527
527
|
|
|
528
|
-
export function processSpotlightModule(module = {}, content) {
|
|
528
|
+
export function processSpotlightModule(module = {}, content, previewPageID) {
|
|
529
529
|
module.items.forEach((item) => {
|
|
530
530
|
item.content = trailingSlash(
|
|
531
|
-
|
|
531
|
+
previewPageID ? item.content : (
|
|
532
|
+
(content &&
|
|
533
|
+
content[item.content]
|
|
534
|
+
)
|
|
535
|
+
) || ""
|
|
536
|
+
);
|
|
537
|
+
item.text = trailingSlash(
|
|
538
|
+
previewPageID ? item.text : (
|
|
539
|
+
(content &&
|
|
540
|
+
content[item.text]
|
|
541
|
+
)
|
|
542
|
+
) || ""
|
|
532
543
|
);
|
|
533
|
-
item.text = trailingSlash((content && content[item.text]) || "");
|
|
534
544
|
});
|
|
535
545
|
|
|
536
546
|
return module;
|
|
@@ -543,22 +553,32 @@ export function processCarouselModule(module = {}, content) {
|
|
|
543
553
|
return module;
|
|
544
554
|
}
|
|
545
555
|
|
|
546
|
-
export function processFaq(module = {}, content, relationData) {
|
|
556
|
+
export function processFaq(module = {}, content, relationData, previewPageID) {
|
|
547
557
|
// eslint-disable-next-line no-unused-expressions
|
|
548
558
|
module.items &&
|
|
549
559
|
// eslint-disable-next-line array-callback-return
|
|
550
560
|
module.items.map((item) => {
|
|
551
561
|
item.question = trailingSlash(
|
|
552
|
-
(
|
|
562
|
+
previewPageID ? generatePlaceholderString(item.question, null, relationData) : (
|
|
563
|
+
(content &&
|
|
553
564
|
generatePlaceholderString(
|
|
554
565
|
content[item.question],
|
|
555
566
|
null,
|
|
556
567
|
relationData
|
|
557
|
-
))
|
|
568
|
+
))
|
|
569
|
+
) ||
|
|
558
570
|
item.question
|
|
559
571
|
);
|
|
560
572
|
item.answer = trailingSlash(
|
|
561
|
-
|
|
573
|
+
previewPageID ? generatePlaceholderString(item.answer, null, relationData) : (
|
|
574
|
+
(content &&
|
|
575
|
+
generatePlaceholderString(
|
|
576
|
+
content[item.answer],
|
|
577
|
+
null,
|
|
578
|
+
relationData
|
|
579
|
+
))
|
|
580
|
+
) ||
|
|
581
|
+
item.answer
|
|
562
582
|
);
|
|
563
583
|
});
|
|
564
584
|
}
|
|
@@ -631,11 +651,11 @@ export function processModule(
|
|
|
631
651
|
translations
|
|
632
652
|
);
|
|
633
653
|
} else if (module.name === "faq") {
|
|
634
|
-
processFaq(module, content, relationData);
|
|
654
|
+
processFaq(module, content, relationData, previewPageID);
|
|
635
655
|
} else if (module.name === "anchor") {
|
|
636
656
|
processAnchor(module, relationData, translations);
|
|
637
657
|
} else if (module.name === "spotlights") {
|
|
638
|
-
processSpotlightModule(module, content);
|
|
658
|
+
processSpotlightModule(module, content, previewPageID);
|
|
639
659
|
} else if (module.name === "menu" && menus && menus[module.menu_id]) {
|
|
640
660
|
module = Object.assign(module, menus[module.menu_id]);
|
|
641
661
|
} else if (module.name === "statistics_counter") {
|
package/src/services/api.mjs
CHANGED
|
@@ -67,7 +67,7 @@ export async function getPages(siteName, previewPath=null) {
|
|
|
67
67
|
if(previewPath) {
|
|
68
68
|
console.log(`v0.1/sites/pages/sorted-v2-preview/${siteName}?path=${previewPath}&non_preview_page_attributes=id,path,market_id,relation_id,relation_type,meta_title,title,type,template_id,market,author_id,banner,featured_image`);
|
|
69
69
|
|
|
70
|
-
return callAPIV2(`v0.1/sites/pages/sorted-v2-preview/${siteName}?path=${previewPath}&non_preview_page_attributes=id,path,market_id,relation_id,relation_type,meta_title,title,type,template_id,market,author_id,banner,featured_image`);
|
|
70
|
+
return callAPIV2(`v0.1/sites/pages/sorted-v2-preview/${siteName}?path=${previewPath}&non_preview_page_attributes=id,path,market_id,relation_id,relation_type,meta_title,title,type,template_id,market,author_id,banner,featured_image,description`);
|
|
71
71
|
}
|
|
72
72
|
return callAPIV2(`v0.1/sites/pages/sorted-v2/${siteName}`);
|
|
73
73
|
}
|