gatsby-core-theme 42.0.18 → 42.0.19
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 +7 -0
- package/gatsby-node.mjs +10 -7
- package/package.json +1 -1
- package/src/helpers/processor/common.mjs +12 -22
- package/src/helpers/processor/index.mjs +4 -4
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,10 @@
|
|
|
1
|
+
## [42.0.19](https://gitlab.com/g2m-gentoo/team-floyd/themes/gatsby-themes/compare/v42.0.18...v42.0.19) (2025-02-24)
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
### Bug Fixes
|
|
5
|
+
|
|
6
|
+
* archive module bug ([75e5ef9](https://gitlab.com/g2m-gentoo/team-floyd/themes/gatsby-themes/commit/75e5ef907e46a9a45047f691ff0a67c6b3cac45b))
|
|
7
|
+
|
|
1
8
|
## [42.0.18](https://gitlab.com/g2m-gentoo/team-floyd/themes/gatsby-themes/compare/v42.0.17...v42.0.18) (2025-02-24)
|
|
2
9
|
|
|
3
10
|
|
package/gatsby-node.mjs
CHANGED
|
@@ -85,6 +85,11 @@ function createArchivePage(
|
|
|
85
85
|
console.log(`Archive for ${pageObject.path} broken`);
|
|
86
86
|
}
|
|
87
87
|
|
|
88
|
+
console.log('=================');
|
|
89
|
+
console.log(pageObject.path);
|
|
90
|
+
|
|
91
|
+
|
|
92
|
+
|
|
88
93
|
if (archiveModule.pagination_type !== "load_more") {
|
|
89
94
|
const numOfColumns = archiveModule.desktop_num_of_columns;
|
|
90
95
|
const calDefaultNrOfItems = (numOfColumns !== null ? numOfColumns : 4) * 3;
|
|
@@ -115,7 +120,8 @@ function createArchivePage(
|
|
|
115
120
|
pageObject.path.charAt(0) !== "/"
|
|
116
121
|
? `/${pageObject.path}`
|
|
117
122
|
: pageObject.path;
|
|
118
|
-
|
|
123
|
+
|
|
124
|
+
archive.items = activeItems.map((item) => processor.clonePage(item, false));
|
|
119
125
|
switch (archive.currentPage) {
|
|
120
126
|
case 1:
|
|
121
127
|
page.path = pageObject.path;
|
|
@@ -138,12 +144,7 @@ function createArchivePage(
|
|
|
138
144
|
"archive_title_prefix",
|
|
139
145
|
" - Page [number]"
|
|
140
146
|
).replace("[number]", archive.currentPage) : ''}`;
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
+
|
|
147
148
|
page.meta_description = `${translate(
|
|
148
149
|
translationsData[pageObject.language],
|
|
149
150
|
"archive_description_prefix",
|
|
@@ -188,6 +189,8 @@ function createArchivePage(
|
|
|
188
189
|
}
|
|
189
190
|
} else {
|
|
190
191
|
const page = cloneDeep(pageObject);
|
|
192
|
+
const numOfItemsPerPage = Math.sign(archiveModule.num_of_items);
|
|
193
|
+
|
|
191
194
|
const archive = cloneDeep(page.sections.main.modules[archiveModuleIndex]);
|
|
192
195
|
archive.items = cloneDeep(archivePages)
|
|
193
196
|
.filter((item) =>
|
package/package.json
CHANGED
|
@@ -26,7 +26,7 @@ export function groupBy(list = {}, keyName = 'author_id', single = false) {
|
|
|
26
26
|
return newObj;
|
|
27
27
|
}
|
|
28
28
|
|
|
29
|
-
export function clonePageForCards(item, style, content) {
|
|
29
|
+
export function clonePageForCards(item, style, content, extraFields = true) {
|
|
30
30
|
const siteName = process.env.GATSBY_SITE_NAME;
|
|
31
31
|
if (item.relation_type === 'operator') {
|
|
32
32
|
if (settings.delete_operator_software[siteName]) {
|
|
@@ -45,17 +45,19 @@ export function clonePageForCards(item, style, content) {
|
|
|
45
45
|
deleteSections.forEach((sectionKey) => {
|
|
46
46
|
delete item.sections[sectionKey];
|
|
47
47
|
});
|
|
48
|
-
// process extra fields for sections we want to keep
|
|
49
|
-
keepSections.forEach((sectionKey) => {
|
|
50
|
-
// eslint-disable-next-line no-prototype-builtins
|
|
51
|
-
if (item.sections[sectionKey] && item.sections[sectionKey].hasOwnProperty('extra_fields')) {
|
|
52
|
-
|
|
53
48
|
|
|
54
|
-
|
|
55
|
-
|
|
49
|
+
// process extra fields for sections we want to keep
|
|
50
|
+
if (extraFields) {
|
|
51
|
+
keepSections.forEach((sectionKey) => {
|
|
52
|
+
// eslint-disable-next-line no-prototype-builtins
|
|
53
|
+
if (item.sections[sectionKey] && item.sections[sectionKey].hasOwnProperty('extra_fields')) {
|
|
54
|
+
if (item.sections[sectionKey].extra_fields) {
|
|
55
|
+
processExtraFields(item.sections[sectionKey].extra_fields, null, null, content, item);
|
|
56
|
+
}
|
|
56
57
|
}
|
|
57
|
-
}
|
|
58
|
-
}
|
|
58
|
+
});
|
|
59
|
+
}
|
|
60
|
+
|
|
59
61
|
} else {
|
|
60
62
|
delete item.sections;
|
|
61
63
|
}
|
|
@@ -74,18 +76,6 @@ export function clonePageForCards(item, style, content) {
|
|
|
74
76
|
? pick(item.relation, pickRelationKeys[item.relation_type])
|
|
75
77
|
: item.relation;
|
|
76
78
|
|
|
77
|
-
|
|
78
|
-
if (
|
|
79
|
-
item.type === 'operator' &&
|
|
80
|
-
style !== 'comparison_table' &&
|
|
81
|
-
style !== 'template_one' &&
|
|
82
|
-
style !== 'template_two' &&
|
|
83
|
-
object.relation &&
|
|
84
|
-
object.relation.bonus
|
|
85
|
-
) {
|
|
86
|
-
delete object.relation.bonus.deposit_methods;
|
|
87
|
-
}
|
|
88
|
-
|
|
89
79
|
return object;
|
|
90
80
|
}
|
|
91
81
|
|
|
@@ -470,8 +470,8 @@ export default {
|
|
|
470
470
|
if (searchTemplatesAcitve.includes(page.template) && searchEnabled) {
|
|
471
471
|
searchData[page.market].push(
|
|
472
472
|
clonePageForCards(
|
|
473
|
-
cloneDeep(transformedPages[market][pageType][index])
|
|
474
|
-
|
|
473
|
+
cloneDeep(transformedPages[market][pageType][index]),
|
|
474
|
+
'', data.content)
|
|
475
475
|
);
|
|
476
476
|
}
|
|
477
477
|
|
|
@@ -582,7 +582,7 @@ export default {
|
|
|
582
582
|
);
|
|
583
583
|
return data;
|
|
584
584
|
},
|
|
585
|
-
clonePage(item) {
|
|
586
|
-
return clonePageForCards(item);
|
|
585
|
+
clonePage(item, extraFields) {
|
|
586
|
+
return clonePageForCards(item, '', null, extraFields);
|
|
587
587
|
},
|
|
588
588
|
};
|