@bagelink/blox 1.18.3 → 1.18.6
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/dist/{PreviewApp-BKrLRDBC.js → PreviewApp-9H9-jLVN.js} +1 -1
- package/dist/{PreviewApp-Kb3uTwtH.cjs → PreviewApp-D8ZBTG0j.cjs} +1 -1
- package/dist/{PreviewApp.vue_vue_type_style_index_0_lang-AC3W0NSJ.cjs → PreviewApp.vue_vue_type_style_index_0_lang-BYCayJs0.cjs} +1 -1
- package/dist/{PreviewApp.vue_vue_type_style_index_0_lang-BMGv1eSR.js → PreviewApp.vue_vue_type_style_index_0_lang-BwiLyRBw.js} +1 -1
- package/dist/{appRuntime-CWlPH_5r.js → appRuntime-DZSCSsnS.js} +39 -156
- package/dist/{appRuntime-BU2Ls-Y7.cjs → appRuntime-Z0AxTPxf.cjs} +17 -134
- package/dist/composables/useLocale.d.ts +3 -0
- package/dist/composables/useLocale.d.ts.map +1 -1
- package/dist/composables/useLocaleNav.d.ts.map +1 -1
- package/dist/createBloxApp.d.ts.map +1 -1
- package/dist/hydration.d.ts +2 -0
- package/dist/hydration.d.ts.map +1 -1
- package/dist/index.cjs +16 -9
- package/dist/index.mjs +44 -36
- package/dist/localeStrategy-OwRIn35C.cjs +207 -0
- package/dist/localeStrategy-hXlNof1E.js +208 -0
- package/dist/localeStrategy.d.ts +21 -0
- package/dist/localeStrategy.d.ts.map +1 -1
- package/dist/{shard-runner-zmTY7v3n.cjs → shard-runner-DF3K3Ze_.cjs} +14 -7
- package/dist/{shard-runner-yZNy6pQy.js → shard-runner-DFrc8d4O.js} +15 -8
- package/dist/ssg/cli.cjs +9 -2
- package/dist/ssg/cli.mjs +9 -2
- package/dist/ssg/cms-routes.d.ts +7 -0
- package/dist/ssg/cms-routes.d.ts.map +1 -1
- package/dist/ssg/index.cjs +4 -2
- package/dist/ssg/index.mjs +5 -3
- package/dist/ssg/prerender.d.ts +3 -1
- package/dist/ssg/prerender.d.ts.map +1 -1
- package/dist/ssg/render-resolved-page.d.ts +2 -0
- package/dist/ssg/render-resolved-page.d.ts.map +1 -1
- package/dist/ssg/shard-runner.d.ts +3 -0
- package/dist/ssg/shard-runner.d.ts.map +1 -1
- package/dist/{validate-output-CrhXrC1l.cjs → validate-output-BymMbrA5.cjs} +40 -8
- package/dist/{validate-output-3fNPagvj.js → validate-output-yDJYYYzK.js} +36 -4
- package/package.json +125 -124
- package/LICENSE +0 -21
- package/dist/pageTitle-B1mtDJKn.js +0 -59
- package/dist/pageTitle-wobGhtiZ.cjs +0 -58
|
@@ -26,7 +26,7 @@ const node_child_process = require("node:child_process");
|
|
|
26
26
|
const os = require("node:os");
|
|
27
27
|
const path = require("node:path");
|
|
28
28
|
const process = require("node:process");
|
|
29
|
-
const llmArtifacts = require("./validate-output-
|
|
29
|
+
const llmArtifacts = require("./validate-output-BymMbrA5.cjs");
|
|
30
30
|
const AUTO_SHARD_CAP = Number(process.env.BLOX_SSG_SHARD_CAP) || 6;
|
|
31
31
|
const PREFETCH_BUDGET = Number(process.env.BLOX_SSG_PREFETCH_BUDGET) || 24;
|
|
32
32
|
const SEQUENTIAL_SHARDS = process.env.BLOX_SSG_SEQUENTIAL === "1";
|
|
@@ -39,6 +39,9 @@ function matchesCmsPath(pathname, cmsPaths) {
|
|
|
39
39
|
}
|
|
40
40
|
return false;
|
|
41
41
|
}
|
|
42
|
+
function sitemapRoutesForWebsite(routes, siteNoindex) {
|
|
43
|
+
return siteNoindex ? routes : routes.filter((route) => !route.noindex);
|
|
44
|
+
}
|
|
42
45
|
function resolveShardCount(shards) {
|
|
43
46
|
if (shards === "auto") {
|
|
44
47
|
const cores = os.cpus().length || 4;
|
|
@@ -92,7 +95,7 @@ function runShard(index, total, paths, opts, llmPartsDir, routePartsDir, siteDat
|
|
|
92
95
|
});
|
|
93
96
|
}
|
|
94
97
|
async function runSharded(opts) {
|
|
95
|
-
var _a, _b;
|
|
98
|
+
var _a, _b, _c, _d;
|
|
96
99
|
const total = resolveShardCount(opts.shards);
|
|
97
100
|
const fs = await import("node:fs/promises");
|
|
98
101
|
const paths = [...opts.extraPaths];
|
|
@@ -164,9 +167,9 @@ async function runSharded(opts) {
|
|
|
164
167
|
);
|
|
165
168
|
return failed[0].code;
|
|
166
169
|
}
|
|
167
|
-
if (process.env.BLOX_SSG_LLM !== "0") {
|
|
170
|
+
if (process.env.BLOX_SSG_LLM !== "0" && !((_a = website == null ? void 0 : website.seo) == null ? void 0 : _a.noindex)) {
|
|
168
171
|
try {
|
|
169
|
-
const { mergeLlmParts } = await Promise.resolve().then(() => require("./validate-output-
|
|
172
|
+
const { mergeLlmParts } = await Promise.resolve().then(() => require("./validate-output-BymMbrA5.cjs")).then((n) => n.llmArtifacts);
|
|
170
173
|
const mergeWebsite = website;
|
|
171
174
|
const partFiles = Array.from({ length: total }, (_, i) => path.join(llmPartsDir, `part.${i}.json`));
|
|
172
175
|
const { pages } = await mergeLlmParts({
|
|
@@ -185,8 +188,11 @@ async function runSharded(opts) {
|
|
|
185
188
|
return JSON.parse(await fs.readFile(file, "utf8"));
|
|
186
189
|
}));
|
|
187
190
|
const byUrl = new Map(routeParts.flat().map((route) => [route.url, route]));
|
|
188
|
-
const canonicalBase = (((
|
|
189
|
-
const indexableRoutes =
|
|
191
|
+
const canonicalBase = (((_b = website.seo) == null ? void 0 : _b.canonical_base_url) || website.domain || "").replace(/\/$/, "");
|
|
192
|
+
const indexableRoutes = sitemapRoutesForWebsite(
|
|
193
|
+
[...byUrl.values()],
|
|
194
|
+
(_c = website.seo) == null ? void 0 : _c.noindex
|
|
195
|
+
);
|
|
190
196
|
if (canonicalBase && indexableRoutes.length > 0) {
|
|
191
197
|
const artifacts = llmArtifacts.generateSitemapArtifacts({
|
|
192
198
|
routes: indexableRoutes.map((route) => ({
|
|
@@ -196,7 +202,7 @@ async function runSharded(opts) {
|
|
|
196
202
|
canonicalBase,
|
|
197
203
|
defaultLocale: website.default_locale,
|
|
198
204
|
supportedLocales: website.supported_locales,
|
|
199
|
-
splitByLocale: (
|
|
205
|
+
splitByLocale: (_d = website.seo) == null ? void 0 : _d.sitemap_split_by_locale
|
|
200
206
|
});
|
|
201
207
|
for (const artifact of artifacts) {
|
|
202
208
|
await fs.writeFile(
|
|
@@ -214,3 +220,4 @@ async function runSharded(opts) {
|
|
|
214
220
|
}
|
|
215
221
|
exports.matchesCmsPath = matchesCmsPath;
|
|
216
222
|
exports.runSharded = runSharded;
|
|
223
|
+
exports.sitemapRoutesForWebsite = sitemapRoutesForWebsite;
|
|
@@ -2,7 +2,7 @@ import { spawn } from "node:child_process";
|
|
|
2
2
|
import os from "node:os";
|
|
3
3
|
import path from "node:path";
|
|
4
4
|
import process from "node:process";
|
|
5
|
-
import { f as fetchCmsSiteData, g as generateSitemapArtifacts } from "./validate-output-
|
|
5
|
+
import { f as fetchCmsSiteData, g as generateSitemapArtifacts } from "./validate-output-yDJYYYzK.js";
|
|
6
6
|
const AUTO_SHARD_CAP = Number(process.env.BLOX_SSG_SHARD_CAP) || 6;
|
|
7
7
|
const PREFETCH_BUDGET = Number(process.env.BLOX_SSG_PREFETCH_BUDGET) || 24;
|
|
8
8
|
const SEQUENTIAL_SHARDS = process.env.BLOX_SSG_SEQUENTIAL === "1";
|
|
@@ -15,6 +15,9 @@ function matchesCmsPath(pathname, cmsPaths) {
|
|
|
15
15
|
}
|
|
16
16
|
return false;
|
|
17
17
|
}
|
|
18
|
+
function sitemapRoutesForWebsite(routes, siteNoindex) {
|
|
19
|
+
return siteNoindex ? routes : routes.filter((route) => !route.noindex);
|
|
20
|
+
}
|
|
18
21
|
function resolveShardCount(shards) {
|
|
19
22
|
if (shards === "auto") {
|
|
20
23
|
const cores = os.cpus().length || 4;
|
|
@@ -68,7 +71,7 @@ function runShard(index, total, paths, opts, llmPartsDir, routePartsDir, siteDat
|
|
|
68
71
|
});
|
|
69
72
|
}
|
|
70
73
|
async function runSharded(opts) {
|
|
71
|
-
var _a, _b;
|
|
74
|
+
var _a, _b, _c, _d;
|
|
72
75
|
const total = resolveShardCount(opts.shards);
|
|
73
76
|
const fs = await import("node:fs/promises");
|
|
74
77
|
const paths = [...opts.extraPaths];
|
|
@@ -140,9 +143,9 @@ async function runSharded(opts) {
|
|
|
140
143
|
);
|
|
141
144
|
return failed[0].code;
|
|
142
145
|
}
|
|
143
|
-
if (process.env.BLOX_SSG_LLM !== "0") {
|
|
146
|
+
if (process.env.BLOX_SSG_LLM !== "0" && !((_a = website == null ? void 0 : website.seo) == null ? void 0 : _a.noindex)) {
|
|
144
147
|
try {
|
|
145
|
-
const { mergeLlmParts } = await import("./validate-output-
|
|
148
|
+
const { mergeLlmParts } = await import("./validate-output-yDJYYYzK.js").then((n) => n.C);
|
|
146
149
|
const mergeWebsite = website;
|
|
147
150
|
const partFiles = Array.from({ length: total }, (_, i) => path.join(llmPartsDir, `part.${i}.json`));
|
|
148
151
|
const { pages } = await mergeLlmParts({
|
|
@@ -161,8 +164,11 @@ async function runSharded(opts) {
|
|
|
161
164
|
return JSON.parse(await fs.readFile(file, "utf8"));
|
|
162
165
|
}));
|
|
163
166
|
const byUrl = new Map(routeParts.flat().map((route) => [route.url, route]));
|
|
164
|
-
const canonicalBase = (((
|
|
165
|
-
const indexableRoutes =
|
|
167
|
+
const canonicalBase = (((_b = website.seo) == null ? void 0 : _b.canonical_base_url) || website.domain || "").replace(/\/$/, "");
|
|
168
|
+
const indexableRoutes = sitemapRoutesForWebsite(
|
|
169
|
+
[...byUrl.values()],
|
|
170
|
+
(_c = website.seo) == null ? void 0 : _c.noindex
|
|
171
|
+
);
|
|
166
172
|
if (canonicalBase && indexableRoutes.length > 0) {
|
|
167
173
|
const artifacts = generateSitemapArtifacts({
|
|
168
174
|
routes: indexableRoutes.map((route) => ({
|
|
@@ -172,7 +178,7 @@ async function runSharded(opts) {
|
|
|
172
178
|
canonicalBase,
|
|
173
179
|
defaultLocale: website.default_locale,
|
|
174
180
|
supportedLocales: website.supported_locales,
|
|
175
|
-
splitByLocale: (
|
|
181
|
+
splitByLocale: (_d = website.seo) == null ? void 0 : _d.sitemap_split_by_locale
|
|
176
182
|
});
|
|
177
183
|
for (const artifact of artifacts) {
|
|
178
184
|
await fs.writeFile(
|
|
@@ -190,5 +196,6 @@ async function runSharded(opts) {
|
|
|
190
196
|
}
|
|
191
197
|
export {
|
|
192
198
|
matchesCmsPath,
|
|
193
|
-
runSharded
|
|
199
|
+
runSharded,
|
|
200
|
+
sitemapRoutesForWebsite
|
|
194
201
|
};
|
package/dist/ssg/cli.cjs
CHANGED
|
@@ -3,7 +3,8 @@
|
|
|
3
3
|
const process = require("node:process");
|
|
4
4
|
const fs = require("node:fs/promises");
|
|
5
5
|
const ssg_buildGrant = require("./build-grant.cjs");
|
|
6
|
-
const llmArtifacts = require("../validate-output-
|
|
6
|
+
const llmArtifacts = require("../validate-output-BymMbrA5.cjs");
|
|
7
|
+
const localeStrategy = require("../localeStrategy-OwRIn35C.cjs");
|
|
7
8
|
function installFetchTimeout() {
|
|
8
9
|
const ms = Number(process.env.BLOX_SSG_FETCH_TIMEOUT_MS) || 2e4;
|
|
9
10
|
const original = globalThis.fetch;
|
|
@@ -147,7 +148,7 @@ Environment:
|
|
|
147
148
|
if (shardsOpt !== null || routesCmd) {
|
|
148
149
|
const { apiBase: apiBase2, websiteName: configWebsiteName2 } = await resolveApiBase(mode);
|
|
149
150
|
const websiteName2 = process.env.WEBSITE_NAME ?? configWebsiteName2 ?? "default";
|
|
150
|
-
const { runSharded } = await Promise.resolve().then(() => require("../shard-runner-
|
|
151
|
+
const { runSharded } = await Promise.resolve().then(() => require("../shard-runner-DF3K3Ze_.cjs"));
|
|
151
152
|
const code = await runSharded({
|
|
152
153
|
shards: shardsOpt ?? "auto",
|
|
153
154
|
mode,
|
|
@@ -183,6 +184,7 @@ Environment:
|
|
|
183
184
|
let cmsPathSet = /* @__PURE__ */ new Set();
|
|
184
185
|
let cachedAppPaths = [];
|
|
185
186
|
let collectionItems;
|
|
187
|
+
let pageSlugMap = {};
|
|
186
188
|
const productionBuild = process.env.NODE_ENV === "production" || mode === "production";
|
|
187
189
|
try {
|
|
188
190
|
const siteData = siteDataFile ? JSON.parse(await fs.readFile(siteDataFile, "utf8")) : await llmArtifacts.fetchCmsSiteData(apiBase, websiteName, buildRequest);
|
|
@@ -193,6 +195,8 @@ Environment:
|
|
|
193
195
|
websiteId = siteData.websiteId;
|
|
194
196
|
redirects = siteData.redirects;
|
|
195
197
|
collectionItems = siteData.collectionItems;
|
|
198
|
+
localeStrategy.setPageSlugMap(siteData.pageSlugMap);
|
|
199
|
+
pageSlugMap = siteData.pageSlugMap ?? {};
|
|
196
200
|
if (!siteDataFile) {
|
|
197
201
|
console.log(` Found ${paths.length} CMS routes`);
|
|
198
202
|
if (redirects.length > 0) console.log(` Found ${redirects.length} redirects`);
|
|
@@ -247,6 +251,9 @@ Environment:
|
|
|
247
251
|
website,
|
|
248
252
|
websiteId,
|
|
249
253
|
redirects,
|
|
254
|
+
// Canonical localized page paths, injected into each document's
|
|
255
|
+
// hydration payload so client-side links resolve without a redirect.
|
|
256
|
+
pageSlugMap,
|
|
250
257
|
// LLM artifacts (llms.txt, llms-full.txt, per-page JSON-LD). On by
|
|
251
258
|
// default; opt out with BLOX_SSG_LLM=0. Skip the *file* artifacts when
|
|
252
259
|
// sharding (>1 shard) because the writing shard only has its own slice of
|
package/dist/ssg/cli.mjs
CHANGED
|
@@ -2,7 +2,8 @@
|
|
|
2
2
|
import process from "node:process";
|
|
3
3
|
import fs from "node:fs/promises";
|
|
4
4
|
import { resolveBloxBuildGrant } from "./build-grant.mjs";
|
|
5
|
-
import { v as validateSsgOutput, u as uploadBloxManifest, p as polyfillBloxSsgGlobals, f as fetchCmsSiteData, b as buildCollectionResolver, a as prerender, c as validateInternalLinks } from "../validate-output-
|
|
5
|
+
import { v as validateSsgOutput, u as uploadBloxManifest, p as polyfillBloxSsgGlobals, f as fetchCmsSiteData, b as buildCollectionResolver, a as prerender, c as validateInternalLinks } from "../validate-output-yDJYYYzK.js";
|
|
6
|
+
import { s as setPageSlugMap } from "../localeStrategy-hXlNof1E.js";
|
|
6
7
|
function installFetchTimeout() {
|
|
7
8
|
const ms = Number(process.env.BLOX_SSG_FETCH_TIMEOUT_MS) || 2e4;
|
|
8
9
|
const original = globalThis.fetch;
|
|
@@ -146,7 +147,7 @@ Environment:
|
|
|
146
147
|
if (shardsOpt !== null || routesCmd) {
|
|
147
148
|
const { apiBase: apiBase2, websiteName: configWebsiteName2 } = await resolveApiBase(mode);
|
|
148
149
|
const websiteName2 = process.env.WEBSITE_NAME ?? configWebsiteName2 ?? "default";
|
|
149
|
-
const { runSharded } = await import("../shard-runner-
|
|
150
|
+
const { runSharded } = await import("../shard-runner-DFrc8d4O.js");
|
|
150
151
|
const code = await runSharded({
|
|
151
152
|
shards: shardsOpt ?? "auto",
|
|
152
153
|
mode,
|
|
@@ -182,6 +183,7 @@ Environment:
|
|
|
182
183
|
let cmsPathSet = /* @__PURE__ */ new Set();
|
|
183
184
|
let cachedAppPaths = [];
|
|
184
185
|
let collectionItems;
|
|
186
|
+
let pageSlugMap = {};
|
|
185
187
|
const productionBuild = process.env.NODE_ENV === "production" || mode === "production";
|
|
186
188
|
try {
|
|
187
189
|
const siteData = siteDataFile ? JSON.parse(await fs.readFile(siteDataFile, "utf8")) : await fetchCmsSiteData(apiBase, websiteName, buildRequest);
|
|
@@ -192,6 +194,8 @@ Environment:
|
|
|
192
194
|
websiteId = siteData.websiteId;
|
|
193
195
|
redirects = siteData.redirects;
|
|
194
196
|
collectionItems = siteData.collectionItems;
|
|
197
|
+
setPageSlugMap(siteData.pageSlugMap);
|
|
198
|
+
pageSlugMap = siteData.pageSlugMap ?? {};
|
|
195
199
|
if (!siteDataFile) {
|
|
196
200
|
console.log(` Found ${paths.length} CMS routes`);
|
|
197
201
|
if (redirects.length > 0) console.log(` Found ${redirects.length} redirects`);
|
|
@@ -246,6 +250,9 @@ Environment:
|
|
|
246
250
|
website,
|
|
247
251
|
websiteId,
|
|
248
252
|
redirects,
|
|
253
|
+
// Canonical localized page paths, injected into each document's
|
|
254
|
+
// hydration payload so client-side links resolve without a redirect.
|
|
255
|
+
pageSlugMap,
|
|
249
256
|
// LLM artifacts (llms.txt, llms-full.txt, per-page JSON-LD). On by
|
|
250
257
|
// default; opt out with BLOX_SSG_LLM=0. Skip the *file* artifacts when
|
|
251
258
|
// sharding (>1 shard) because the writing shard only has its own slice of
|
package/dist/ssg/cms-routes.d.ts
CHANGED
|
@@ -12,6 +12,13 @@ export interface CmsSiteData {
|
|
|
12
12
|
paths: string[];
|
|
13
13
|
/** Locale-qualified published CMS page slugs, including dynamic templates. */
|
|
14
14
|
pageSlugs: string[];
|
|
15
|
+
/**
|
|
16
|
+
* Canonical localized path per locale for every static CMS page, keyed by its
|
|
17
|
+
* default-locale path (`{ "/about-us": { en, es, fr, it, nl } }`).
|
|
18
|
+
* `LocaleStrategy.toPath()` uses it to emit canonical links instead of
|
|
19
|
+
* default-locale slugs behind a redirect.
|
|
20
|
+
*/
|
|
21
|
+
pageSlugMap: Record<string, Record<string, string>>;
|
|
15
22
|
redirects: RedirectEntry[];
|
|
16
23
|
/** Datastore collections referenced by any page's data_bindings. */
|
|
17
24
|
collections: CollectionRef[];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cms-routes.d.ts","sourceRoot":"","sources":["../../src/ssg/cms-routes.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,cAAc,CAAA;AAC/C,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,OAAO,CAAA;AAC1C,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,iBAAiB,CAAA;AAoB9D,2EAA2E;AAC3E,MAAM,WAAW,aAAa;IAC7B,KAAK,EAAE,MAAM,CAAA;IACb,UAAU,EAAE,MAAM,CAAA;CAClB;AAED,MAAM,WAAW,WAAW;IAC3B,SAAS,EAAE,MAAM,CAAA;IACjB,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AiB,CAChC,KAAK,EAAE,MAAM,EAAE,EACf,aAAa,EAAE,MAAM,EACrB,gBAAgB,EAAE,MAAM,EAAE,GACxB,MAAM,EAAE,CASV;AAMD;;;GAGG;AACH,wBAAsB,gBAAgB,CACrC,OAAO,EAAE,MAAM,EACf,WAAW,EAAE,MAAM,EACnB,cAAc,GAAE,uBAA4B,GAC1C,OAAO,CAAC,WAAW,CAAC,CAuLtB;AAkID,MAAM,MAAM,kBAAkB,GAAG,CAChC,UAAU,EAAE,MAAM,EAClB,OAAO,EAAE;IAAE,MAAM,CAAC,EAAE,MAAM,CAAC;IAAC,CAAC,CAAC,EAAE,MAAM,CAAC;IAAC,MAAM,CAAC,EAAE,MAAM,CAAC;IAAC,KAAK,CAAC,EAAE,MAAM,CAAA;CAAE,KACrE,OAAO,CAAC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAAE,GAAG,IAAI,CAAC,CAAA;AAE9C;;;;;;;;GAQG;AACH,wBAAgB,uBAAuB,CACtC,eAAe,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAAE,CAAC,GACxD,kBAAkB,CAapB"}
|
package/dist/ssg/index.cjs
CHANGED
|
@@ -22,11 +22,11 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
|
|
|
22
22
|
mod
|
|
23
23
|
));
|
|
24
24
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
25
|
-
const llmArtifacts = require("../validate-output-
|
|
25
|
+
const llmArtifacts = require("../validate-output-BymMbrA5.cjs");
|
|
26
26
|
const ssg_buildGrant = require("./build-grant.cjs");
|
|
27
27
|
const ssg_client = require("../client-AoDTJJXJ.cjs");
|
|
28
28
|
const vue = require("vue");
|
|
29
|
-
const appRuntime = require("../appRuntime-
|
|
29
|
+
const appRuntime = require("../appRuntime-Z0AxTPxf.cjs");
|
|
30
30
|
const index = require("../index-DUjEj7ts.cjs");
|
|
31
31
|
async function renderBloxSsgPage(options) {
|
|
32
32
|
var _a, _b, _c, _d;
|
|
@@ -41,6 +41,7 @@ async function renderBloxSsgPage(options) {
|
|
|
41
41
|
locale,
|
|
42
42
|
website = null,
|
|
43
43
|
websiteId = "",
|
|
44
|
+
pageSlugMap = {},
|
|
44
45
|
llm
|
|
45
46
|
} = options;
|
|
46
47
|
if (resolvedData != null && !websiteId) {
|
|
@@ -72,6 +73,7 @@ async function renderBloxSsgPage(options) {
|
|
|
72
73
|
version: 2,
|
|
73
74
|
...resolvedData != null ? { route: { path: stateKey, resolved: resolvedData } } : {},
|
|
74
75
|
...websiteId ? { websiteId } : {},
|
|
76
|
+
...Object.keys(pageSlugMap).length ? { pageSlugMap } : {},
|
|
75
77
|
data: bloxData
|
|
76
78
|
})};${"<"}/script>`;
|
|
77
79
|
let head = llmArtifacts.buildPageHead({
|
package/dist/ssg/index.mjs
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { d as buildPageHead, e as primaryContextEntry, h as buildJsonLd, i as extractPageText, B as BloxBuildResponseError, j as bloxBuildJson } from "../validate-output-
|
|
2
|
-
import { k, l, f, m, n, o, q, g, r, s, t, w, x, y, p, a, z, A, u, c, v } from "../validate-output-
|
|
1
|
+
import { d as buildPageHead, e as primaryContextEntry, h as buildJsonLd, i as extractPageText, B as BloxBuildResponseError, j as bloxBuildJson } from "../validate-output-yDJYYYzK.js";
|
|
2
|
+
import { k, l, f, m, n, o, q, g, r, s, t, w, x, y, p, a, z, A, u, c, v } from "../validate-output-yDJYYYzK.js";
|
|
3
3
|
import { parseBloxBuildGrantBody, resolveBloxBuildGrant } from "./build-grant.mjs";
|
|
4
4
|
import { a as BLOX_HYDRATION_WINDOW_KEY } from "../client-Ce9fRCGH.js";
|
|
5
5
|
import { createSSRApp, h, Suspense } from "vue";
|
|
6
|
-
import { c as collectBloxData, a as collectBloxSeo, p as provideBloxData, b as provideBloxLocale, B as BLOX_SSR_ROUTE_STATE_KEY, i as installBloxRuntime, s as setActiveLocale } from "../appRuntime-
|
|
6
|
+
import { c as collectBloxData, a as collectBloxSeo, p as provideBloxData, b as provideBloxLocale, B as BLOX_SSR_ROUTE_STATE_KEY, i as installBloxRuntime, s as setActiveLocale } from "../appRuntime-DZSCSsnS.js";
|
|
7
7
|
import { provideBloxApi, getCollectionResolver } from "../index-I81QTzv-.js";
|
|
8
8
|
async function renderBloxSsgPage(options) {
|
|
9
9
|
var _a, _b, _c, _d;
|
|
@@ -18,6 +18,7 @@ async function renderBloxSsgPage(options) {
|
|
|
18
18
|
locale,
|
|
19
19
|
website = null,
|
|
20
20
|
websiteId = "",
|
|
21
|
+
pageSlugMap = {},
|
|
21
22
|
llm
|
|
22
23
|
} = options;
|
|
23
24
|
if (resolvedData != null && !websiteId) {
|
|
@@ -49,6 +50,7 @@ async function renderBloxSsgPage(options) {
|
|
|
49
50
|
version: 2,
|
|
50
51
|
...resolvedData != null ? { route: { path: stateKey, resolved: resolvedData } } : {},
|
|
51
52
|
...websiteId ? { websiteId } : {},
|
|
53
|
+
...Object.keys(pageSlugMap).length ? { pageSlugMap } : {},
|
|
52
54
|
data: bloxData
|
|
53
55
|
})};${"<"}/script>`;
|
|
54
56
|
let head = buildPageHead({
|
package/dist/ssg/prerender.d.ts
CHANGED
|
@@ -34,6 +34,8 @@ export interface PrerenderOptions {
|
|
|
34
34
|
websiteId?: string;
|
|
35
35
|
/** Redirects to write as _redirects (Netlify). */
|
|
36
36
|
redirects?: RedirectEntry[];
|
|
37
|
+
/** Canonical localized page paths, embedded in each document's hydration payload. */
|
|
38
|
+
pageSlugMap?: Record<string, Record<string, string>>;
|
|
37
39
|
/** LLM artifacts config (llms.txt, llms-full.txt, per-page JSON-LD). */
|
|
38
40
|
llm?: LlmArtifactsConfig;
|
|
39
41
|
}
|
|
@@ -98,7 +100,7 @@ export declare function prerender({ root, clientOutDir, serverEntry, paths, craw
|
|
|
98
100
|
* sharded runner divides a global budget by the shard count. 0 disables
|
|
99
101
|
* prefetch (render resolves inline). Default 8.
|
|
100
102
|
*/
|
|
101
|
-
resolvePrefetchConcurrency, appPaths, includeRoot, routePartsFile, mode, website, websiteId, redirects, llm, }?: PrerenderOptions): Promise<PrerenderResult>;
|
|
103
|
+
resolvePrefetchConcurrency, appPaths, includeRoot, routePartsFile, mode, website, websiteId, redirects, pageSlugMap, llm, }?: PrerenderOptions): Promise<PrerenderResult>;
|
|
102
104
|
/**
|
|
103
105
|
* Collect `<link rel="preload">` tags for the web fonts a page is likely to use.
|
|
104
106
|
*
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"prerender.d.ts","sourceRoot":"","sources":["../../src/ssg/prerender.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,cAAc,CAAA;AAC/C,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,OAAO,CAAA;AAC1C,OAAO,KAAK,EAAE,kBAAkB,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAA;AAiBvE,KAAK,WAAW,GAAG,MAAM,GAAG,MAAM,GAAG,CAAC,CAAC,IAAI,EAAE,MAAM,KAAK,OAAO,CAAC,CAAA;AAEhE,MAAM,WAAW,gBAAgB;IAChC,IAAI,CAAC,EAAE,MAAM,CAAA;IACb,YAAY,CAAC,EAAE,MAAM,CAAA;IACrB,WAAW,CAAC,EAAE,MAAM,CAAA;IACpB,KAAK,CAAC,EAAE,MAAM,EAAE,CAAA;IAChB,KAAK,CAAC,EAAE,OAAO,CAAA;IACf,YAAY,CAAC,EAAE,WAAW,GAAG,WAAW,EAAE,CAAA;IAC1C,QAAQ,CAAC,EAAE,OAAO,CAAA;IAClB,QAAQ,CAAC,EAAE,MAAM,CAAA;IACjB,yDAAyD;IACzD,WAAW,CAAC,EAAE,MAAM,CAAA;IACpB;;;;OAIG;IACH,iBAAiB,CAAC,EAAE,OAAO,CAAA;IAC3B,6FAA6F;IAC7F,0BAA0B,CAAC,EAAE,MAAM,CAAA;IACnC,6EAA6E;IAC7E,Q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AAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,GAC/B,MAAM,CA2BR"}
|
|
@@ -39,6 +39,8 @@ export declare function renderBloxSsgPage<TApp>(options: {
|
|
|
39
39
|
website?: WebsiteRead | null;
|
|
40
40
|
/** Resolved website ID — embedded so client skips GET /blox/websites. */
|
|
41
41
|
websiteId?: string;
|
|
42
|
+
/** Canonical localized page paths, embedded for client-side link resolution. */
|
|
43
|
+
pageSlugMap?: Record<string, Record<string, string>>;
|
|
42
44
|
/** LLM artifacts config — gates JSON-LD injection + llms.txt text capture. */
|
|
43
45
|
llm?: LlmArtifactsConfig;
|
|
44
46
|
}): Promise<{
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"render-resolved-page.d.ts","sourceRoot":"","sources":["../../src/ssg/render-resolved-page.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,cAAc,CAAA;AAE/C,OAAO,KAAK,EAAE,gBAAgB,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAA;AAGpE,OAAO,KAAK,EAAE,kBAAkB,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAA;AAGvE,UAAU,cAAc;IACvB,SAAS,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAA;CAClC;AAED,MAAM,WAAW,iBAAiB;IACjC,IAAI,EAAE,CAAC,GAAG,EAAE,MAAM,KAAK,OAAO,CAAC,IAAI,CAAC,CAAA;IACpC,OAAO,EAAE,MAAM,OAAO,CAAC,IAAI,CAAC,CAAA;CAC5B;AAED;;;;;;;GAOG;AACH,wBAAsB,iBAAiB,CAAC,IAAI,EAAE,OAAO,EAAE;IACtD,GAAG,EAAE,MAAM,CAAA;IACX,YAAY,EAAE,OAAO,GAAG,IAAI,CAAA;IAC5B,cAAc,EAAE,CAAC,GAAG,EAAE,IAAI,EAAE,OAAO,CAAC,EAAE,cAAc,KAAK,OAAO,CAAC,MAAM,CAAC,CAAA;IACxE,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AC,CAAA;IACpD,8EAA8E;IAC9E,GAAG,CAAC,EAAE,kBAAkB,CAAA;CACxB,GAAG,OAAO,CAAC;IACX,IAAI,EAAE,MAAM,CAAA;IACZ,IAAI,CAAC,EAAE,MAAM,CAAA;IACb,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB,SAAS,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAA;IAClC,GAAG,CAAC,EAAE,YAAY,CAAA;CAClB,CAAC,CAgHD;AAED,yFAAyF;AACzF,wBAAgB,QAAQ,CAAC,KAAK,EAAE,OAAO,GAAG,MAAM,CAE/C"}
|
|
@@ -23,6 +23,9 @@ export interface ShardRunnerOptions {
|
|
|
23
23
|
routesCmd?: string;
|
|
24
24
|
}
|
|
25
25
|
export declare function matchesCmsPath(pathname: string, cmsPaths: Set<string>): boolean;
|
|
26
|
+
export declare function sitemapRoutesForWebsite<T extends {
|
|
27
|
+
noindex: boolean;
|
|
28
|
+
}>(routes: T[], siteNoindex: boolean | undefined): T[];
|
|
26
29
|
/**
|
|
27
30
|
* Coordinate a sharded prerender. Returns the process exit code.
|
|
28
31
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"shard-runner.d.ts","sourceRoot":"","sources":["../../src/ssg/shard-runner.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AAQH,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,iBAAiB,CAAA;AAI9D,MAAM,WAAW,kBAAkB;IAClC,qDAAqD;IACrD,MAAM,EAAE,MAAM,GAAG,MAAM,CAAA;IACvB,0DAA0D;IAC1D,IAAI,EAAE,MAAM,CAAA;IACZ,uDAAuD;IACvD,OAAO,EAAE,MAAM,CAAA;IACf,sDAAsD;IACtD,WAAW,EAAE,MAAM,CAAA;IACnB,yEAAyE;IACzE,YAAY,CAAC,EAAE,uBAAuB,CAAA;IACtC,iFAAiF;IACjF,UAAU,EAAE,MAAM,EAAE,CAAA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AC,IAAI,EAAE,kBAAkB,GAAG,OAAO,CAAC,MAAM,CAAC,CA0J1E"}
|
|
@@ -26,7 +26,7 @@ const fs = require("node:fs/promises");
|
|
|
26
26
|
const path = require("node:path");
|
|
27
27
|
const process$1 = require("node:process");
|
|
28
28
|
const node_url = require("node:url");
|
|
29
|
-
const
|
|
29
|
+
const localeStrategy = require("./localeStrategy-OwRIn35C.cjs");
|
|
30
30
|
class BloxBuildResponseError extends Error {
|
|
31
31
|
constructor(status, url, statusText) {
|
|
32
32
|
super(`Build API ${status} ${statusText}: ${url}`);
|
|
@@ -95,6 +95,24 @@ async function bloxBuildJson(input, init = {}, options = {}) {
|
|
|
95
95
|
if (response.status === 204) return null;
|
|
96
96
|
return response.json();
|
|
97
97
|
}
|
|
98
|
+
function buildPageSlugMap(localizedBundles, defaultLocale) {
|
|
99
|
+
var _a;
|
|
100
|
+
const map = {};
|
|
101
|
+
const defaultPages = ((_a = localizedBundles.find((result) => result.locale === defaultLocale)) == null ? void 0 : _a.bundle.pages) ?? [];
|
|
102
|
+
const canonicalById = new Map(
|
|
103
|
+
defaultPages.flatMap((page) => page.id && page.slug && !page.slug.includes(":") ? [[page.id, page.slug]] : [])
|
|
104
|
+
);
|
|
105
|
+
for (const { locale, bundle } of localizedBundles) {
|
|
106
|
+
for (const page of bundle.pages) {
|
|
107
|
+
if (!page.slug || page.slug.includes(":") || page.status && page.status !== "published") continue;
|
|
108
|
+
const canonical = page.id ? canonicalById.get(page.id) : void 0;
|
|
109
|
+
if (!canonical) continue;
|
|
110
|
+
const entry = map[canonical] ?? (map[canonical] = { [defaultLocale]: canonical });
|
|
111
|
+
entry[locale] = page.slug;
|
|
112
|
+
}
|
|
113
|
+
}
|
|
114
|
+
return map;
|
|
115
|
+
}
|
|
98
116
|
function localizePath(slug, locale, defaultLocale) {
|
|
99
117
|
if (locale === defaultLocale) return slug === "" ? "/" : slug;
|
|
100
118
|
const s = slug === "" || slug === "/" ? "" : slug;
|
|
@@ -141,7 +159,7 @@ async function fetchCmsSiteData(apiBase, websiteName, requestOptions = {}) {
|
|
|
141
159
|
return [{
|
|
142
160
|
from_path: fromPath,
|
|
143
161
|
to_path: localizePath(page.slug, locale, defaultLocale2),
|
|
144
|
-
status_code:
|
|
162
|
+
status_code: 301
|
|
145
163
|
}];
|
|
146
164
|
});
|
|
147
165
|
});
|
|
@@ -155,6 +173,7 @@ async function fetchCmsSiteData(apiBase, websiteName, requestOptions = {}) {
|
|
|
155
173
|
website: website2,
|
|
156
174
|
paths: paths2,
|
|
157
175
|
pageSlugs: [...new Set(localizedBundles.flatMap((result) => result.bundle.pages.flatMap((page) => page.slug ? [localizePath(page.slug, result.locale, defaultLocale2)] : [])))],
|
|
176
|
+
pageSlugMap: buildPageSlugMap(localizedBundles, defaultLocale2),
|
|
158
177
|
redirects: redirects2,
|
|
159
178
|
collections: extractCollectionRefs(localizedBundles.flatMap((result) => result.bundle.pages)),
|
|
160
179
|
collectionItems
|
|
@@ -198,7 +217,7 @@ async function fetchCmsSiteData(apiBase, websiteName, requestOptions = {}) {
|
|
|
198
217
|
return [{
|
|
199
218
|
from_path: fromPath,
|
|
200
219
|
to_path: localizePath(page.slug, locale, defaultLocale),
|
|
201
|
-
status_code:
|
|
220
|
+
status_code: 301
|
|
202
221
|
}];
|
|
203
222
|
});
|
|
204
223
|
});
|
|
@@ -214,7 +233,18 @@ async function fetchCmsSiteData(apiBase, websiteName, requestOptions = {}) {
|
|
|
214
233
|
const pages = localizedPages.flatMap((result) => result.pages);
|
|
215
234
|
const collections = extractCollectionRefs(pages);
|
|
216
235
|
const pageSlugs = [...new Set(localizedPages.flatMap((result) => result.pages.flatMap((page) => page.slug ? [localizePath(page.slug, result.locale, defaultLocale)] : [])))];
|
|
217
|
-
return {
|
|
236
|
+
return {
|
|
237
|
+
websiteId: site.id,
|
|
238
|
+
website,
|
|
239
|
+
paths,
|
|
240
|
+
pageSlugs,
|
|
241
|
+
pageSlugMap: buildPageSlugMap(
|
|
242
|
+
localizedPages.map((result) => ({ locale: result.locale, bundle: { pages: result.pages } })),
|
|
243
|
+
defaultLocale
|
|
244
|
+
),
|
|
245
|
+
redirects,
|
|
246
|
+
collections
|
|
247
|
+
};
|
|
218
248
|
}
|
|
219
249
|
async function expandRoutes(apiBase, pages, requestOptions, locale, collectItems) {
|
|
220
250
|
const routes = [];
|
|
@@ -444,7 +474,7 @@ function buildPageHead(options) {
|
|
|
444
474
|
const page = resolvedData == null ? void 0 : resolvedData.page;
|
|
445
475
|
const ctx = extractPrimaryContext(resolvedData == null ? void 0 : resolvedData.contexts);
|
|
446
476
|
const siteName = seo.site_name || void 0;
|
|
447
|
-
const title =
|
|
477
|
+
const title = localeStrategy.resolvePageTitle(resolvedData ?? {}, {
|
|
448
478
|
override: override == null ? void 0 : override.title,
|
|
449
479
|
siteName,
|
|
450
480
|
defaultTitle: seo.default_meta_title
|
|
@@ -738,20 +768,20 @@ function getSiteIconFlags(website) {
|
|
|
738
768
|
function extractPrimaryContext(contexts) {
|
|
739
769
|
var _a;
|
|
740
770
|
const empty = { title: null, description: null, image: null };
|
|
741
|
-
const ctx = (_a =
|
|
771
|
+
const ctx = (_a = localeStrategy.primaryPageContext(contexts)) == null ? void 0 : _a.ctx;
|
|
742
772
|
if (!ctx) return empty;
|
|
743
773
|
const str2 = (key) => {
|
|
744
774
|
const v = ctx[key];
|
|
745
775
|
return typeof v === "string" && v.trim() ? v.trim() : null;
|
|
746
776
|
};
|
|
747
777
|
return {
|
|
748
|
-
title:
|
|
778
|
+
title: localeStrategy.contextPageTitle(ctx),
|
|
749
779
|
description: str2("meta_description") || str2("excerpt") || str2("description") || str2("blurb") || str2("summary"),
|
|
750
780
|
image: str2("og_image") || str2("cover_image_url") || str2("image_url") || str2("image")
|
|
751
781
|
};
|
|
752
782
|
}
|
|
753
783
|
function primaryContextEntry(contexts) {
|
|
754
|
-
return
|
|
784
|
+
return localeStrategy.primaryPageContext(contexts);
|
|
755
785
|
}
|
|
756
786
|
function esc(s) {
|
|
757
787
|
return s.replace(/&/g, "&").replace(/"/g, """).replace(/</g, "<").replace(/>/g, ">");
|
|
@@ -1015,6 +1045,7 @@ async function prerender({
|
|
|
1015
1045
|
website = null,
|
|
1016
1046
|
websiteId = "",
|
|
1017
1047
|
redirects = [],
|
|
1048
|
+
pageSlugMap = {},
|
|
1018
1049
|
llm = {}
|
|
1019
1050
|
} = {}) {
|
|
1020
1051
|
var _a, _b, _c, _d, _e, _f;
|
|
@@ -1122,6 +1153,7 @@ async function prerender({
|
|
|
1122
1153
|
template,
|
|
1123
1154
|
website,
|
|
1124
1155
|
websiteId,
|
|
1156
|
+
pageSlugMap,
|
|
1125
1157
|
resolveCache,
|
|
1126
1158
|
llm
|
|
1127
1159
|
});
|
|
@@ -3,7 +3,7 @@ import fs, { readFile } from "node:fs/promises";
|
|
|
3
3
|
import path, { resolve } from "node:path";
|
|
4
4
|
import process$1 from "node:process";
|
|
5
5
|
import { pathToFileURL } from "node:url";
|
|
6
|
-
import { r as resolvePageTitle, p as primaryPageContext, c as contextPageTitle } from "./
|
|
6
|
+
import { r as resolvePageTitle, p as primaryPageContext, c as contextPageTitle } from "./localeStrategy-hXlNof1E.js";
|
|
7
7
|
class BloxBuildResponseError extends Error {
|
|
8
8
|
constructor(status, url, statusText) {
|
|
9
9
|
super(`Build API ${status} ${statusText}: ${url}`);
|
|
@@ -72,6 +72,24 @@ async function bloxBuildJson(input, init = {}, options = {}) {
|
|
|
72
72
|
if (response.status === 204) return null;
|
|
73
73
|
return response.json();
|
|
74
74
|
}
|
|
75
|
+
function buildPageSlugMap(localizedBundles, defaultLocale) {
|
|
76
|
+
var _a;
|
|
77
|
+
const map = {};
|
|
78
|
+
const defaultPages = ((_a = localizedBundles.find((result) => result.locale === defaultLocale)) == null ? void 0 : _a.bundle.pages) ?? [];
|
|
79
|
+
const canonicalById = new Map(
|
|
80
|
+
defaultPages.flatMap((page) => page.id && page.slug && !page.slug.includes(":") ? [[page.id, page.slug]] : [])
|
|
81
|
+
);
|
|
82
|
+
for (const { locale, bundle } of localizedBundles) {
|
|
83
|
+
for (const page of bundle.pages) {
|
|
84
|
+
if (!page.slug || page.slug.includes(":") || page.status && page.status !== "published") continue;
|
|
85
|
+
const canonical = page.id ? canonicalById.get(page.id) : void 0;
|
|
86
|
+
if (!canonical) continue;
|
|
87
|
+
const entry = map[canonical] ?? (map[canonical] = { [defaultLocale]: canonical });
|
|
88
|
+
entry[locale] = page.slug;
|
|
89
|
+
}
|
|
90
|
+
}
|
|
91
|
+
return map;
|
|
92
|
+
}
|
|
75
93
|
function localizePath(slug, locale, defaultLocale) {
|
|
76
94
|
if (locale === defaultLocale) return slug === "" ? "/" : slug;
|
|
77
95
|
const s = slug === "" || slug === "/" ? "" : slug;
|
|
@@ -118,7 +136,7 @@ async function fetchCmsSiteData(apiBase, websiteName, requestOptions = {}) {
|
|
|
118
136
|
return [{
|
|
119
137
|
from_path: fromPath,
|
|
120
138
|
to_path: localizePath(page.slug, locale, defaultLocale2),
|
|
121
|
-
status_code:
|
|
139
|
+
status_code: 301
|
|
122
140
|
}];
|
|
123
141
|
});
|
|
124
142
|
});
|
|
@@ -132,6 +150,7 @@ async function fetchCmsSiteData(apiBase, websiteName, requestOptions = {}) {
|
|
|
132
150
|
website: website2,
|
|
133
151
|
paths: paths2,
|
|
134
152
|
pageSlugs: [...new Set(localizedBundles.flatMap((result) => result.bundle.pages.flatMap((page) => page.slug ? [localizePath(page.slug, result.locale, defaultLocale2)] : [])))],
|
|
153
|
+
pageSlugMap: buildPageSlugMap(localizedBundles, defaultLocale2),
|
|
135
154
|
redirects: redirects2,
|
|
136
155
|
collections: extractCollectionRefs(localizedBundles.flatMap((result) => result.bundle.pages)),
|
|
137
156
|
collectionItems
|
|
@@ -175,7 +194,7 @@ async function fetchCmsSiteData(apiBase, websiteName, requestOptions = {}) {
|
|
|
175
194
|
return [{
|
|
176
195
|
from_path: fromPath,
|
|
177
196
|
to_path: localizePath(page.slug, locale, defaultLocale),
|
|
178
|
-
status_code:
|
|
197
|
+
status_code: 301
|
|
179
198
|
}];
|
|
180
199
|
});
|
|
181
200
|
});
|
|
@@ -191,7 +210,18 @@ async function fetchCmsSiteData(apiBase, websiteName, requestOptions = {}) {
|
|
|
191
210
|
const pages = localizedPages.flatMap((result) => result.pages);
|
|
192
211
|
const collections = extractCollectionRefs(pages);
|
|
193
212
|
const pageSlugs = [...new Set(localizedPages.flatMap((result) => result.pages.flatMap((page) => page.slug ? [localizePath(page.slug, result.locale, defaultLocale)] : [])))];
|
|
194
|
-
return {
|
|
213
|
+
return {
|
|
214
|
+
websiteId: site.id,
|
|
215
|
+
website,
|
|
216
|
+
paths,
|
|
217
|
+
pageSlugs,
|
|
218
|
+
pageSlugMap: buildPageSlugMap(
|
|
219
|
+
localizedPages.map((result) => ({ locale: result.locale, bundle: { pages: result.pages } })),
|
|
220
|
+
defaultLocale
|
|
221
|
+
),
|
|
222
|
+
redirects,
|
|
223
|
+
collections
|
|
224
|
+
};
|
|
195
225
|
}
|
|
196
226
|
async function expandRoutes(apiBase, pages, requestOptions, locale, collectItems) {
|
|
197
227
|
const routes = [];
|
|
@@ -992,6 +1022,7 @@ async function prerender({
|
|
|
992
1022
|
website = null,
|
|
993
1023
|
websiteId = "",
|
|
994
1024
|
redirects = [],
|
|
1025
|
+
pageSlugMap = {},
|
|
995
1026
|
llm = {}
|
|
996
1027
|
} = {}) {
|
|
997
1028
|
var _a, _b, _c, _d, _e, _f;
|
|
@@ -1099,6 +1130,7 @@ async function prerender({
|
|
|
1099
1130
|
template,
|
|
1100
1131
|
website,
|
|
1101
1132
|
websiteId,
|
|
1133
|
+
pageSlugMap,
|
|
1102
1134
|
resolveCache,
|
|
1103
1135
|
llm
|
|
1104
1136
|
});
|