@bagelink/blox 1.15.228 → 1.15.232
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/{prerender-FPRGhRSk.js → prerender-DnqZAE4x.js} +249 -19
- package/dist/{prerender-CD3vMqn6.cjs → prerender-jcemLPiq.cjs} +243 -13
- package/dist/ssg/cli.cjs +22 -2
- package/dist/ssg/cli.mjs +22 -2
- package/dist/ssg/createSSREntry.d.ts.map +1 -1
- package/dist/ssg/index.cjs +39 -5
- package/dist/ssg/index.d.ts +2 -0
- package/dist/ssg/index.d.ts.map +1 -1
- package/dist/ssg/index.mjs +48 -14
- package/dist/ssg/llm-artifacts.d.ts +107 -0
- package/dist/ssg/llm-artifacts.d.ts.map +1 -0
- package/dist/ssg/prerender.d.ts +14 -3
- package/dist/ssg/prerender.d.ts.map +1 -1
- package/dist/ssg/render-resolved-page.d.ts +4 -0
- package/dist/ssg/render-resolved-page.d.ts.map +1 -1
- package/dist/ssg/seo.d.ts +24 -0
- package/dist/ssg/seo.d.ts.map +1 -1
- package/package.json +1 -1
package/dist/ssg/index.mjs
CHANGED
|
@@ -1,11 +1,12 @@
|
|
|
1
|
-
import { b as buildPageHead } from "../prerender-
|
|
2
|
-
import {
|
|
1
|
+
import { b as buildPageHead, c as primaryContextEntry, d as buildJsonLd, e as extractPageText } from "../prerender-DnqZAE4x.js";
|
|
2
|
+
import { g, h, f, i, j, k, l, m, n, o, p, a } from "../prerender-DnqZAE4x.js";
|
|
3
3
|
import { BLOX_STATE_WINDOW_KEY, BLOX_COLLECTIONS_WINDOW_KEY, BLOX_WEBSITE_ID_WINDOW_KEY } from "./client.mjs";
|
|
4
4
|
import { BLOX_DATA_WINDOW_KEY, BLOX_PAGE_SEO_WINDOW_KEY, getCollectionCache, getEmbeddedWebsiteId, installBloxStateCache, installCollectionCache } from "./client.mjs";
|
|
5
5
|
import { createPinia } from "pinia";
|
|
6
6
|
import { createSSRApp, h as h2, Suspense, markRaw } from "vue";
|
|
7
7
|
import { B as BLOX_DATA_WINDOW_KEY2, s as setApiOrigin, a as setActiveLocale, c as collectBloxData, b as collectBloxSeo, p as provideBloxData, d as createBlox, g as generateContentRoutes, i as installLocaleAwareResolve } from "../routes-Dkujcgil.js";
|
|
8
8
|
async function renderBloxSsgPage(options) {
|
|
9
|
+
var _a, _b, _c;
|
|
9
10
|
const {
|
|
10
11
|
url,
|
|
11
12
|
resolvedData,
|
|
@@ -18,7 +19,8 @@ async function renderBloxSsgPage(options) {
|
|
|
18
19
|
locale,
|
|
19
20
|
website = null,
|
|
20
21
|
websiteId = "",
|
|
21
|
-
collections
|
|
22
|
+
collections,
|
|
23
|
+
llm
|
|
22
24
|
} = options;
|
|
23
25
|
const g2 = globalThis;
|
|
24
26
|
const prevState = g2[stateWindowKey];
|
|
@@ -37,7 +39,7 @@ async function renderBloxSsgPage(options) {
|
|
|
37
39
|
const seoOverride = seoHead && Object.keys(seoHead).length > 0 ? seoHead : void 0;
|
|
38
40
|
const bloxData = dataRegistry && collectData ? collectData(dataRegistry) : {};
|
|
39
41
|
const dataScript = Object.keys(bloxData).length > 0 ? `<script>window[${JSON.stringify(BLOX_DATA_WINDOW_KEY2)}]=${safeJson(bloxData)};${"<"}/script>` : "";
|
|
40
|
-
|
|
42
|
+
let head = buildPageHead({
|
|
41
43
|
url,
|
|
42
44
|
resolvedData,
|
|
43
45
|
website,
|
|
@@ -45,9 +47,35 @@ async function renderBloxSsgPage(options) {
|
|
|
45
47
|
override: seoOverride,
|
|
46
48
|
stateScript: [stateScript, collectionsScript, websiteIdScript, dataScript].filter(Boolean).join("\n")
|
|
47
49
|
});
|
|
50
|
+
const seoData = resolvedData;
|
|
51
|
+
const primary = primaryContextEntry(seoData == null ? void 0 : seoData.contexts);
|
|
52
|
+
if ((llm == null ? void 0 : llm.jsonLd) !== false) {
|
|
53
|
+
const jsonLd = buildJsonLd({
|
|
54
|
+
url,
|
|
55
|
+
page: seoData == null ? void 0 : seoData.page,
|
|
56
|
+
website,
|
|
57
|
+
contextKey: primary == null ? void 0 : primary.key,
|
|
58
|
+
context: primary == null ? void 0 : primary.ctx,
|
|
59
|
+
locale,
|
|
60
|
+
config: llm
|
|
61
|
+
});
|
|
62
|
+
if (jsonLd) head += `
|
|
63
|
+
${jsonLd}`;
|
|
64
|
+
}
|
|
65
|
+
let llmEntry;
|
|
66
|
+
if ((llm == null ? void 0 : llm.enabled) !== false) {
|
|
67
|
+
const title = (seoOverride == null ? void 0 : seoOverride.title) || ((_a = seoData == null ? void 0 : seoData.page) == null ? void 0 : _a.meta_title) || ((_b = seoData == null ? void 0 : seoData.page) == null ? void 0 : _b.title) || "";
|
|
68
|
+
const description = (seoOverride == null ? void 0 : seoOverride.description) || ((_c = seoData == null ? void 0 : seoData.page) == null ? void 0 : _c.meta_description) || void 0;
|
|
69
|
+
llmEntry = {
|
|
70
|
+
url,
|
|
71
|
+
title,
|
|
72
|
+
description,
|
|
73
|
+
text: (llm == null ? void 0 : llm.fullText) !== false ? extractPageText(html) : void 0
|
|
74
|
+
};
|
|
75
|
+
}
|
|
48
76
|
const lang = locale || (website == null ? void 0 : website.default_locale) || "en";
|
|
49
77
|
const htmlAttrs = `lang="${lang}"`;
|
|
50
|
-
return { html, head, htmlAttrs };
|
|
78
|
+
return { html, head, htmlAttrs, llm: llmEntry };
|
|
51
79
|
} finally {
|
|
52
80
|
if (prevState !== void 0) {
|
|
53
81
|
g2[stateWindowKey] = prevState;
|
|
@@ -150,8 +178,8 @@ function createBloxSSREntry(options) {
|
|
|
150
178
|
} else {
|
|
151
179
|
try {
|
|
152
180
|
resolvedData = await fetchResolvedPage(slug, pageLocale);
|
|
153
|
-
} catch (
|
|
154
|
-
console.warn(`[prerender] Could not resolve: ${url} — ${
|
|
181
|
+
} catch (e) {
|
|
182
|
+
console.warn(`[prerender] Could not resolve: ${url} — ${e.message}`);
|
|
155
183
|
}
|
|
156
184
|
}
|
|
157
185
|
const { renderToString } = await import("vue/server-renderer");
|
|
@@ -168,7 +196,8 @@ function createBloxSSREntry(options) {
|
|
|
168
196
|
collectSeo: collectBloxSeo,
|
|
169
197
|
website: ctx.website,
|
|
170
198
|
websiteId: ctx.websiteId,
|
|
171
|
-
collections: ctx.collections
|
|
199
|
+
collections: ctx.collections,
|
|
200
|
+
llm: ctx.llm
|
|
172
201
|
});
|
|
173
202
|
}
|
|
174
203
|
async function prefetchResolve(url) {
|
|
@@ -187,19 +216,24 @@ export {
|
|
|
187
216
|
BLOX_PAGE_SEO_WINDOW_KEY,
|
|
188
217
|
BLOX_STATE_WINDOW_KEY,
|
|
189
218
|
BLOX_WEBSITE_ID_WINDOW_KEY,
|
|
219
|
+
buildJsonLd,
|
|
190
220
|
buildPageHead,
|
|
191
|
-
|
|
221
|
+
g as buildSiteHead,
|
|
192
222
|
createBloxSSREntry,
|
|
193
|
-
|
|
223
|
+
extractPageText,
|
|
224
|
+
h as fetchCmsPrerenderPaths,
|
|
194
225
|
f as fetchCmsSiteData,
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
226
|
+
i as generateLlmsFullTxt,
|
|
227
|
+
j as generateLlmsTxt,
|
|
228
|
+
k as generateNetlifyRedirects,
|
|
229
|
+
l as generateRobotsTxt,
|
|
230
|
+
m as generateSitemapXml,
|
|
198
231
|
getCollectionCache,
|
|
199
232
|
getEmbeddedWebsiteId,
|
|
200
|
-
|
|
233
|
+
n as getSiteIconFlags,
|
|
201
234
|
installBloxStateCache,
|
|
202
235
|
installCollectionCache,
|
|
236
|
+
o as mergeLlmParts,
|
|
203
237
|
p as polyfillBloxSsgGlobals,
|
|
204
238
|
a as prerender,
|
|
205
239
|
renderBloxSsgPage
|
|
@@ -0,0 +1,107 @@
|
|
|
1
|
+
import { PageRead, WebsiteRead } from '../api/types';
|
|
2
|
+
/** Per-project configuration for the LLM artifacts (all optional). */
|
|
3
|
+
export interface LlmArtifactsConfig {
|
|
4
|
+
/** Master switch for ALL llm artifacts (JSON-LD + llms.txt). Default true. */
|
|
5
|
+
enabled?: boolean;
|
|
6
|
+
/**
|
|
7
|
+
* Write `llms.txt` / `llms-full.txt`. Default true. MUST be false when
|
|
8
|
+
* sharding (>1 shard), since the writing shard only holds its own page slice
|
|
9
|
+
* and would emit an incomplete index. Per-page JSON-LD is unaffected.
|
|
10
|
+
*/
|
|
11
|
+
writeIndex?: boolean;
|
|
12
|
+
/**
|
|
13
|
+
* When set, each (sharded) render writes its collected page extracts to this
|
|
14
|
+
* JSON file instead of the index. A coordinator merges the parts into the
|
|
15
|
+
* final llms.txt/llms-full.txt after all shards finish (see `mergeLlmParts`).
|
|
16
|
+
* The prerender substitutes `{shard}` with the shard index.
|
|
17
|
+
*/
|
|
18
|
+
partsFile?: string;
|
|
19
|
+
/** Also emit `llms-full.txt` (full page-text dump). Default true. */
|
|
20
|
+
fullText?: boolean;
|
|
21
|
+
/** Emit per-page JSON-LD (WebPage/BreadcrumbList/entity). Default true. */
|
|
22
|
+
jsonLd?: boolean;
|
|
23
|
+
/** Custom intro paragraph placed under the H1 in `llms.txt`. */
|
|
24
|
+
intro?: string;
|
|
25
|
+
/** Paths (exact or prefix with trailing `*`) to omit from llms.txt/full. */
|
|
26
|
+
excludePaths?: string[];
|
|
27
|
+
/**
|
|
28
|
+
* Map a primary context key → JSON-LD `@type`, overriding the heuristic.
|
|
29
|
+
* e.g. `{ '$listing': 'Product', '$story': 'Article' }`.
|
|
30
|
+
*/
|
|
31
|
+
typeMap?: Record<string, string>;
|
|
32
|
+
/**
|
|
33
|
+
* Group llms.txt links into sections by path prefix, in order.
|
|
34
|
+
* e.g. `[{ title: 'Blog', prefix: '/blog' }, { title: 'Shop', prefix: '/products' }]`.
|
|
35
|
+
* Unmatched pages fall under a "Pages" section.
|
|
36
|
+
*/
|
|
37
|
+
sections?: Array<{
|
|
38
|
+
title: string;
|
|
39
|
+
prefix: string;
|
|
40
|
+
}>;
|
|
41
|
+
}
|
|
42
|
+
/** One page's LLM-relevant extract, collected during render. */
|
|
43
|
+
export interface LlmPageEntry {
|
|
44
|
+
url: string;
|
|
45
|
+
title: string;
|
|
46
|
+
description?: string;
|
|
47
|
+
/** Plain-text body (chrome stripped) — only present when fullText enabled. */
|
|
48
|
+
text?: string;
|
|
49
|
+
}
|
|
50
|
+
/**
|
|
51
|
+
* Build per-page JSON-LD `<script>` tags.
|
|
52
|
+
*
|
|
53
|
+
* Always emits `WebPage` + `BreadcrumbList`. On data-bound detail pages, also
|
|
54
|
+
* emits a typed entity (`Article`/`Product`/`Event`) derived from the primary
|
|
55
|
+
* context key (overridable via `config.typeMap`).
|
|
56
|
+
*/
|
|
57
|
+
export declare function buildJsonLd(options: {
|
|
58
|
+
url: string;
|
|
59
|
+
page: PageRead | undefined;
|
|
60
|
+
website: WebsiteRead | null;
|
|
61
|
+
contextKey?: string;
|
|
62
|
+
context?: Record<string, unknown>;
|
|
63
|
+
locale?: string;
|
|
64
|
+
config?: LlmArtifactsConfig;
|
|
65
|
+
}): string;
|
|
66
|
+
/**
|
|
67
|
+
* Generate a spec-style `llms.txt`: an H1 site name, a blockquote summary,
|
|
68
|
+
* optional intro, then grouped Markdown links to every indexable page.
|
|
69
|
+
*/
|
|
70
|
+
export declare function generateLlmsTxt(options: {
|
|
71
|
+
website: WebsiteRead | null;
|
|
72
|
+
pages: LlmPageEntry[];
|
|
73
|
+
config?: LlmArtifactsConfig;
|
|
74
|
+
}): string;
|
|
75
|
+
/**
|
|
76
|
+
* Generate `llms-full.txt`: the full readable text of every page, concatenated
|
|
77
|
+
* as Markdown sections. Lets an agent ingest the whole site in a single fetch.
|
|
78
|
+
*/
|
|
79
|
+
export declare function generateLlmsFullTxt(options: {
|
|
80
|
+
website: WebsiteRead | null;
|
|
81
|
+
pages: LlmPageEntry[];
|
|
82
|
+
config?: LlmArtifactsConfig;
|
|
83
|
+
}): string;
|
|
84
|
+
/**
|
|
85
|
+
* Reduce rendered page HTML to readable plain text for `llms-full.txt`.
|
|
86
|
+
*
|
|
87
|
+
* Strips `<script>/<style>/<noscript>`, drops `<nav>/<header>/<footer>` chrome,
|
|
88
|
+
* converts headings/paragraphs/list items/breaks to newlines, removes remaining
|
|
89
|
+
* tags, decodes basic entities, and collapses whitespace. Best-effort and
|
|
90
|
+
* regex-based (no DOM in the SSG worker), which is fine for a text corpus.
|
|
91
|
+
*/
|
|
92
|
+
export declare function extractPageText(html: string): string;
|
|
93
|
+
export declare function isPathExcluded(path: string, patterns: string[] | undefined): boolean;
|
|
94
|
+
/**
|
|
95
|
+
* Merge per-shard LLM part files (each a JSON array of `LlmPageEntry`) into the
|
|
96
|
+
* final `llms.txt` / `llms-full.txt`. Run by the sharded coordinator after all
|
|
97
|
+
* shards finish. De-dupes by URL (last write wins) and sorts.
|
|
98
|
+
*/
|
|
99
|
+
export declare function mergeLlmParts(options: {
|
|
100
|
+
partFiles: string[];
|
|
101
|
+
outDir: string;
|
|
102
|
+
website: WebsiteRead | null;
|
|
103
|
+
config?: LlmArtifactsConfig;
|
|
104
|
+
}): Promise<{
|
|
105
|
+
pages: number;
|
|
106
|
+
}>;
|
|
107
|
+
//# sourceMappingURL=llm-artifacts.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"llm-artifacts.d.ts","sourceRoot":"","sources":["../../src/ssg/llm-artifacts.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAEH,OAAO,KAAK,EAAE,QAAQ,EAAE,WAAW,EAAE,MAAM,cAAc,CAAA;AAMzD,sEAAsE;AACtE,MAAM,WAAW,kBAAkB;IAClC,8EAA8E;IAC9E,OAAO,CAAC,EAAE,OAAO,CAAA;IACjB;;;;OAIG;IACH,UAAU,CAAC,EAAE,OAAO,CAAA;IACpB;;;;;OAKG;IACH,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB,qEAAqE;IACrE,QAAQ,CAAC,EAAE,OAAO,CAAA;IAClB,2EAA2E;IAC3E,MAAM,CAAC,EAAE,OAAO,CAAA;IAChB,gEAAgE;IAChE,KAAK,CAAC,EA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,MAAM,CAmBT;AAMD;;;;;;;GAOG;AACH,wBAAgB,eAAe,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAqBpD;AAMD,wBAAgB,cAAc,CAAC,IAAI,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,EAAE,GAAG,SAAS,GAAG,OAAO,CAMpF;AAED;;;;GAIG;AACH,wBAAsB,aAAa,CAAC,OAAO,EAAE;IAC5C,SAAS,EAAE,MAAM,EAAE,CAAA;IACnB,MAAM,EAAE,MAAM,CAAA;IACd,OAAO,EAAE,WAAW,GAAG,IAAI,CAAA;IAC3B,MAAM,CAAC,EAAE,kBAAkB,CAAA;CAC3B,GAAG,OAAO,CAAC;IAAE,KAAK,EAAE,MAAM,CAAA;CAAE,CAAC,CA0B7B"}
|
package/dist/ssg/prerender.d.ts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { WebsiteRead } from '../api/types';
|
|
2
2
|
import { RedirectEntry } from './seo';
|
|
3
|
+
import { LlmArtifactsConfig, LlmPageEntry } from './llm-artifacts';
|
|
3
4
|
type ExcludeRule = string | RegExp | ((path: string) => boolean);
|
|
4
5
|
export interface PrerenderOptions {
|
|
5
6
|
root?: string;
|
|
@@ -29,6 +30,8 @@ export interface PrerenderOptions {
|
|
|
29
30
|
redirects?: RedirectEntry[];
|
|
30
31
|
/** Pre-fetched datastore collections keyed by "store/collection". */
|
|
31
32
|
collections?: Record<string, unknown[]>;
|
|
33
|
+
/** LLM artifacts config (llms.txt, llms-full.txt, per-page JSON-LD). */
|
|
34
|
+
llm?: LlmArtifactsConfig;
|
|
32
35
|
}
|
|
33
36
|
export interface RenderContext {
|
|
34
37
|
manifest: Record<string, string[]> | null;
|
|
@@ -46,6 +49,8 @@ export interface RenderContext {
|
|
|
46
49
|
* that 404'd (non-CMS route) — cached as a negative to avoid refetching.
|
|
47
50
|
*/
|
|
48
51
|
resolveCache?: Map<string, unknown>;
|
|
52
|
+
/** LLM artifacts config, threaded to the SSR entry for JSON-LD + text. */
|
|
53
|
+
llm?: LlmArtifactsConfig;
|
|
49
54
|
}
|
|
50
55
|
export interface RenderResult {
|
|
51
56
|
html: string;
|
|
@@ -54,6 +59,8 @@ export interface RenderResult {
|
|
|
54
59
|
state?: unknown;
|
|
55
60
|
/** Optional ISO last-modified for this page → sitemap <lastmod>. */
|
|
56
61
|
lastmod?: string;
|
|
62
|
+
/** Per-page LLM extract (title/description/text) for llms.txt artifacts. */
|
|
63
|
+
llm?: LlmPageEntry;
|
|
57
64
|
}
|
|
58
65
|
export interface PrerenderResult {
|
|
59
66
|
rendered: string[];
|
|
@@ -80,9 +87,13 @@ export declare function prerender({ root, clientOutDir, serverEntry, paths, craw
|
|
|
80
87
|
/**
|
|
81
88
|
* How many `/resolve-path` prefetches to run in parallel, ahead of the render
|
|
82
89
|
* pool. Decouples the (I/O-bound) resolve latency from the (CPU-bound) render
|
|
83
|
-
* so pages render from an in-memory cache with no per-page round-trip.
|
|
84
|
-
*
|
|
90
|
+
* so pages render from an in-memory cache with no per-page round-trip.
|
|
91
|
+
*
|
|
92
|
+
* NOTE: this is PER PROCESS. When running N shards, the *total* load on the
|
|
93
|
+
* API is `N × this`, so keep it modest (a small API saturates ~5-wide). The
|
|
94
|
+
* sharded runner divides a global budget by the shard count. 0 disables
|
|
95
|
+
* prefetch (render resolves inline). Default 8.
|
|
85
96
|
*/
|
|
86
|
-
resolvePrefetchConcurrency, mode, website, websiteId, redirects, collections, }?: PrerenderOptions): Promise<PrerenderResult>;
|
|
97
|
+
resolvePrefetchConcurrency, mode, website, websiteId, redirects, collections, llm, }?: PrerenderOptions): Promise<PrerenderResult>;
|
|
87
98
|
export {};
|
|
88
99
|
//# sourceMappingURL=prerender.d.ts.map
|
|
@@ -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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B;AACxB;;;;;;;;;GASG;AACH,0BAA8B,EAC9B,IAAY,EACZ,OAAc,EACd,SAAc,EACd,SAAc,EACd,WAAgB,EAChB,GAAQ,GACR,GAAE,gBAAqB,GAAG,OAAO,CAAC,eAAe,CAAC,CA+OlD"}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { WebsiteRead } from '../api/types';
|
|
2
2
|
import { BloxDataRegistry, BloxSeoHead } from '../data/useData';
|
|
3
|
+
import { LlmArtifactsConfig, LlmPageEntry } from './llm-artifacts';
|
|
3
4
|
export interface BloxSsgRouterLike {
|
|
4
5
|
push: (url: string) => Promise<void>;
|
|
5
6
|
isReady: () => Promise<void>;
|
|
@@ -44,9 +45,12 @@ export declare function renderBloxSsgPage<TApp>(options: {
|
|
|
44
45
|
websiteId?: string;
|
|
45
46
|
/** Pre-fetched datastore collections — embedded for zero-fetch hydration. */
|
|
46
47
|
collections?: Record<string, unknown[]>;
|
|
48
|
+
/** LLM artifacts config — gates JSON-LD injection + llms.txt text capture. */
|
|
49
|
+
llm?: LlmArtifactsConfig;
|
|
47
50
|
}): Promise<{
|
|
48
51
|
html: string;
|
|
49
52
|
head?: string;
|
|
50
53
|
htmlAttrs?: string;
|
|
54
|
+
llm?: LlmPageEntry;
|
|
51
55
|
}>;
|
|
52
56
|
//# sourceMappingURL=render-resolved-page.d.ts.map
|
|
@@ -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;
|
|
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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CAAA;IACvC,8EAA8E;IAC9E,GAAG,CAAC,EAAE,kBAAkB,CAAA;CACxB,GAAG,OAAO,CAAC;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,IAAI,CAAC,EAAE,MAAM,CAAC;IAAC,SAAS,CAAC,EAAE,MAAM,CAAC;IAAC,GAAG,CAAC,EAAE,YAAY,CAAA;CAAE,CAAC,CA+GnF"}
|
package/dist/ssg/seo.d.ts
CHANGED
|
@@ -91,4 +91,28 @@ export declare function getSiteIconFlags(website: WebsiteRead | null): {
|
|
|
91
91
|
hasFavicon: boolean;
|
|
92
92
|
hasWebclip: boolean;
|
|
93
93
|
};
|
|
94
|
+
interface ContextSeoFields {
|
|
95
|
+
title: string | null;
|
|
96
|
+
description: string | null;
|
|
97
|
+
image: string | null;
|
|
98
|
+
}
|
|
99
|
+
/**
|
|
100
|
+
* Extract SEO-relevant fields from the primary data-binding context.
|
|
101
|
+
*
|
|
102
|
+
* For template pages like `/blog/:slug`, the resolved page data contains
|
|
103
|
+
* `contexts: { $post: { title, excerpt, cover_image_url, … } }`.
|
|
104
|
+
* We look for common field names and return them as fallback SEO values.
|
|
105
|
+
*/
|
|
106
|
+
export declare function extractPrimaryContext(contexts: Record<string, Record<string, unknown> | null> | undefined): ContextSeoFields;
|
|
107
|
+
/**
|
|
108
|
+
* Return the primary (first non-null) data-binding context along with its key.
|
|
109
|
+
* The key (e.g. `$post`, `$product`, `$event`) drives the JSON-LD `@type`
|
|
110
|
+
* heuristic; the object supplies the entity fields. Returns `null` when the
|
|
111
|
+
* page has no bound context (a regular CMS page).
|
|
112
|
+
*/
|
|
113
|
+
export declare function primaryContextEntry(contexts: Record<string, Record<string, unknown> | null> | undefined): {
|
|
114
|
+
key: string;
|
|
115
|
+
ctx: Record<string, unknown>;
|
|
116
|
+
} | null;
|
|
117
|
+
export {};
|
|
94
118
|
//# sourceMappingURL=seo.d.ts.map
|
package/dist/ssg/seo.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1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