blume 1.7.0 → 1.7.2

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.
Files changed (119) hide show
  1. package/CHANGELOG.md +18 -0
  2. package/dist/cli/{chunk-9qs6acpw.js → chunk-12dxjqk7.js} +32 -43
  3. package/dist/cli/{chunk-9qs6acpw.js.map → chunk-12dxjqk7.js.map} +2 -2
  4. package/dist/cli/{chunk-s5dsk8bj.js → chunk-196vjxp9.js} +65 -64
  5. package/dist/cli/chunk-196vjxp9.js.map +13 -0
  6. package/dist/cli/{chunk-27gtm2ym.js → chunk-2mzebbbz.js} +1 -1
  7. package/dist/cli/{chunk-s5e5jt53.js → chunk-2z47ypj8.js} +1 -1
  8. package/dist/cli/{chunk-tnskyrej.js → chunk-30e87n55.js} +15 -24
  9. package/dist/cli/{chunk-tnskyrej.js.map → chunk-30e87n55.js.map} +2 -2
  10. package/dist/cli/{chunk-4trphnvy.js → chunk-3w7b2vcx.js} +10 -13
  11. package/dist/cli/{chunk-4trphnvy.js.map → chunk-3w7b2vcx.js.map} +2 -2
  12. package/dist/cli/{chunk-v5mm027v.js → chunk-450a7rcr.js} +8 -8
  13. package/dist/cli/{chunk-v5mm027v.js.map → chunk-450a7rcr.js.map} +1 -1
  14. package/dist/cli/{chunk-5d4q7121.js → chunk-5n7t497w.js} +142 -134
  15. package/dist/cli/{chunk-5d4q7121.js.map → chunk-5n7t497w.js.map} +5 -5
  16. package/dist/cli/{chunk-xv91q4nm.js → chunk-61j18dwk.js} +37 -9
  17. package/dist/cli/{chunk-xv91q4nm.js.map → chunk-61j18dwk.js.map} +3 -3
  18. package/dist/cli/{chunk-3r94j3tc.js → chunk-688e0dde.js} +2 -2
  19. package/dist/cli/{chunk-vxv4x1n8.js → chunk-88by27n5.js} +2 -2
  20. package/dist/cli/{chunk-cfw6x4rm.js → chunk-8cd8tj54.js} +28 -35
  21. package/dist/cli/{chunk-cfw6x4rm.js.map → chunk-8cd8tj54.js.map} +2 -2
  22. package/dist/cli/{chunk-8gnpdsn1.js → chunk-9bkjd11x.js} +2 -2
  23. package/dist/cli/{chunk-qq9nm3qd.js → chunk-9he6crym.js} +21 -28
  24. package/dist/cli/{chunk-qq9nm3qd.js.map → chunk-9he6crym.js.map} +2 -2
  25. package/dist/cli/{chunk-jk1zwka1.js → chunk-aztttvb3.js} +27 -33
  26. package/dist/cli/{chunk-jk1zwka1.js.map → chunk-aztttvb3.js.map} +2 -2
  27. package/dist/cli/{chunk-ckh3a410.js → chunk-cvky9gb2.js} +18 -24
  28. package/dist/cli/{chunk-ckh3a410.js.map → chunk-cvky9gb2.js.map} +2 -2
  29. package/dist/cli/{chunk-kwx90v78.js → chunk-eevwt1sc.js} +23 -32
  30. package/dist/cli/{chunk-kwx90v78.js.map → chunk-eevwt1sc.js.map} +2 -2
  31. package/dist/cli/{chunk-agy5rzxy.js → chunk-ejjx8znq.js} +126 -77
  32. package/dist/cli/chunk-ejjx8znq.js.map +15 -0
  33. package/dist/cli/{chunk-ye9zdkgv.js → chunk-exeeb35e.js} +3 -3
  34. package/dist/cli/{chunk-v2ymm99c.js → chunk-fmceyezb.js} +41 -50
  35. package/dist/cli/{chunk-v2ymm99c.js.map → chunk-fmceyezb.js.map} +2 -2
  36. package/dist/cli/{chunk-s102bysw.js → chunk-hdm2dkd2.js} +209 -97
  37. package/dist/cli/{chunk-s102bysw.js.map → chunk-hdm2dkd2.js.map} +6 -5
  38. package/dist/cli/{chunk-zr3ygrq3.js → chunk-hs3gbh8p.js} +10 -15
  39. package/dist/cli/{chunk-zr3ygrq3.js.map → chunk-hs3gbh8p.js.map} +2 -2
  40. package/dist/cli/{chunk-n0nyat6g.js → chunk-jbj4qhfw.js} +3 -3
  41. package/dist/cli/{chunk-ev67ycx0.js → chunk-jq5n4avg.js} +1 -1
  42. package/dist/cli/{chunk-jxkxjsc1.js → chunk-mqb2ka8m.js} +22 -30
  43. package/dist/cli/{chunk-jxkxjsc1.js.map → chunk-mqb2ka8m.js.map} +2 -2
  44. package/dist/cli/{chunk-drke6t0h.js → chunk-mt76t7dj.js} +26 -34
  45. package/dist/cli/{chunk-drke6t0h.js.map → chunk-mt76t7dj.js.map} +2 -2
  46. package/dist/cli/{chunk-jtb45atp.js → chunk-n9sra6sy.js} +13 -13
  47. package/dist/cli/{chunk-jtb45atp.js.map → chunk-n9sra6sy.js.map} +1 -1
  48. package/dist/cli/{chunk-x66c5yjn.js → chunk-ppfvdcd4.js} +2 -2
  49. package/dist/cli/{chunk-wd27zjcz.js → chunk-q4rae3bg.js} +1 -1
  50. package/dist/cli/{chunk-pxj10x8y.js → chunk-ra1v2nc2.js} +1 -1
  51. package/dist/cli/{chunk-y3g15rvv.js → chunk-t3tj0dgr.js} +26 -33
  52. package/dist/cli/{chunk-y3g15rvv.js.map → chunk-t3tj0dgr.js.map} +2 -2
  53. package/dist/cli/{chunk-j6pxe0dt.js → chunk-tqa1s0k8.js} +4 -4
  54. package/dist/cli/{chunk-cbjnx4s8.js → chunk-vh9w1sgp.js} +1 -1
  55. package/dist/cli/{chunk-0qhq7b8q.js → chunk-vkrsvbr5.js} +13 -17
  56. package/dist/cli/{chunk-0qhq7b8q.js.map → chunk-vkrsvbr5.js.map} +2 -2
  57. package/dist/cli/{chunk-sbdqrjbb.js → chunk-vrfp10qk.js} +1 -1
  58. package/dist/cli/{chunk-ynacq3ev.js → chunk-wjt80jps.js} +27 -40
  59. package/dist/cli/{chunk-ynacq3ev.js.map → chunk-wjt80jps.js.map} +3 -4
  60. package/dist/cli/{chunk-18tjv4f7.js → chunk-xhtpx3ff.js} +21 -30
  61. package/dist/cli/{chunk-18tjv4f7.js.map → chunk-xhtpx3ff.js.map} +2 -2
  62. package/dist/cli/{chunk-5hs6gb7n.js → chunk-yzhm0j9q.js} +1 -1
  63. package/dist/cli/index.js +397 -34
  64. package/dist/cli/index.js.map +12 -4
  65. package/dist/types/components/layout/nav-utils.d.ts +15 -2
  66. package/dist/types/core/config-input.d.ts +33 -0
  67. package/dist/types/core/schema.d.ts +29 -3
  68. package/docs/08-faq.mdx +21 -0
  69. package/docs/configuration/ask-ai.mdx +63 -0
  70. package/docs/content/sources.mdx +2 -2
  71. package/package.json +1 -1
  72. package/src/ai/ask.ts +31 -4
  73. package/src/ai/cors.ts +87 -0
  74. package/src/astro/generate.ts +3 -0
  75. package/src/astro/templates.ts +192 -83
  76. package/src/components/content/YouTube.astro +1 -1
  77. package/src/components/layout/Header.astro +1 -1
  78. package/src/components/layout/NavTree.astro +75 -66
  79. package/src/components/layout/RootLayout.astro +4 -1
  80. package/src/components/layout/Search.astro +11 -0
  81. package/src/components/layout/nav-utils.ts +47 -15
  82. package/src/core/adapter.ts +61 -0
  83. package/src/core/config-input.ts +33 -0
  84. package/src/core/schema.ts +61 -0
  85. package/src/core/sources/assets.ts +162 -26
  86. package/src/core/sources/notion.ts +60 -1
  87. package/src/registry/eject.ts +3 -0
  88. package/src/theme/entry.ts +9 -0
  89. package/dist/cli/chunk-2aj8ddew.js +0 -72
  90. package/dist/cli/chunk-2aj8ddew.js.map +0 -10
  91. package/dist/cli/chunk-4xyggvgf.js +0 -21
  92. package/dist/cli/chunk-4xyggvgf.js.map +0 -10
  93. package/dist/cli/chunk-6kzzpsx8.js +0 -26
  94. package/dist/cli/chunk-6kzzpsx8.js.map +0 -10
  95. package/dist/cli/chunk-agy5rzxy.js.map +0 -15
  96. package/dist/cli/chunk-bcy492zc.js +0 -16
  97. package/dist/cli/chunk-bcy492zc.js.map +0 -10
  98. package/dist/cli/chunk-btfr9yvw.js +0 -41
  99. package/dist/cli/chunk-btfr9yvw.js.map +0 -10
  100. package/dist/cli/chunk-ey89bjj1.js +0 -209
  101. package/dist/cli/chunk-ey89bjj1.js.map +0 -11
  102. package/dist/cli/chunk-s5dsk8bj.js.map +0 -13
  103. package/dist/cli/chunk-vt8fgygt.js +0 -23
  104. package/dist/cli/chunk-vt8fgygt.js.map +0 -10
  105. /package/dist/cli/{chunk-27gtm2ym.js.map → chunk-2mzebbbz.js.map} +0 -0
  106. /package/dist/cli/{chunk-s5e5jt53.js.map → chunk-2z47ypj8.js.map} +0 -0
  107. /package/dist/cli/{chunk-3r94j3tc.js.map → chunk-688e0dde.js.map} +0 -0
  108. /package/dist/cli/{chunk-vxv4x1n8.js.map → chunk-88by27n5.js.map} +0 -0
  109. /package/dist/cli/{chunk-8gnpdsn1.js.map → chunk-9bkjd11x.js.map} +0 -0
  110. /package/dist/cli/{chunk-ye9zdkgv.js.map → chunk-exeeb35e.js.map} +0 -0
  111. /package/dist/cli/{chunk-n0nyat6g.js.map → chunk-jbj4qhfw.js.map} +0 -0
  112. /package/dist/cli/{chunk-ev67ycx0.js.map → chunk-jq5n4avg.js.map} +0 -0
  113. /package/dist/cli/{chunk-x66c5yjn.js.map → chunk-ppfvdcd4.js.map} +0 -0
  114. /package/dist/cli/{chunk-wd27zjcz.js.map → chunk-q4rae3bg.js.map} +0 -0
  115. /package/dist/cli/{chunk-pxj10x8y.js.map → chunk-ra1v2nc2.js.map} +0 -0
  116. /package/dist/cli/{chunk-j6pxe0dt.js.map → chunk-tqa1s0k8.js.map} +0 -0
  117. /package/dist/cli/{chunk-cbjnx4s8.js.map → chunk-vh9w1sgp.js.map} +0 -0
  118. /package/dist/cli/{chunk-sbdqrjbb.js.map → chunk-vrfp10qk.js.map} +0 -0
  119. /package/dist/cli/{chunk-5hs6gb7n.js.map → chunk-yzhm0j9q.js.map} +0 -0
