blume 0.5.4 → 0.6.1
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/cli/index.js +759 -406
- package/dist/cli/index.js.map +27 -25
- package/dist/types/core/config-input.d.ts +759 -0
- package/dist/types/core/config.d.ts +126 -3
- package/dist/types/core/data.d.ts +4 -0
- package/dist/types/core/i18n-ui.d.ts +50 -0
- package/dist/types/core/schema.d.ts +334 -62
- package/dist/types/core/types.d.ts +8 -0
- package/dist/types/index.d.ts +2 -1
- package/docs/advanced/changelog.mdx +10 -2
- package/docs/configuration/ai.mdx +56 -0
- package/docs/configuration/index.mdx +0 -2
- package/docs/configuration/seo.mdx +59 -1
- package/docs/configuration/theming.mdx +14 -9
- package/docs/content/meta.mdx +3 -17
- package/docs/content/navigation.mdx +41 -4
- package/docs/content/syntax.mdx +4 -8
- package/package.json +3 -1
- package/src/ai/agent-readability.ts +97 -0
- package/src/ai/ask-context.ts +131 -8
- package/src/ai/ask-data.ts +4 -1
- package/src/astro/generate.ts +40 -11
- package/src/astro/templates.ts +90 -10
- package/src/cli/commands/build.ts +41 -1
- package/src/cli/commands/dev.ts +31 -14
- package/src/cli/dev-lock.ts +94 -21
- package/src/components/content/GithubInfo.astro +11 -10
- package/src/components/content/TypeTable.astro +8 -3
- package/src/components/content/Update.astro +12 -2
- package/src/components/content/changelog-element.ts +62 -0
- package/src/components/islands/AskAI.astro +66 -2
- package/src/components/islands/ask-ai.tsx +289 -53
- package/src/components/layout/Header.astro +1 -1
- package/src/components/layout/NavTree.astro +1 -1
- package/src/components/layout/PageActions.astro +73 -30
- package/src/components/layout/RootLayout.astro +79 -10
- package/src/core/config-input.ts +933 -0
- package/src/core/config.ts +126 -3
- package/src/core/data.ts +4 -0
- package/src/core/graph.ts +7 -2
- package/src/core/i18n-ui.ts +5 -0
- package/src/core/nav-diagnostics.ts +7 -0
- package/src/core/navigation.ts +38 -12
- package/src/core/schema.ts +130 -22
- package/src/core/sources/filesystem.ts +5 -1
- package/src/core/sources/watch.ts +43 -12
- package/src/core/types.ts +9 -0
- package/src/deploy/adapter-output.ts +82 -0
- package/src/deploy/robots.ts +37 -4
- package/src/index.ts +1 -1
- package/src/markdown/index.ts +28 -30
- package/src/markdown/math.ts +3 -2
- package/src/openapi/scalar.ts +1 -1
- package/src/registry/eject.ts +21 -14
- package/src/search/documents.ts +9 -2
- package/src/theme/entry.ts +7 -3
- package/src/theme/palette.ts +21 -14
|
@@ -1,8 +1,131 @@
|
|
|
1
|
-
import type { BlumeConfig
|
|
1
|
+
import type { BlumeConfig } from "./config-input.ts";
|
|
2
|
+
import type { ResolvedConfig } from "./schema.ts";
|
|
2
3
|
import type { Diagnostic } from "./types.ts";
|
|
3
4
|
/**
|
|
4
|
-
*
|
|
5
|
-
*
|
|
5
|
+
* Define a Blume site's configuration with full type-checking and editor
|
|
6
|
+
* autocomplete. Place the call in `blume.config.ts` at your project root and
|
|
7
|
+
* `export default` the result:
|
|
8
|
+
*
|
|
9
|
+
* ```ts
|
|
10
|
+
* import { defineConfig } from "blume";
|
|
11
|
+
*
|
|
12
|
+
* export default defineConfig({
|
|
13
|
+
* title: "Acme Docs",
|
|
14
|
+
* description: "Everything you need to build with Acme.",
|
|
15
|
+
* });
|
|
16
|
+
* ```
|
|
17
|
+
*
|
|
18
|
+
* Every field is optional — an empty `defineConfig({})` produces a working
|
|
19
|
+
* site from the Markdown/MDX in your `docs/` directory. Configure only what you
|
|
20
|
+
* want to change; sensible defaults fill in the rest.
|
|
21
|
+
*
|
|
22
|
+
* This is an identity helper: it returns its input unchanged and exists purely
|
|
23
|
+
* for type inference (and as a stable home for future plugin hooks). The object
|
|
24
|
+
* is validated against the Blume schema when the CLI loads it.
|
|
25
|
+
*
|
|
26
|
+
* ## Top-level fields
|
|
27
|
+
*
|
|
28
|
+
* **Site identity**
|
|
29
|
+
* - `title` — site title, shown in the header, `<title>`, and OG images.
|
|
30
|
+
* Defaults to `"Documentation"`.
|
|
31
|
+
* - `description` — default meta description, used where a page sets none.
|
|
32
|
+
* - `logo` — brand mark. A string is an image path/URL; the object form splits
|
|
33
|
+
* an `image` mark from wordmark `text` and can override the brand `href`.
|
|
34
|
+
* - `banner` — site-wide announcement bar; a string, or `{ content, link,
|
|
35
|
+
* dismissible }`.
|
|
36
|
+
*
|
|
37
|
+
* **Content & navigation**
|
|
38
|
+
* - `content` — where content lives (`root`, defaults to `docs`) and pluggable
|
|
39
|
+
* `sources` (filesystem, remote MDX, GitHub Releases, Sanity, Notion, or a
|
|
40
|
+
* custom `ContentSource`). Omit `sources` and the top-level `root` becomes one
|
|
41
|
+
* implicit filesystem source.
|
|
42
|
+
* - `navigation` — sidebar, header `tabs`, `selectors` (version/language/product
|
|
43
|
+
* switchers), pinned `featured` links, and the `repo` link toggle. Omit
|
|
44
|
+
* `sidebar` to generate it from the content tree.
|
|
45
|
+
* - `redirects` — `{ from, to, status }` rules (301 by default).
|
|
46
|
+
* - `github` — `{ owner, repo, branch, dir }`, powering "Edit this page" links
|
|
47
|
+
* and the header repo link.
|
|
48
|
+
*
|
|
49
|
+
* **Appearance**
|
|
50
|
+
* - `theme` — `accent` color, `fonts` (curated Google Font slugs), `radius`,
|
|
51
|
+
* `mode` (`system`/`light`/`dark`), `background`, and `strict` token mode.
|
|
52
|
+
* - `markdown` — `code` (language icons, inline highlighting, line wrap),
|
|
53
|
+
* `headingAnchors`, `imageZoom`, and opt-in KaTeX `math`.
|
|
54
|
+
* - `toc` — on-page table of contents; `true`/`false` or a heading-level range.
|
|
55
|
+
* - `lastModified` — "Last updated" stamps from `git` history or frontmatter.
|
|
56
|
+
* - `feedback` — the per-page "Was this helpful?" widget (on by default).
|
|
57
|
+
* - `export` — reader-facing PDF/EPUB export actions (off by default).
|
|
58
|
+
*
|
|
59
|
+
* **Reference docs**
|
|
60
|
+
* - `openapi` — native OpenAPI reference: one real page per operation, woven
|
|
61
|
+
* into the sidebar and search. Point `sources`/`spec` at your spec.
|
|
62
|
+
* - `asyncapi` — AsyncAPI reference via the embedded Scalar renderer.
|
|
63
|
+
*
|
|
64
|
+
* **Search & AI**
|
|
65
|
+
* - `search` — search backend `provider` (`orama` by default; `pagefind`,
|
|
66
|
+
* `algolia`, `typesense`, `orama-cloud`, `mixedbread`, or `none`) plus its
|
|
67
|
+
* credential block.
|
|
68
|
+
* - `ai` — `ask` (the Ask AI chat endpoint and its provider/model) and `llmsTxt`
|
|
69
|
+
* (emit `llms.txt`).
|
|
70
|
+
* - `mcp` — expose the docs as an MCP server for connecting agents.
|
|
71
|
+
*
|
|
72
|
+
* **SEO, feeds & analytics**
|
|
73
|
+
* - `seo` — `og` images, `sitemap`, `robots`, `rss` feeds, `structuredData`
|
|
74
|
+
* JSON-LD, `agentReadability`, and robots `contentSignals`.
|
|
75
|
+
* - `analytics` — PostHog, Vercel, or arbitrary `scripts` (Plausible, Fathom,
|
|
76
|
+
* GA, …).
|
|
77
|
+
*
|
|
78
|
+
* **Deployment & i18n**
|
|
79
|
+
* - `deployment` — `site` URL (needed for absolute links, sitemaps, and OG),
|
|
80
|
+
* `adapter` (`vercel`/`node`/`netlify`/`cloudflare`), `output`
|
|
81
|
+
* (`static`/`server`), and `base` path. Auto-detected on Vercel/Netlify/
|
|
82
|
+
* Cloudflare from the platform env.
|
|
83
|
+
* - `i18n` — opt-in multi-locale: `locales`, `defaultLocale`, `parser`
|
|
84
|
+
* (`dir` vs filename `dot` suffix), and per-locale UI overrides.
|
|
85
|
+
*
|
|
86
|
+
* - `examples` — where `<Component path>` previews resolve their source from
|
|
87
|
+
* (defaults to `examples/`; supports a glob for colocated registries).
|
|
88
|
+
*
|
|
89
|
+
* @example Zero-config — just render the Markdown under `docs/`.
|
|
90
|
+
* ```ts
|
|
91
|
+
* export default defineConfig({});
|
|
92
|
+
* ```
|
|
93
|
+
*
|
|
94
|
+
* @example A production docs site with theming, search, and deployment.
|
|
95
|
+
* ```ts
|
|
96
|
+
* export default defineConfig({
|
|
97
|
+
* title: "Acme Docs",
|
|
98
|
+
* description: "Build faster with Acme.",
|
|
99
|
+
* logo: { image: "/logo.svg", text: "Acme" },
|
|
100
|
+
* github: { owner: "acme", repo: "acme" },
|
|
101
|
+
* theme: { accent: "violet", fonts: { body: "inter" }, radius: "lg" },
|
|
102
|
+
* navigation: {
|
|
103
|
+
* tabs: [
|
|
104
|
+
* { label: "Guides", path: "/guides" },
|
|
105
|
+
* { label: "API", path: "/api" },
|
|
106
|
+
* ],
|
|
107
|
+
* },
|
|
108
|
+
* search: { provider: "orama" },
|
|
109
|
+
* deployment: { site: "https://docs.acme.com", adapter: "vercel" },
|
|
110
|
+
* });
|
|
111
|
+
* ```
|
|
112
|
+
*
|
|
113
|
+
* @example An OpenAPI reference with the Ask AI assistant enabled.
|
|
114
|
+
* ```ts
|
|
115
|
+
* export default defineConfig({
|
|
116
|
+
* title: "Acme API",
|
|
117
|
+
* openapi: {
|
|
118
|
+
* enabled: true,
|
|
119
|
+
* route: "/reference",
|
|
120
|
+
* sources: [{ label: "Core", spec: "./openapi.json" }],
|
|
121
|
+
* },
|
|
122
|
+
* ai: { ask: { enabled: true }, llmsTxt: true },
|
|
123
|
+
* });
|
|
124
|
+
* ```
|
|
125
|
+
*
|
|
126
|
+
* @param config - The site configuration. All fields are optional.
|
|
127
|
+
* @returns The same config object, typed for inference.
|
|
128
|
+
* @see https://useblume.dev/docs for the full configuration reference.
|
|
6
129
|
*/
|
|
7
130
|
export declare const defineConfig: (config: BlumeConfig) => BlumeConfig;
|
|
8
131
|
/** Result of loading + validating a project config. */
|
|
@@ -82,6 +82,10 @@ export interface BlumeDataConfig {
|
|
|
82
82
|
analytics: NonNullable<ResolvedConfig["analytics"]> | null;
|
|
83
83
|
/** Apple touch icon, or `null` when none is configured/detected. */
|
|
84
84
|
appleIcon: BlumeFavicon | null;
|
|
85
|
+
/** Ask AI empty-state suggestions, or `null` when Ask AI is off. */
|
|
86
|
+
ask: {
|
|
87
|
+
suggestions: NonNullable<ResolvedConfig["ai"]["ask"]>["suggestions"];
|
|
88
|
+
} | null;
|
|
85
89
|
banner: BlumeBanner | null;
|
|
86
90
|
/** `markdown.code.wrap`: wrap long code lines instead of scrolling. */
|
|
87
91
|
codeWrap: boolean;
|
|
@@ -16,6 +16,7 @@ declare const uiStringsObject: z.ZodObject<{
|
|
|
16
16
|
connectMcp: z.ZodDefault<z.ZodString>;
|
|
17
17
|
copied: z.ZodDefault<z.ZodString>;
|
|
18
18
|
copyClaudeCode: z.ZodDefault<z.ZodString>;
|
|
19
|
+
copyCodex: z.ZodDefault<z.ZodString>;
|
|
19
20
|
copyMarkdown: z.ZodDefault<z.ZodString>;
|
|
20
21
|
copyServerUrl: z.ZodDefault<z.ZodString>;
|
|
21
22
|
edit: z.ZodDefault<z.ZodString>;
|
|
@@ -33,6 +34,7 @@ declare const uiStringsObject: z.ZodObject<{
|
|
|
33
34
|
edit: string;
|
|
34
35
|
openInChat: string;
|
|
35
36
|
scrollToTop: string;
|
|
37
|
+
copyCodex: string;
|
|
36
38
|
}, {
|
|
37
39
|
addToCursor?: string | undefined;
|
|
38
40
|
addToVscode?: string | undefined;
|
|
@@ -45,13 +47,18 @@ declare const uiStringsObject: z.ZodObject<{
|
|
|
45
47
|
edit?: string | undefined;
|
|
46
48
|
openInChat?: string | undefined;
|
|
47
49
|
scrollToTop?: string | undefined;
|
|
50
|
+
copyCodex?: string | undefined;
|
|
48
51
|
}>>;
|
|
49
52
|
ask: z.ZodDefault<z.ZodObject<{
|
|
53
|
+
clear: z.ZodDefault<z.ZodString>;
|
|
54
|
+
close: z.ZodDefault<z.ZodString>;
|
|
55
|
+
copy: z.ZodDefault<z.ZodString>;
|
|
50
56
|
empty: z.ZodDefault<z.ZodString>;
|
|
51
57
|
error: z.ZodDefault<z.ZodString>;
|
|
52
58
|
label: z.ZodDefault<z.ZodString>;
|
|
53
59
|
placeholder: z.ZodDefault<z.ZodString>;
|
|
54
60
|
send: z.ZodDefault<z.ZodString>;
|
|
61
|
+
tip: z.ZodDefault<z.ZodString>;
|
|
55
62
|
title: z.ZodDefault<z.ZodString>;
|
|
56
63
|
}, "strip", z.ZodTypeAny, {
|
|
57
64
|
empty: string;
|
|
@@ -60,6 +67,10 @@ declare const uiStringsObject: z.ZodObject<{
|
|
|
60
67
|
placeholder: string;
|
|
61
68
|
send: string;
|
|
62
69
|
title: string;
|
|
70
|
+
clear: string;
|
|
71
|
+
close: string;
|
|
72
|
+
copy: string;
|
|
73
|
+
tip: string;
|
|
63
74
|
}, {
|
|
64
75
|
empty?: string | undefined;
|
|
65
76
|
error?: string | undefined;
|
|
@@ -67,6 +78,10 @@ declare const uiStringsObject: z.ZodObject<{
|
|
|
67
78
|
placeholder?: string | undefined;
|
|
68
79
|
send?: string | undefined;
|
|
69
80
|
title?: string | undefined;
|
|
81
|
+
clear?: string | undefined;
|
|
82
|
+
close?: string | undefined;
|
|
83
|
+
copy?: string | undefined;
|
|
84
|
+
tip?: string | undefined;
|
|
70
85
|
}>>;
|
|
71
86
|
feedback: z.ZodDefault<z.ZodObject<{
|
|
72
87
|
no: z.ZodDefault<z.ZodString>;
|
|
@@ -165,6 +180,7 @@ declare const uiStringsObject: z.ZodObject<{
|
|
|
165
180
|
edit: string;
|
|
166
181
|
openInChat: string;
|
|
167
182
|
scrollToTop: string;
|
|
183
|
+
copyCodex: string;
|
|
168
184
|
};
|
|
169
185
|
ask: {
|
|
170
186
|
empty: string;
|
|
@@ -173,6 +189,10 @@ declare const uiStringsObject: z.ZodObject<{
|
|
|
173
189
|
placeholder: string;
|
|
174
190
|
send: string;
|
|
175
191
|
title: string;
|
|
192
|
+
clear: string;
|
|
193
|
+
close: string;
|
|
194
|
+
copy: string;
|
|
195
|
+
tip: string;
|
|
176
196
|
};
|
|
177
197
|
feedback: {
|
|
178
198
|
no: string;
|
|
@@ -219,6 +239,7 @@ declare const uiStringsObject: z.ZodObject<{
|
|
|
219
239
|
edit?: string | undefined;
|
|
220
240
|
openInChat?: string | undefined;
|
|
221
241
|
scrollToTop?: string | undefined;
|
|
242
|
+
copyCodex?: string | undefined;
|
|
222
243
|
} | undefined;
|
|
223
244
|
ask?: {
|
|
224
245
|
empty?: string | undefined;
|
|
@@ -227,6 +248,10 @@ declare const uiStringsObject: z.ZodObject<{
|
|
|
227
248
|
placeholder?: string | undefined;
|
|
228
249
|
send?: string | undefined;
|
|
229
250
|
title?: string | undefined;
|
|
251
|
+
clear?: string | undefined;
|
|
252
|
+
close?: string | undefined;
|
|
253
|
+
copy?: string | undefined;
|
|
254
|
+
tip?: string | undefined;
|
|
230
255
|
} | undefined;
|
|
231
256
|
feedback?: {
|
|
232
257
|
no?: string | undefined;
|
|
@@ -269,6 +294,7 @@ export declare const uiStringsSchema: z.ZodDefault<z.ZodObject<{
|
|
|
269
294
|
connectMcp: z.ZodDefault<z.ZodString>;
|
|
270
295
|
copied: z.ZodDefault<z.ZodString>;
|
|
271
296
|
copyClaudeCode: z.ZodDefault<z.ZodString>;
|
|
297
|
+
copyCodex: z.ZodDefault<z.ZodString>;
|
|
272
298
|
copyMarkdown: z.ZodDefault<z.ZodString>;
|
|
273
299
|
copyServerUrl: z.ZodDefault<z.ZodString>;
|
|
274
300
|
edit: z.ZodDefault<z.ZodString>;
|
|
@@ -286,6 +312,7 @@ export declare const uiStringsSchema: z.ZodDefault<z.ZodObject<{
|
|
|
286
312
|
edit: string;
|
|
287
313
|
openInChat: string;
|
|
288
314
|
scrollToTop: string;
|
|
315
|
+
copyCodex: string;
|
|
289
316
|
}, {
|
|
290
317
|
addToCursor?: string | undefined;
|
|
291
318
|
addToVscode?: string | undefined;
|
|
@@ -298,13 +325,18 @@ export declare const uiStringsSchema: z.ZodDefault<z.ZodObject<{
|
|
|
298
325
|
edit?: string | undefined;
|
|
299
326
|
openInChat?: string | undefined;
|
|
300
327
|
scrollToTop?: string | undefined;
|
|
328
|
+
copyCodex?: string | undefined;
|
|
301
329
|
}>>;
|
|
302
330
|
ask: z.ZodDefault<z.ZodObject<{
|
|
331
|
+
clear: z.ZodDefault<z.ZodString>;
|
|
332
|
+
close: z.ZodDefault<z.ZodString>;
|
|
333
|
+
copy: z.ZodDefault<z.ZodString>;
|
|
303
334
|
empty: z.ZodDefault<z.ZodString>;
|
|
304
335
|
error: z.ZodDefault<z.ZodString>;
|
|
305
336
|
label: z.ZodDefault<z.ZodString>;
|
|
306
337
|
placeholder: z.ZodDefault<z.ZodString>;
|
|
307
338
|
send: z.ZodDefault<z.ZodString>;
|
|
339
|
+
tip: z.ZodDefault<z.ZodString>;
|
|
308
340
|
title: z.ZodDefault<z.ZodString>;
|
|
309
341
|
}, "strip", z.ZodTypeAny, {
|
|
310
342
|
empty: string;
|
|
@@ -313,6 +345,10 @@ export declare const uiStringsSchema: z.ZodDefault<z.ZodObject<{
|
|
|
313
345
|
placeholder: string;
|
|
314
346
|
send: string;
|
|
315
347
|
title: string;
|
|
348
|
+
clear: string;
|
|
349
|
+
close: string;
|
|
350
|
+
copy: string;
|
|
351
|
+
tip: string;
|
|
316
352
|
}, {
|
|
317
353
|
empty?: string | undefined;
|
|
318
354
|
error?: string | undefined;
|
|
@@ -320,6 +356,10 @@ export declare const uiStringsSchema: z.ZodDefault<z.ZodObject<{
|
|
|
320
356
|
placeholder?: string | undefined;
|
|
321
357
|
send?: string | undefined;
|
|
322
358
|
title?: string | undefined;
|
|
359
|
+
clear?: string | undefined;
|
|
360
|
+
close?: string | undefined;
|
|
361
|
+
copy?: string | undefined;
|
|
362
|
+
tip?: string | undefined;
|
|
323
363
|
}>>;
|
|
324
364
|
feedback: z.ZodDefault<z.ZodObject<{
|
|
325
365
|
no: z.ZodDefault<z.ZodString>;
|
|
@@ -418,6 +458,7 @@ export declare const uiStringsSchema: z.ZodDefault<z.ZodObject<{
|
|
|
418
458
|
edit: string;
|
|
419
459
|
openInChat: string;
|
|
420
460
|
scrollToTop: string;
|
|
461
|
+
copyCodex: string;
|
|
421
462
|
};
|
|
422
463
|
ask: {
|
|
423
464
|
empty: string;
|
|
@@ -426,6 +467,10 @@ export declare const uiStringsSchema: z.ZodDefault<z.ZodObject<{
|
|
|
426
467
|
placeholder: string;
|
|
427
468
|
send: string;
|
|
428
469
|
title: string;
|
|
470
|
+
clear: string;
|
|
471
|
+
close: string;
|
|
472
|
+
copy: string;
|
|
473
|
+
tip: string;
|
|
429
474
|
};
|
|
430
475
|
feedback: {
|
|
431
476
|
no: string;
|
|
@@ -472,6 +517,7 @@ export declare const uiStringsSchema: z.ZodDefault<z.ZodObject<{
|
|
|
472
517
|
edit?: string | undefined;
|
|
473
518
|
openInChat?: string | undefined;
|
|
474
519
|
scrollToTop?: string | undefined;
|
|
520
|
+
copyCodex?: string | undefined;
|
|
475
521
|
} | undefined;
|
|
476
522
|
ask?: {
|
|
477
523
|
empty?: string | undefined;
|
|
@@ -480,6 +526,10 @@ export declare const uiStringsSchema: z.ZodDefault<z.ZodObject<{
|
|
|
480
526
|
placeholder?: string | undefined;
|
|
481
527
|
send?: string | undefined;
|
|
482
528
|
title?: string | undefined;
|
|
529
|
+
clear?: string | undefined;
|
|
530
|
+
close?: string | undefined;
|
|
531
|
+
copy?: string | undefined;
|
|
532
|
+
tip?: string | undefined;
|
|
483
533
|
} | undefined;
|
|
484
534
|
feedback?: {
|
|
485
535
|
no?: string | undefined;
|