gatsby-core-theme 44.23.2 → 44.24.0
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 +16 -0
- package/gatsby-node.mjs +26 -19
- package/package.json +1 -1
- package/src/constants/sitemapKeys.mjs +4 -0
- package/src/helpers/withDefaults.mjs +5 -0
- package/src/resolver/common.mjs +1 -0
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,19 @@
|
|
|
1
|
+
# [44.24.0](https://gitlab.com/g2m-gentoo/team-floyd/themes/gatsby-themes/compare/v44.23.2...v44.24.0) (2026-05-06)
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
### Bug Fixes
|
|
5
|
+
|
|
6
|
+
* add megatigerplay direct section ([a008571](https://gitlab.com/g2m-gentoo/team-floyd/themes/gatsby-themes/commit/a0085711603e03b5e0cea6b2b6d47986b4fe33b3))
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
* Merge branch 'en-442-sitemap-update' into 'master' ([5987e47](https://gitlab.com/g2m-gentoo/team-floyd/themes/gatsby-themes/commit/5987e474b17e9b09e4775df9f2156a9fc2e7d240))
|
|
10
|
+
* Merge branch 'EN-457' into 'master' ([1a35793](https://gitlab.com/g2m-gentoo/team-floyd/themes/gatsby-themes/commit/1a357930fd21edb90a797fe20ec2a36bed6eb920))
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
### Features
|
|
14
|
+
|
|
15
|
+
* create sitemap node with additional themeOptions ([7d512ad](https://gitlab.com/g2m-gentoo/team-floyd/themes/gatsby-themes/commit/7d512ad9c6522371421b1bdfdc1ded19dfb675e5))
|
|
16
|
+
|
|
1
17
|
## [44.23.2](https://gitlab.com/g2m-gentoo/team-floyd/themes/gatsby-themes/compare/v44.23.1...v44.23.2) (2026-05-05)
|
|
2
18
|
|
|
3
19
|
|
package/gatsby-node.mjs
CHANGED
|
@@ -17,13 +17,18 @@ import { fetchSiteSettings } from "./src/services/fetch.mjs";
|
|
|
17
17
|
import { generateTrackerLink } from "./src/helpers/generators.mjs";
|
|
18
18
|
import processor, { processSitemapPages } from "./src/resolver/index.mjs";
|
|
19
19
|
import settings from "./src/constants/settings.mjs";
|
|
20
|
-
import {
|
|
20
|
+
import {
|
|
21
|
+
clean,
|
|
22
|
+
filterRelation,
|
|
23
|
+
removeUnwantedSections,
|
|
24
|
+
} from "./src/resolver/common.mjs";
|
|
21
25
|
import {
|
|
22
26
|
generateRedirects,
|
|
23
27
|
generatePrettyLinkRedirects,
|
|
24
28
|
} from "./src/resolver/redirect.mjs";
|
|
25
29
|
import { translate, is404Page } from "./src/helpers/getters.mjs";
|
|
26
30
|
import { getArchivePages, hasArchiveModule } from "./src/resolver/archive.mjs";
|
|
31
|
+
import withDefaults from "./src/helpers/withDefaults.mjs";
|
|
27
32
|
|
|
28
33
|
const __dirname = dirname(fileURLToPath(import.meta.url));
|
|
29
34
|
const { cloneDeep } = loadash;
|
|
@@ -66,7 +71,6 @@ const pagesToCreate = [];
|
|
|
66
71
|
let commentsData = null;
|
|
67
72
|
let authors = null;
|
|
68
73
|
|
|
69
|
-
|
|
70
74
|
// eslint-disable-next-line import/prefer-default-export
|
|
71
75
|
export const createPages = async (
|
|
72
76
|
{ actions: { createPage } },
|
|
@@ -113,13 +117,20 @@ export const createPages = async (
|
|
|
113
117
|
|
|
114
118
|
// create robots.txt file
|
|
115
119
|
// block all crawlers to prevent indexing for non-production environments
|
|
116
|
-
const isProduction =
|
|
120
|
+
const isProduction =
|
|
121
|
+
process.env.GATSBY_ACTIVE_ENV === "production" &&
|
|
122
|
+
process.env.GATSBY_IS_PRELIVE !== "true";
|
|
117
123
|
const robotsTxtContent = isProduction
|
|
118
|
-
?
|
|
124
|
+
? siteGeneralData.robots_txt || ""
|
|
119
125
|
: "User-agent: *\nDisallow: /\n";
|
|
120
126
|
const streamRobotsTxt = fs.createWriteStream("./static/robots.txt");
|
|
121
127
|
console.log(
|
|
122
|
-
chalk.magenta("info") +
|
|
128
|
+
chalk.magenta("info") +
|
|
129
|
+
chalk.whiteBright(
|
|
130
|
+
` creating robots.txt file (${
|
|
131
|
+
isProduction ? "production" : "blocking"
|
|
132
|
+
})`
|
|
133
|
+
)
|
|
123
134
|
);
|
|
124
135
|
streamRobotsTxt.write(robotsTxtContent);
|
|
125
136
|
streamRobotsTxt.end();
|
|
@@ -143,7 +154,6 @@ export const createPages = async (
|
|
|
143
154
|
siteSchema = schemaData[page["market_id"]];
|
|
144
155
|
authors = siteSettingsData.authors;
|
|
145
156
|
|
|
146
|
-
|
|
147
157
|
page.siteInfo = siteGeneralData;
|
|
148
158
|
page.siteSchema = siteSchema;
|
|
149
159
|
|
|
@@ -416,11 +426,10 @@ export const onPreBootstrap = async (options, themeOptions) => {
|
|
|
416
426
|
));
|
|
417
427
|
};
|
|
418
428
|
|
|
419
|
-
export const sourceNodes = async (
|
|
420
|
-
actions,
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
}) => {
|
|
429
|
+
export const sourceNodes = async (
|
|
430
|
+
{ actions, createNodeId, createContentDigest },
|
|
431
|
+
themeOptions
|
|
432
|
+
) => {
|
|
424
433
|
const { createNode } = actions;
|
|
425
434
|
const keys = Object.keys(siteSettingsData.site_markets)
|
|
426
435
|
.map((key) => `language_codes[]=${key.split("_")[1]}`)
|
|
@@ -473,13 +482,10 @@ export const sourceNodes = async ({
|
|
|
473
482
|
page.path === "/" && pathPrefix ? "" : page.path
|
|
474
483
|
}`;
|
|
475
484
|
|
|
476
|
-
const
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
|
|
480
|
-
language: page.language,
|
|
481
|
-
type: page.type,
|
|
482
|
-
};
|
|
485
|
+
const sitemapSettings = withDefaults(themeOptions).sitemap;
|
|
486
|
+
const pageSitemap = filterRelation(page, sitemapSettings.keys);
|
|
487
|
+
|
|
488
|
+
if ("path" in pageSitemap) pageSitemap.path = path;
|
|
483
489
|
|
|
484
490
|
const nodeMeta = {
|
|
485
491
|
id: createNodeId(`sitemap-${pageId}`),
|
|
@@ -487,7 +493,8 @@ export const sourceNodes = async ({
|
|
|
487
493
|
children: [],
|
|
488
494
|
internal: {
|
|
489
495
|
type: `SitemapGroup${
|
|
490
|
-
page.
|
|
496
|
+
page[sitemapSettings.groupBy].charAt(0).toUpperCase() +
|
|
497
|
+
page[sitemapSettings.groupBy].slice(1)
|
|
491
498
|
}`,
|
|
492
499
|
contentDigest: createContentDigest(page),
|
|
493
500
|
},
|
package/package.json
CHANGED