@@ -1,27 +1,27 @@
1
1
  #!/usr/bin/env node
2
2
  import {
3
- API_CATALOG_PATH,
4
3
  OPENAPI_PATH,
4
+ API_CATALOG_PATH,
5
5
  hasApiCatalog
6
- } from "./chunk-j6pxe0dt.js";
6
+ } from "./chunk-tqa1s0k8.js";
7
+ import {
8
+ hasScalarReferences,
9
+ fontLocaleCodes,
10
+ buildFontEntries
11
+ } from "./chunk-61j18dwk.js";
7
12
  import {
8
13
  searchProviderMeta
9
- } from "./chunk-wd27zjcz.js";
14
+ } from "./chunk-q4rae3bg.js";
10
15
  import {
11
- BLUME_IGNORE_DIRS,
12
- TOC_HIDDEN_KEY
13
- } from "./chunk-s102bysw.js";
16
+ TOC_HIDDEN_KEY,
17
+ BLUME_IGNORE_DIRS
18
+ } from "./chunk-hdm2dkd2.js";
14
19
  import {
15
- buildFontEntries,
16
- fontLocaleCodes,
17
- hasScalarReferences
18
- } from "./chunk-xv91q4nm.js";
19
- import {
20
- normalizeBasePath,
21
20
  trimChar,
21
+ normalizeBasePath,
22
22
  withBasePath,
23
23
  withComposedBasePath
24
- } from "./chunk-27gtm2ym.js";
24
+ } from "./chunk-2mzebbbz.js";
25
25
 
