gatsby-core-theme 44.1.2 → 44.1.4
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 +29 -0
- package/package.json +1 -1
- package/src/components/organisms/head/index.js +18 -8
- package/src/constants/metaTags.js +2 -4
- package/src/helpers/fetch-site-settings.mjs +13 -9
- package/src/helpers/head.js +6 -6
- package/src/helpers/processor/operators.mjs +12 -2
- package/src/helpers/processor/operators.test.js +1 -0
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,32 @@
|
|
|
1
|
+
## [44.1.4](https://gitlab.com/g2m-gentoo/team-floyd/themes/gatsby-themes/compare/v44.1.3...v44.1.4) (2025-06-03)
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
### Bug Fixes
|
|
5
|
+
|
|
6
|
+
* imporve schema ([5ffa2c9](https://gitlab.com/g2m-gentoo/team-floyd/themes/gatsby-themes/commit/5ffa2c9349f41671cfc3b525c5bcf212c6317ffb))
|
|
7
|
+
* improve code ([d1efe70](https://gitlab.com/g2m-gentoo/team-floyd/themes/gatsby-themes/commit/d1efe7022da69ef2d4f6a22f0c1ab2836d9d5e21))
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
* Merge branch 'schema-fixes' into 'master' ([c15d5e9](https://gitlab.com/g2m-gentoo/team-floyd/themes/gatsby-themes/commit/c15d5e93b4c0039554c73cb08b37a2db83ef80ed))
|
|
11
|
+
|
|
12
|
+
## [44.1.3](https://gitlab.com/g2m-gentoo/team-floyd/themes/gatsby-themes/compare/v44.1.2...v44.1.3) (2025-05-29)
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
### Bug Fixes
|
|
16
|
+
|
|
17
|
+
* add an extra checker on transformoperators function ([0632e38](https://gitlab.com/g2m-gentoo/team-floyd/themes/gatsby-themes/commit/0632e3825aa5b8fda7627a656cf21e078582547c))
|
|
18
|
+
* add an extra checker on transformoperators function ([0ff5fba](https://gitlab.com/g2m-gentoo/team-floyd/themes/gatsby-themes/commit/0ff5fba1dd389fe744c6de58b61e4be51802ebe1))
|
|
19
|
+
* add validation ([b874e99](https://gitlab.com/g2m-gentoo/team-floyd/themes/gatsby-themes/commit/b874e996adaf2073d9adae34f4c2de99265dff01))
|
|
20
|
+
* add validation for robot options if they are in the context ([a3dc82b](https://gitlab.com/g2m-gentoo/team-floyd/themes/gatsby-themes/commit/a3dc82bbbe5c9c4c0e772660f7df98de9686fbda))
|
|
21
|
+
* merge master branch ([d896981](https://gitlab.com/g2m-gentoo/team-floyd/themes/gatsby-themes/commit/d896981ad580d81415940a8d27abf876da1c1dcb))
|
|
22
|
+
* remove review link from the processTOplist function ([80dc65c](https://gitlab.com/g2m-gentoo/team-floyd/themes/gatsby-themes/commit/80dc65c7fc54ec69a5a53e5f0b75f2fda7229bbe))
|
|
23
|
+
* update operator processor to include review link ([2d1543a](https://gitlab.com/g2m-gentoo/team-floyd/themes/gatsby-themes/commit/2d1543a779d233103ceebc0157eb69f0fec7a10f))
|
|
24
|
+
* update operator tests to include a check for review link ([4cacea3](https://gitlab.com/g2m-gentoo/team-floyd/themes/gatsby-themes/commit/4cacea34198393d0bab4616f8ea0ff89d05b4bb1))
|
|
25
|
+
|
|
26
|
+
|
|
27
|
+
* Merge branch 'update-operator-processor' into 'master' ([ba744c3](https://gitlab.com/g2m-gentoo/team-floyd/themes/gatsby-themes/commit/ba744c372938212fd254001563354146e3534d0f))
|
|
28
|
+
* Merge branch 'fix-head-bug' into 'master' ([376a699](https://gitlab.com/g2m-gentoo/team-floyd/themes/gatsby-themes/commit/376a69988ed8292ac9d38e2884a96218afd13a30))
|
|
29
|
+
|
|
1
30
|
## [44.1.2](https://gitlab.com/g2m-gentoo/team-floyd/themes/gatsby-themes/compare/v44.1.1...v44.1.2) (2025-05-28)
|
|
2
31
|
|
|
3
32
|
|
package/package.json
CHANGED
|
@@ -3,26 +3,33 @@ import React from "react";
|
|
|
3
3
|
import PropTypes from "prop-types";
|
|
4
4
|
import { schemaGenerator } from "~helpers/schema";
|
|
5
5
|
import keygen from "~helpers/keygen";
|
|
6
|
-
import {
|
|
6
|
+
import {
|
|
7
|
+
getUrl,
|
|
8
|
+
getLanguage,
|
|
9
|
+
getPageImage,
|
|
10
|
+
imagePrettyUrl,
|
|
11
|
+
} from "~helpers/getters";
|
|
7
12
|
import { getMetaTags, getCanonicalUrl } from "~helpers/head";
|
|
8
13
|
import customData from "./customData";
|
|
9
14
|
|
|
10
15
|
const HeadData = ({ page = {} }) => {
|
|
11
16
|
const isTracker = page.template === "tracker";
|
|
12
17
|
const metaTags = getMetaTags(page, isTracker);
|
|
18
|
+
const pageImage = getPageImage(page) || imagePrettyUrl(page.siteInfo?.site_logo);
|
|
19
|
+
|
|
13
20
|
let defaultHref = null;
|
|
14
21
|
|
|
15
22
|
return (
|
|
16
23
|
<>
|
|
17
24
|
<title>{page.meta_title}</title>
|
|
18
|
-
<html lang={getLanguage(page.language)} />
|
|
25
|
+
<html lang={process.env.GATSBY_SITE_LANG || getLanguage(page.language)} />
|
|
19
26
|
{metaTags}
|
|
20
27
|
{customData(page)}
|
|
21
28
|
{process.env.GATSBY_ACTIVE_ENV === "development" && (
|
|
22
29
|
<meta name="googlebot" content="noindex,follow" />
|
|
23
30
|
)}
|
|
24
31
|
<link rel="canonical" href={getCanonicalUrl(page, isTracker)} />\
|
|
25
|
-
{page?.hreflangs?.map((link) => {
|
|
32
|
+
{page?.hreflangs?.map((link) => {
|
|
26
33
|
if (link?.default) {
|
|
27
34
|
defaultHref = link?.path;
|
|
28
35
|
}
|
|
@@ -42,11 +49,14 @@ const HeadData = ({ page = {} }) => {
|
|
|
42
49
|
page.preconnect_links.map((link) => (
|
|
43
50
|
<link key={keygen()} rel="preconnect" href={link} />
|
|
44
51
|
))}
|
|
45
|
-
{schemaGenerator(page,
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
52
|
+
{schemaGenerator(page, pageImage).map(
|
|
53
|
+
(schema) =>
|
|
54
|
+
schema && (
|
|
55
|
+
<script key={keygen()} type="application/ld+json">
|
|
56
|
+
{`${schema}`}
|
|
57
|
+
</script>
|
|
58
|
+
)
|
|
59
|
+
)}
|
|
50
60
|
</>
|
|
51
61
|
);
|
|
52
62
|
};
|
|
@@ -12,7 +12,7 @@ export default (page, isTracker) => {
|
|
|
12
12
|
const metaTitle = transformMetaTitle(relation, meta_title, relation_type);
|
|
13
13
|
const twitterUsername = getTwitterUsername(page.siteSchema?.twitter);
|
|
14
14
|
|
|
15
|
-
|
|
15
|
+
|
|
16
16
|
return [
|
|
17
17
|
{ type: "meta", name: "description", content: page.meta_description },
|
|
18
18
|
{
|
|
@@ -42,9 +42,7 @@ export default (page, isTracker) => {
|
|
|
42
42
|
type: "meta",
|
|
43
43
|
property: "og:locale",
|
|
44
44
|
content:
|
|
45
|
-
getLanguage(page.
|
|
46
|
-
? "en_GB"
|
|
47
|
-
: getLanguage(page.language),
|
|
45
|
+
getLanguage(page.market)
|
|
48
46
|
},
|
|
49
47
|
{ type: "meta", name:'geo.placename', content: process.env.PLACENAME },
|
|
50
48
|
{ type: "meta", name:'geo.region', content: process.env.COUNTRY },
|
|
@@ -123,15 +123,19 @@ export const fetchSiteSettings = async (siteName, previewPath = null) => {
|
|
|
123
123
|
jackpot_data: transformGamesJackpot(gamesJackpotData)
|
|
124
124
|
});
|
|
125
125
|
|
|
126
|
-
const operatorData = transformOperators(
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
126
|
+
const operatorData = transformOperators(
|
|
127
|
+
operators,
|
|
128
|
+
{
|
|
129
|
+
payments: paymentData,
|
|
130
|
+
ribbons: ribbonsData,
|
|
131
|
+
countries: countriesData,
|
|
132
|
+
currencies: currenciesData,
|
|
133
|
+
providers: providersData,
|
|
134
|
+
games: gamesData,
|
|
135
|
+
gamblingCompanies: gamblingCompaniesData,
|
|
136
|
+
},
|
|
137
|
+
pagesData
|
|
138
|
+
);
|
|
135
139
|
|
|
136
140
|
const cryptoExchangesData = transformCryptosData(cryptoExchanges, {
|
|
137
141
|
countries: countriesData,
|
package/src/helpers/head.js
CHANGED
|
@@ -1,13 +1,12 @@
|
|
|
1
1
|
import React from "react";
|
|
2
|
-
import {
|
|
2
|
+
import { getBonus } from "~helpers/getters";
|
|
3
3
|
import { generatePlaceholderString } from "~helpers/generators";
|
|
4
4
|
import keygen from "~helpers/keygen";
|
|
5
5
|
import metaTags from "~constants/metaTags";
|
|
6
6
|
|
|
7
|
-
export const getMetaTags = (page,
|
|
8
|
-
const pageImage = getPageImage(page) || imagePrettyUrl(siteInfo?.site_logo);
|
|
7
|
+
export const getMetaTags = (page, isTracker) =>
|
|
9
8
|
// eslint-disable-next-line array-callback-return
|
|
10
|
-
|
|
9
|
+
metaTags(page, isTracker).map((meta) => {
|
|
11
10
|
if (meta?.content) {
|
|
12
11
|
return (
|
|
13
12
|
<meta
|
|
@@ -17,8 +16,8 @@ export const getMetaTags = (page, siteInfo, isTracker) => {
|
|
|
17
16
|
/>
|
|
18
17
|
);
|
|
19
18
|
}
|
|
20
|
-
})
|
|
21
|
-
|
|
19
|
+
})
|
|
20
|
+
;
|
|
22
21
|
|
|
23
22
|
export function getCanonicalUrl(page, isTracker) {
|
|
24
23
|
if (page.canonical_url) {
|
|
@@ -35,6 +34,7 @@ export function getCanonicalUrl(page, isTracker) {
|
|
|
35
34
|
}
|
|
36
35
|
|
|
37
36
|
export function getRobotOptions(options) {
|
|
37
|
+
if (!options) return null;
|
|
38
38
|
const array = [];
|
|
39
39
|
if (
|
|
40
40
|
!options &&
|
|
@@ -60,10 +60,14 @@ export function sanitizeOperatorData(operator, operatorPage = [], data = [], top
|
|
|
60
60
|
operatorClone.updatedAt = operatorPage[0].updated_at;
|
|
61
61
|
}
|
|
62
62
|
|
|
63
|
+
if (operatorPage.length >= 1) {
|
|
64
|
+
operatorClone.review_link = operatorPage[0].path
|
|
65
|
+
}
|
|
66
|
+
|
|
63
67
|
return pick(operatorClone, toplistLabel && toplistLabel.includes('simplified') ? pickRelationKeys.operator_simplified : pickRelationKeys.operator);
|
|
64
68
|
}
|
|
65
69
|
|
|
66
|
-
export function transformOperators(jsonData, relationsData) {
|
|
70
|
+
export function transformOperators(jsonData, relationsData, pages) {
|
|
67
71
|
const operators = {};
|
|
68
72
|
|
|
69
73
|
// Iterate over each operator
|
|
@@ -141,10 +145,16 @@ export function transformOperators(jsonData, relationsData) {
|
|
|
141
145
|
newOperatorData.game_provider_ids,
|
|
142
146
|
relationsData.providers
|
|
143
147
|
);
|
|
148
|
+
const operatorPage = Object.values(pages).filter(
|
|
149
|
+
(page) =>
|
|
150
|
+
page.relation_type === "operator" && page.type === 'operator' &&
|
|
151
|
+
page.relation_id === newOperatorData.id
|
|
144
152
|
|
|
153
|
+
);
|
|
154
|
+
|
|
145
155
|
operators[affiliate.id] = sanitizeOperatorData(
|
|
146
156
|
newOperatorData,
|
|
147
|
-
|
|
157
|
+
operatorPage,
|
|
148
158
|
relationsData
|
|
149
159
|
);
|
|
150
160
|
});
|
|
@@ -17,6 +17,7 @@ describe("Sanitize Operator Data", () => {
|
|
|
17
17
|
expect(sanitizedOperator.deposit_methods).toHaveLength(2);
|
|
18
18
|
expect(sanitizedOperator.ribbons).toHaveLength(1);
|
|
19
19
|
expect(sanitizedOperator.ribbons[0]).toBe('testRibbon');
|
|
20
|
+
expect(sanitizedOperator.review_link).toBe('sport/brand');
|
|
20
21
|
});
|
|
21
22
|
test("Handles missing optional fields gracefully", () => {
|
|
22
23
|
const operatorData = {
|