26
26
  // src/deploy/adapter-output.ts
27
27
  import { existsSync } from "node:fs";
@@ -134,20 +134,23 @@ var ASK_PRESETS = {
134
134
  }
135
135
  };
136
136
  var DEFAULT_MODEL = "openai/gpt-5.5";
137
+ var askHeadersField = (ask) => ask?.headers && Object.keys(ask.headers).length > 0 ? { headers: ask.headers } : {};
137
138
  var resolveAskBackend = (ask) => {
138
139
  const provider = ask?.provider ?? "gateway";
139
140
  const model = ask?.model ?? DEFAULT_MODEL;
141
+ const headers = askHeadersField(ask);
140
142
  if (provider === "gateway") {
141
- return { kind: "gateway", model };
143
+ return { ...headers, kind: "gateway", model };
142
144
  }
143
145
  const preset = ASK_PRESETS[provider];
144
146
  const apiKeyEnv = ask?.apiKeyEnv ?? preset?.apiKeyEnv ?? "API_KEY";
145
147
  if (provider === "openrouter") {
146
- return { apiKeyEnv, kind: "openrouter", model };
148
+ return { apiKeyEnv, ...headers, kind: "openrouter", model };
147
149
  }
148
150
  return {
149
151
  apiKeyEnv,
150
152
  baseUrl: ask?.baseUrl ?? preset?.baseUrl ?? "",
153
+ ...headers,
151
154
  kind: OPENAI_COMPATIBLE,
152
155
  model,
153
156
  name: preset?.name ?? OPENAI_COMPATIBLE
@@ -712,8 +715,21 @@ export const collections = { docs${options.staged ? ", staged" : ""} };
712
715
  `;
713
716
  };
714
717
  var ASK_FALLBACK_PROMPT = "You are a helpful documentation assistant. Answer using the project's documentation.";
718
+ var askCorsTemplate = (cors = []) => cors.length > 0 ? {
719
+ close: "});",
720
+ imports: [
721
+ 'import { preflightResponse, withCors } from "blume/ai/cors.ts";'
722
+ ],
723
+ open: "withCors(ALLOWED_ORIGINS, async ({ request }) => {",
724
+ setup: `
725
+ const ALLOWED_ORIGINS = ${JSON.stringify(cors)};
726
+
727
+ export const OPTIONS: APIRoute = ({ request }) =>
728
+ preflightResponse(request, ALLOWED_ORIGINS);
729
+ `
730
+ } : { close: "};", imports: [], open: "async ({ request }) => {", setup: "" };
715
731
  var askEndpointTemplate = (backend, grounded, options) => {
716
- const instructions = options?.instructions;
732
+ const { instructions, reasoning, retrieval } = options ?? {};
717
733
  const fallbackPrompt = instructions ? `${ASK_FALLBACK_PROMPT}
718
734
 
719
735
  ${instructions}` : ASK_FALLBACK_PROMPT;
@@ -724,23 +740,30 @@ ${instructions}` : ASK_FALLBACK_PROMPT;
724
740
  ];
725
741
  let setup = "";
726
742
  let modelExpr = JSON.stringify(backend.model);
743
+ const headersField = backend.headers ? `
744
+ headers: ${JSON.stringify(backend.headers)},` : "";
727
745
  if (backend.kind === "gateway") {
728
746
  setup = `
729
- const gateway = createGateway({ apiKey: getSecret("AI_GATEWAY_API_KEY") });
747
+ const gateway = createGateway({
748
+ apiKey: getSecret("AI_GATEWAY_API_KEY"),${headersField}
749
+ });
730
750
  `;
731
751
  modelExpr = `gateway(${JSON.stringify(backend.model)})`;
732
752
  } else if (backend.kind === "openrouter") {
733
753
  imports.push('import { createOpenRouter } from "@openrouter/ai-sdk-provider";');
734
754
  setup = `
735
- const openrouter = createOpenRouter({ apiKey: getSecret(${JSON.stringify(backend.apiKeyEnv)}) });
755
+ const openrouter = createOpenRouter({
756
+ apiKey: getSecret(${JSON.stringify(backend.apiKeyEnv)}),${headersField}
757
+ });
736
758
  `;
737
- modelExpr = `openrouter(${JSON.stringify(backend.model)})`;
759
+ const settings = reasoning ? `, { reasoning: { effort: ${JSON.stringify(reasoning)} } }` : "";
760
+ modelExpr = `openrouter(${JSON.stringify(backend.model)}${settings})`;
738
761
  } else if (backend.kind === "openai-compatible") {
739
762
  imports.push('import { createOpenAICompatible } from "@ai-sdk/openai-compatible";');
740
763
  setup = `
741
764
  const provider = createOpenAICompatible({
742
765
  apiKey: getSecret(${JSON.stringify(backend.apiKeyEnv)}),
743
- baseURL: ${JSON.stringify(backend.baseUrl)},
766
+ baseURL: ${JSON.stringify(backend.baseUrl)},${headersField}
744
767
  name: ${JSON.stringify(backend.name)},
745
768
  });
746
769
  `;
@@ -752,14 +775,16 @@ const provider = createOpenAICompatible({
752
775
  if (instructions) {
753
776
  groundFields.push(`instructions: ${JSON.stringify(instructions)}`);
754
777
  }
755
- if (options?.retrieval) {
756
- groundFields.push(`retrieval: ${JSON.stringify(options.retrieval)}`);
778
+ if (retrieval) {
779
+ groundFields.push(`retrieval: ${JSON.stringify(retrieval)}`);
757
780
  }
758
781
  const groundOptions = groundFields.length > 0 ? `, { ${groundFields.join(", ")} }` : "";
759
782
  setup += `
760
783
  const ground = createAskContext(askData${groundOptions});
761
784
  `;
762
785
  }
786
+ const cors = askCorsTemplate(options?.cors);
787
+ imports.push(...cors.imports);
763
788
  const validate = ` const body = await request.json().catch(() => null);
764
789
  const raw = body?.messages;
765
790
  const valid =
@@ -800,22 +825,25 @@ const ground = createAskContext(askData${groundOptions});
800
825
  const onError = ` onError({ error }) {
801
826
  console.error("Ask AI provider error:", error);
802
827
  },`;
828
+ const streamFields = [
829
+ `model: ${modelExpr}`,
830
+ grounded ? "instructions" : `instructions:
831
+ ${JSON.stringify(fallbackPrompt)}`,
832
+ "messages"
833
+ ];
834
+ if (reasoning && backend.kind !== "openrouter") {
835
+ streamFields.push(`reasoning: ${JSON.stringify(reasoning)}`);
836
+ }
837
+ const call = ` const result = streamText({
838
+ ${streamFields.join(`,
839
+ `)},
840
+ ${onError}
841
+ });`;
803
842
  const stream = grounded ? ` const instructions =
804
843
  (await ground(messages, body.page)) ??
805
844
  ${JSON.stringify(fallbackPrompt)};
806
- const result = streamText({
807
- model: ${modelExpr},
808
- instructions,
809
- messages,
810
- ${onError}
811
- });` : ` const result = streamText({
812
- model: ${modelExpr},
813
- instructions:
814
- ${JSON.stringify(fallbackPrompt)},
815
- messages,
816
- ${onError}
817
- });`;
818
- const handler = `export const POST: APIRoute = async ({ request }) => {
845
+ ${call}` : call;
846
+ const handler = `export const POST: APIRoute = ${cors.open}
819
847
  ${validate}
820
848
  ${keyCheck}
821
849
  try {
@@ -824,13 +852,13 @@ ${stream}
824
852
  } catch {
825
853
  return new Response("Failed to generate a response.", { status: 500 });
826
854
  }
827
- };`;
855
+ ${cors.close}`;
828
856
  return `// Generated by Blume. Do not edit.
829
857
  ${imports.join(`
830
858
  `)}
831
859
 
832
860
  export const prerender = false;
833
- ${setup}
861
+ ${setup}${cors.setup}
834
862
  ${handler}
835
863
  `;
836
864
  };
@@ -1147,7 +1175,11 @@ var navFragmentTemplate = () => `---
1147
1175
  // Generated by Blume. Do not edit.
1148
1176
  import NavTree from "blume/components/layout/NavTree.astro";
1149
1177
  import { withBase } from "blume/components/islands/base-path.ts";
1150
- import { navGroupIds, navVariants } from "blume/components/layout/nav-utils.ts";
1178
+ import {
1179
+ hiddenDefaultLocale,
1180
+ navGroupIds,
1181
+ navVariants,
1182
+ } from "blume/components/layout/nav-utils.ts";
1151
1183
  import type { NavNode } from "blume/core/types.ts";
1152
1184
  import data from "blume:data";
1153
1185
 
@@ -1158,15 +1190,16 @@ export const partial = true;
1158
1190
  // Only imports are in scope here (Astro hoists getStaticPaths), which is why
1159
1191
  // the variant walk lives in nav-utils.
1160
1192
  export function getStaticPaths() {
1161
- return navVariants(data).flatMap(({ locale, navigation, version }) =>
1162
- [...navGroupIds(navigation.sidebar)]
1163
- .filter(([node]) => (node.display ?? "flat") !== "flat")
1164
- .map(([, id]) => ({ params: { id, locale, version } }))
1193
+ return navVariants(data, hiddenDefaultLocale(data.config.i18n)).flatMap(
1194
+ ({ locale, navigation, version }) =>
1195
+ [...navGroupIds(navigation.sidebar)]
1196
+ .filter(([node]) => (node.display ?? "flat") !== "flat")
1197
+ .map(([, id]) => ({ params: { id, locale, version } }))
1165
1198
  );
1166
1199
  }
1167
1200
 
1168
1201
  const { id, locale, version } = Astro.params;
1169
- const variant = navVariants(data).find(
1202
+ const variant = navVariants(data, hiddenDefaultLocale(data.config.i18n)).find(
1170
1203
  (entry) => entry.version === version && entry.locale === locale
1171
1204
  );
1172
1205
  const ids = variant
@@ -1334,22 +1367,13 @@ const htmlLang = i18n ? i18n.defaultLocale : "en";
1334
1367
  <ScalarComponent configuration={configuration} renderMode="client" />
1335
1368
  </ReferenceLayout>
1336
1369
  `;
1337
- var catchAllPageTemplate = (options) => {
1338
- const mathImport = options.mathEnabled ? `import Math from "blume/components/content/Math.astro";
1370
+ var contentComponentsSource = (mathEnabled) => {
1371
+ const mathImport = mathEnabled ? `import Math from "blume/components/content/Math.astro";
1339
1372
  ` : "";
1340
- const mathEntry = options.mathEnabled ? `Math,
1373
+ const mathEntry = mathEnabled ? `Math,
1341
1374
  ` : "";
1342
- const clientData = options.needsReact ? `
1343
- clientData={{ config: data.config, navigation, page: { route, title: seo.title ?? title } }}` : "";
1344
- return `---
1345
- // Generated by Blume. Do not edit.
1346
- import { getEntry, render } from "astro:content";
1347
- import type { CollectionKey } from "astro:content";
1348
- import RootLayout from "blume/components/layout/RootLayout.astro";
1349
- import { withBase } from "blume/components/islands/base-path.ts";
1350
- import { stripBasePath, withBasePath } from "blume/core/base-path.ts";
1351
- import { resolveSlot } from "blume/components/layout/overrides.ts";
1352
- import Accordion from "blume/components/content/Accordion.astro";
1375
+ return {
1376
+ imports: `import Accordion from "blume/components/content/Accordion.astro";
1353
1377
  import AccordionItem from "blume/components/content/AccordionItem.astro";
1354
1378
  import AutoTypeTable from "blume/components/content/AutoTypeTable.astro";
1355
1379
  import Badge from "blume/components/content/Badge.astro";
@@ -1389,19 +1413,8 @@ import ApiOverview from "blume/components/openapi/ApiOverview.astro";
1389
1413
  import ApiTagOperations from "blume/components/openapi/ApiTagOperations.astro";
1390
1414
  import Operation from "blume/components/openapi/Operation.astro";
1391
1415
  ${mathImport}import { mdxComponents as userMdx, layoutOverrides } from "../generated/components.ts";
1392
- import { islandComponents } from "../generated/islands.ts";
1393
- import data from "blume:data";
1394
-
1395
- const Color = Object.assign(ColorRoot, { Item: ColorItem, Row: ColorRow });
1396
- const Tree = Object.assign(TreeRoot, { File: TreeFile, Folder: TreeFolder });
1397
-
1398
- // Docs content is file-based and always prerendered, even in server output
1399
- // (where only endpoints like /api/ask render on demand). Without this, server
1400
- // builds would render this route on demand and ignore getStaticPaths, leaving
1401
- // the entry id undefined.
1402
- export const prerender = true;
1403
-
1404
- const components = {
1416
+ import { islandComponents } from "../generated/islands.ts";`,
1417
+ map: `{
1405
1418
  Accordion,
1406
1419
  AccordionItem,
1407
1420
  ApiOverview,
@@ -1438,7 +1451,34 @@ const components = {
1438
1451
  YouTube,
1439
1452
  ${mathEntry}...islandComponents,
1440
1453
  ...userMdx,
1454
+ }`
1455
+ };
1441
1456
  };
1457
+ var catchAllPageTemplate = (options) => {
1458
+ const { imports: componentImports, map: componentMap } = contentComponentsSource(options.mathEnabled);
1459
+ const clientData = options.needsReact ? `
1460
+ clientData={{ config: data.config, navigation, page: { route, title: seo.title ?? title } }}` : "";
1461
+ return `---
1462
+ // Generated by Blume. Do not edit.
1463
+ import { getEntry, render } from "astro:content";
1464
+ import type { CollectionKey } from "astro:content";
1465
+ import RootLayout from "blume/components/layout/RootLayout.astro";
1466
+ import { withBase } from "blume/components/islands/base-path.ts";
1467
+ import { stripBasePath, withBasePath } from "blume/core/base-path.ts";
1468
+ import { resolveSlot } from "blume/components/layout/overrides.ts";
1469
+ ${componentImports}
1470
+ import data from "blume:data";
1471
+
1472
+ const Color = Object.assign(ColorRoot, { Item: ColorItem, Row: ColorRow });
1473
+ const Tree = Object.assign(TreeRoot, { File: TreeFile, Folder: TreeFolder });
1474
+
1475
+ // Docs content is file-based and always prerendered, even in server output
1476
+ // (where only endpoints like /api/ask render on demand). Without this, server
1477
+ // builds would render this route on demand and ignore getStaticPaths, leaving
1478
+ // the entry id undefined.
1479
+ export const prerender = true;
1480
+
1481
+ const components = ${componentMap};
1442
1482
 
1443
1483
  export function getStaticPaths() {
1444
1484
  return data.routes.map((route) => ({
@@ -1708,7 +1748,7 @@ const LayoutComponent = resolveSlot(layoutOverrides.Layout, RootLayout);
1708
1748
  feedback={data.config.feedback}
1709
1749
  exportPdf={${options.exportPdf}}
1710
1750
  exportEpub={${options.exportEpub}}${options.navFragments ? `
1711
- navFragmentBase={withBase(\`/blume-nav/\${version || "current"}/\${i18n ? locale : "default"}\`)}` : ""}
1751
+ navFragmentBase={withBase(\`/blume-nav/\${version || "current"}/\${i18n && localePrefix(locale) ? locale : "default"}\`)}` : ""}
1712
1752
  openInChat={data.config.openInChat}
1713
1753
  feeds={data.feeds}
1714
1754
  discovery={data.config.discovery}
@@ -1732,6 +1772,7 @@ var changelogIndexTemplate = (options) => {
1732
1772
  clientData={{ config: data.config, navigation: data.navigation, page: { route: "/changelog", title: pageTitle } }}` : "";
1733
1773
  const stagedSpread = options.staged ? `
1734
1774
  ...(await getCollection("staged")),` : "";
1775
+ const { imports: componentImports, map: componentMap } = contentComponentsSource(options.mathEnabled);
1735
1776
  return `---
1736
1777
  // Generated by Blume. Do not edit.
1737
1778
  import { getCollection, render } from "astro:content";
@@ -1740,11 +1781,19 @@ import Update from "blume/components/content/Update.astro";
1740
1781
  import { withBase } from "blume/components/islands/base-path.ts";
1741
1782
  import { resolveSlot } from "blume/components/layout/overrides.ts";
1742
1783
  import { resolveDateFormatOptions } from "blume/core/date-format.ts";
1743
- import { layoutOverrides } from "../generated/components.ts";
1784
+ ${componentImports}
1744
1785
  import data from "blume:data";
1745
1786
 
1787
+ const Color = Object.assign(ColorRoot, { Item: ColorItem, Row: ColorRow });
1788
+ const Tree = Object.assign(TreeRoot, { File: TreeFile, Folder: TreeFolder });
1789
+
1746
1790
  export const prerender = true;
1747
1791
 
1792
+ // Entry bodies are MDX rendered outside the catch-all, so they need the same
1793
+ // component map: a \`:::\` callout or \`<Steps>\` in a release note otherwise
1794
+ // throws "Expected component ... to be defined" at build time.
1795
+ const components = ${componentMap};
1796
+
1748
1797
  const entryDate = (entry: {
1749
1798
  data: { date?: string | null; changelog?: { date?: string | null } | null };
1750
1799
  }) => entry.data.date ?? entry.data.changelog?.date ?? null;
@@ -1943,7 +1992,7 @@ const LayoutComponent = resolveSlot(layoutOverrides.Layout, RootLayout);
1943
1992
  >
1944
1993
  {majorGroups[0].items.map(({ Content, href, id, label, date, tags }) => (
1945
1994
  <Update description={date} href={href} id={id} label={label} tags={tags}>
1946
- <Content />
1995
+ <Content components={components} />
1947
1996
  </Update>
1948
1997
  ))}
1949
1998
  {majorGroups.slice(1).map((group) => (
@@ -1954,7 +2003,7 @@ const LayoutComponent = resolveSlot(layoutOverrides.Layout, RootLayout);
1954
2003
  >
1955
2004
  {group.items.map(({ Content, href, id, label, date, tags }) => (
1956
2005
  <Update description={date} href={href} id={id} label={label} tags={tags}>
1957
- <Content />
2006
+ <Content components={components} />
1958
2007
  </Update>
1959
2008
  ))}
1960
2009
  </section>
@@ -1974,7 +2023,7 @@ const LayoutComponent = resolveSlot(layoutOverrides.Layout, RootLayout);
1974
2023
  <div class="not-prose mt-8">
1975
2024
  {items.map(({ Content, href, id, label, date, tags }) => (
1976
2025
  <Update description={date} href={href} id={id} label={label} tags={tags}>
1977
- <Content />
2026
+ <Content components={components} />
1978
2027
  </Update>
1979
2028
  ))}
1980
2029
  </div>
@@ -2449,5 +2498,5 @@ var runtimeTsconfigTemplate = () => `${JSON.stringify({
2449
2498
 
2450
2499
  export { ADAPTER_IGNORE_DIRS, servesClientSubdir, deployStaticDir, surfaceAdapterOutput, resolveAskBackend, askBackendRuntimeDep, buildHomeLinkHeader, platformRedirects, publishRuntimeModules, runtimeDependencies, astroConfigTemplate, stagedContentDir, contentConfigTemplate, askEndpointTemplate, askComponentTemplate, searchEndpointTemplate, featuresTemplate, searchClientTemplate, mixedbreadSearchEndpointTemplate, rawMarkdownEndpointTemplate, contentAssetsEndpointTemplate, mcpPageFile, mcpEndpointTemplate, playgroundProxyTemplate, staticJsonEndpointTemplate, rssEndpointTemplate, navFragmentTemplate, ogEndpointTemplate, scalarReferenceTemplate, catchAllPageTemplate, changelogIndexTemplate, notFoundPageTemplate, notFoundMarkdownTemplate, notFoundJsonTemplate, apiPagesIndexTemplate, apiPageTemplate, apiNavigationTemplate, apiSearchTemplate, apiNotFoundTemplate, islandWrapperTemplate, islandMapTemplate, exampleSlug, exampleWrapperTemplate, examplesRouteBase, exampleMapTemplate, examplesPageTemplate, runtimePackageTemplate, runtimeTsconfigTemplate };
2451
2500
 
2452
- //# debugId=539E38867287181364756E2164756E21
2453
- //# sourceMappingURL=chunk-agy5rzxy.js.map
2501
+ //# debugId=53365D3EDA449FFB64756E2164756E21
2502
+ //# sourceMappingURL=chunk-ejjx8znq.js.map