blume 1.0.2 → 1.0.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +37 -0
- package/dist/cli/index.js +496 -295
- package/dist/cli/index.js.map +18 -17
- package/dist/types/core/config-input.d.ts +44 -22
- package/dist/types/core/config.d.ts +3 -3
- package/dist/types/core/data.d.ts +12 -0
- package/dist/types/core/i18n-ui.d.ts +136 -136
- package/dist/types/core/schema.d.ts +502 -384
- package/dist/types/core/types.d.ts +10 -0
- package/dist/types/openapi/references.d.ts +12 -7
- package/docs/advanced/api-reference.mdx +11 -3
- package/docs/advanced/custom-pages.mdx +2 -0
- package/docs/configuration/ai.mdx +6 -4
- package/docs/configuration/index.mdx +6 -8
- package/docs/configuration/seo.mdx +20 -1
- package/docs/content/components.mdx +26 -5
- package/docs/content/navigation.mdx +10 -0
- package/docs/content/syntax.mdx +116 -4
- package/package.json +1 -1
- package/skills/blume-migrate/SKILL.md +170 -0
- package/skills/blume-migrate/assets/oxfmt@0.55.0.patch +20 -0
- package/skills/blume-migrate/references/docusaurus.md +95 -0
- package/skills/blume-migrate/references/fumadocs.md +95 -0
- package/skills/blume-migrate/references/mintlify.md +155 -0
- package/skills/blume-migrate/references/monorepo.md +224 -0
- package/skills/blume-migrate/references/nextra.md +76 -0
- package/skills/blume-migrate/references/starlight.md +116 -0
- package/skills/blume-migrate/scripts/mintlify-codemod.mjs +466 -0
- package/src/ai/agent-readability.ts +3 -3
- package/src/ai/mcp/data.ts +2 -2
- package/src/astro/component-slots.ts +3 -2
- package/src/astro/generate.ts +97 -30
- package/src/astro/templates.ts +140 -53
- package/src/blume-modules.d.ts +6 -0
- package/src/components/content/Callout.astro +8 -2
- package/src/components/content/Prompt.astro +25 -13
- package/src/components/layout/Header.astro +19 -10
- package/src/components/layout/Logo.astro +13 -1
- package/src/components/layout/PageFeedback.astro +1 -1
- package/src/components/layout/PageLayout.astro +11 -11
- package/src/components/layout/Pagination.astro +6 -6
- package/src/components/layout/ReferenceLayout.astro +1 -0
- package/src/components/layout/RootLayout.astro +10 -11
- package/src/components/layout/Search.astro +1 -1
- package/src/components/layout/nav-utils.ts +9 -7
- package/src/core/config-input.ts +47 -27
- package/src/core/config.ts +3 -3
- package/src/core/data.ts +9 -1
- package/src/core/navigation.ts +55 -13
- package/src/core/schema.ts +32 -15
- package/src/core/server-features.ts +1 -1
- package/src/core/sources/watch.ts +5 -0
- package/src/core/types.ts +10 -0
- package/src/deploy/adapter-output.ts +11 -1
- package/src/markdown/index.ts +2 -0
- package/src/markdown/language-icon.ts +2 -1
- package/src/markdown/table-wrap.ts +43 -0
- package/src/og/card.ts +39 -12
- package/src/og/index.ts +1 -1
- package/src/og/logo.ts +21 -0
- package/src/openapi/references.ts +19 -16
- package/src/registry/eject.ts +11 -5
- package/src/theme/entry.ts +50 -5
|
@@ -150,7 +150,17 @@ export type NavNode = {
|
|
|
150
150
|
/** Top-level tab/section. */
|
|
151
151
|
export interface NavTab {
|
|
152
152
|
label: string;
|
|
153
|
+
/**
|
|
154
|
+
* The tab's section prefix, used to scope the sidebar and match the active
|
|
155
|
+
* tab. Not necessarily a linkable route — a section may have no index page.
|
|
156
|
+
*/
|
|
153
157
|
path: string;
|
|
158
|
+
/**
|
|
159
|
+
* The clickable target. Equals `path` when the section has an index page;
|
|
160
|
+
* otherwise it's resolved to the section's first page so the tab never links
|
|
161
|
+
* to a 404. Absent when it matches `path`.
|
|
162
|
+
*/
|
|
163
|
+
href?: string;
|
|
154
164
|
icon?: string;
|
|
155
165
|
items?: NavSelectorItem[];
|
|
156
166
|
}
|
|
@@ -1,11 +1,10 @@
|
|
|
1
1
|
import type { ResolvedConfig } from "../core/schema.ts";
|
|
2
|
-
import type { NavTab } from "../core/types.ts";
|
|
3
2
|
/**
|
|
4
3
|
* Pure resolution of the configured API reference blocks into concrete routes,
|
|
5
|
-
* labels, and a renderer choice — no file IO, so the content source, the
|
|
6
|
-
*
|
|
7
|
-
* one source of truth. Kept free of any Astro/template
|
|
8
|
-
* depend on it without a cycle.
|
|
4
|
+
* labels, and a renderer choice — no file IO, so the content source, the
|
|
5
|
+
* nav-target validation, the Scalar page generator, and the `blume:openapi`
|
|
6
|
+
* data module all share one source of truth. Kept free of any Astro/template
|
|
7
|
+
* imports so `core` can depend on it without a cycle.
|
|
9
8
|
*/
|
|
10
9
|
export type ReferenceKind = "openapi" | "asyncapi";
|
|
11
10
|
/** Who renders a reference: Blume's own UI, or the embedded Scalar SPA. */
|
|
@@ -52,8 +51,14 @@ export declare const normalizeRoute: (route: string) => string;
|
|
|
52
51
|
* by default); AsyncAPI is always rendered by Scalar for now.
|
|
53
52
|
*/
|
|
54
53
|
export declare const resolveReferences: (config: ResolvedConfig) => ReferenceSource[];
|
|
55
|
-
/**
|
|
56
|
-
|
|
54
|
+
/**
|
|
55
|
+
* Mounted route for every reference, regardless of renderer. References no
|
|
56
|
+
* longer add a header tab automatically — authors point a `navigation.tabs`
|
|
57
|
+
* entry at one of these routes to surface it (and, for Blume-rendered specs, to
|
|
58
|
+
* scope its operations sidebar). These routes are whitelisted as valid nav
|
|
59
|
+
* targets so such a tab doesn't read as a broken link.
|
|
60
|
+
*/
|
|
61
|
+
export declare const referenceRoutes: (config: ResolvedConfig) => string[];
|
|
57
62
|
/** Blume-rendered OpenAPI references, deduped by route (first wins). */
|
|
58
63
|
export declare const blumeReferences: (config: ResolvedConfig) => ReferenceSource[];
|
|
59
64
|
/** Whether any reference is Scalar-rendered (gates the `@scalar/astro` dep + pages). */
|
|
@@ -3,7 +3,7 @@ title: OpenAPI / AsyncAPI
|
|
|
3
3
|
description: Drop in an OpenAPI spec and get a native API reference — one real page per operation, in your sidebar and search.
|
|
4
4
|
---
|
|
5
5
|
|
|
6
|
-
Point Blume at an OpenAPI spec and it generates a native API reference: one **real page per operation**, grouped by tag in a tab-scoped sidebar, with schema tables, request/response examples, and generated code samples. Because each operation is a genuine Blume page, it gets its own URL, shows up in **site search** and `llms.txt`, and gets an Open Graph image — the same as any hand-written doc.
|
|
6
|
+
Point Blume at an OpenAPI spec and it generates a native API reference: one **real page per operation**, grouped by tag in a tab-scoped sidebar, with schema tables, request/response examples, and generated code samples. Because each operation is a genuine Blume page, it gets its own URL, shows up in **site search** and `llms.txt`, and gets an Open Graph image — the same as any hand-written doc. The config below points Blume at the public Petstore spec as an example.
|
|
7
7
|
|
|
8
8
|
```ts blume.config.ts lineNumbers
|
|
9
9
|
openapi: {
|
|
@@ -12,7 +12,15 @@ openapi: {
|
|
|
12
12
|
}
|
|
13
13
|
```
|
|
14
14
|
|
|
15
|
-
That mounts the reference at `/reference` (an overview page) with each operation at `/reference/<tag>/<operation
|
|
15
|
+
That mounts the reference at `/reference` (an overview page) with each operation at `/reference/<tag>/<operation>`. The `spec` is either an `http(s)` URL or a path to a local file in your project. Blume parses it with [Scalar's OpenAPI parser](https://github.com/scalar/scalar) — Swagger 2.0 and OpenAPI 3.0 specs are upgraded to 3.1 automatically.
|
|
16
|
+
|
|
17
|
+
The reference doesn't add a header tab on its own. To surface it, point a [navigation tab](/docs/content/navigation#tabs) at its route — this also scopes the operations sidebar for the native renderer:
|
|
18
|
+
|
|
19
|
+
```ts blume.config.ts
|
|
20
|
+
navigation: {
|
|
21
|
+
tabs: [{ label: "API", path: "/reference" }],
|
|
22
|
+
}
|
|
23
|
+
```
|
|
16
24
|
|
|
17
25
|
:::note
|
|
18
26
|
Operations are indexed for search by their **summary and tag**. The rendered schema tables and code samples aren't full-text indexed; search matches an operation's title and section, then links to its own page.
|
|
@@ -31,7 +39,7 @@ openapi: {
|
|
|
31
39
|
|
|
32
40
|
## Route
|
|
33
41
|
|
|
34
|
-
`route` controls where the reference mounts — the overview page and the prefix for every operation route (and the
|
|
42
|
+
`route` controls where the reference mounts — the overview page and the prefix for every operation route (and the route you point a navigation tab at):
|
|
35
43
|
|
|
36
44
|
```ts blume.config.ts lineNumbers
|
|
37
45
|
openapi: {
|
|
@@ -222,6 +222,8 @@ const { config } = data;
|
|
|
222
222
|
</PageLayout>
|
|
223
223
|
```
|
|
224
224
|
|
|
225
|
+
The header a custom page gets is the same one the docs pages get, so the chrome that lives in it comes along: search, the theme toggle, the language switcher, and — when [Ask AI](/docs/configuration/ai) is configured — the Ask AI trigger. None of it needs wiring up per page. Pass `askEnabled={false}` to leave the Ask trigger off one page while keeping it everywhere else.
|
|
226
|
+
|
|
225
227
|
Passing `siteUrl` (and `ogEnabled`) derives the page's `canonical` and a generated `og:image` automatically: Blume renders an Open Graph card for every static custom page — the home included, the most-shared URL — served at `/og/<route>.png` (`/og/index.png` for `/`). The home card uses the site title with the description as its eyebrow; a deeper page is titled from its last path segment. Set `ogImage` or `canonical` explicitly to override either. `ogImage` takes a root-relative path — a file in `public/`, resolved against [`deployment.site`](/docs/deployment) to the absolute URL crawlers need — or an external URL, which passes through untouched:
|
|
226
228
|
|
|
227
229
|
```astro pages/index.astro lineNumbers
|
|
@@ -198,9 +198,11 @@ The `POST /api/ask` endpoint is **unauthenticated** — it has to be, so the in-
|
|
|
198
198
|
Host a [Model Context Protocol](https://modelcontextprotocol.io) server so coding agents (Claude Code, Cursor, VS Code, claude.ai connectors) can search and read your docs directly — no scraping:
|
|
199
199
|
|
|
200
200
|
```ts blume.config.ts lineNumbers
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
201
|
+
ai: {
|
|
202
|
+
mcp: {
|
|
203
|
+
enabled: true,
|
|
204
|
+
route: "/mcp", // where the server is mounted
|
|
205
|
+
},
|
|
204
206
|
}
|
|
205
207
|
```
|
|
206
208
|
|
|
@@ -227,7 +229,7 @@ deployment: {
|
|
|
227
229
|
}
|
|
228
230
|
```
|
|
229
231
|
|
|
230
|
-
A static build with `mcp.enabled` fails fast with a message telling you to set `deployment.output` to `server`. See [Deployment](/docs/deployment) for the adapters. Once deployed, connect from Claude Code with:
|
|
232
|
+
A static build with `ai.mcp.enabled` fails fast with a message telling you to set `deployment.output` to `server`. See [Deployment](/docs/deployment) for the adapters. Once deployed, connect from Claude Code with:
|
|
231
233
|
|
|
232
234
|
```bash
|
|
233
235
|
claude mcp add --transport http my-docs https://docs.example.com/mcp
|
|
@@ -64,12 +64,11 @@ export default defineConfig({
|
|
|
64
64
|
// AI — see the AI guide
|
|
65
65
|
ai: {
|
|
66
66
|
llmsTxt: true,
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
route: "/mcp",
|
|
67
|
+
// MCP server (needs server output)
|
|
68
|
+
mcp: {
|
|
69
|
+
enabled: false,
|
|
70
|
+
route: "/mcp",
|
|
71
|
+
},
|
|
73
72
|
},
|
|
74
73
|
|
|
75
74
|
// SEO — OG images, feeds, sitemap, structured data; see the SEO guide
|
|
@@ -287,8 +286,7 @@ Each of these has its own guide. The config field is the entry point:
|
|
|
287
286
|
| `navigation` | Explicit sidebar and header tabs | [Navigation](/docs/content/navigation) |
|
|
288
287
|
| `search` | Provider (Orama, Pagefind, Algolia, and more) and indexing | [Search](/docs/configuration/search) |
|
|
289
288
|
| `markdown` | Markdown rendering options — code blocks, heading anchors, image zoom | [Syntax](/docs/content/syntax) |
|
|
290
|
-
| `ai` | `llms.txt`, Ask AI, and the MCP server | [AI](/docs/configuration/ai) |
|
|
291
|
-
| `mcp` | Hosted MCP server for coding agents | [AI](/docs/configuration/ai#mcp-server) |
|
|
289
|
+
| `ai` | `llms.txt`, Ask AI, and the hosted MCP server for coding agents | [AI](/docs/configuration/ai) |
|
|
292
290
|
| `analytics` | Vercel, PostHog, and custom scripts | [Analytics](/docs/configuration/analytics) |
|
|
293
291
|
| `seo` | Metadata, OG images, feeds, structured data | [SEO](/docs/configuration/seo) |
|
|
294
292
|
| `deployment` | Output mode, adapter, and site URL | [Deployment](/docs/deployment) |
|
|
@@ -106,7 +106,26 @@ seo: {
|
|
|
106
106
|
}
|
|
107
107
|
```
|
|
108
108
|
|
|
109
|
-
|
|
109
|
+
### Brand the generated card
|
|
110
|
+
|
|
111
|
+
Set a local SVG and hex palette to match the generated card to your brand. The logo can live in `public/` or at the project root. Omit any palette value to keep its default.
|
|
112
|
+
|
|
113
|
+
```ts blume.config.ts lineNumbers
|
|
114
|
+
seo: {
|
|
115
|
+
og: {
|
|
116
|
+
logo: "/logo/og.svg",
|
|
117
|
+
palette: {
|
|
118
|
+
accent: "#ff5410",
|
|
119
|
+
background: "#1d1d1d",
|
|
120
|
+
foreground: "#fff6f2",
|
|
121
|
+
muted: "#a6a19f",
|
|
122
|
+
border: "#323232",
|
|
123
|
+
},
|
|
124
|
+
},
|
|
125
|
+
}
|
|
126
|
+
```
|
|
127
|
+
|
|
128
|
+
By default, each card is derived from your content and theme — the **page title** as the headline, your **site title** as the eyebrow, and your theme **accent** for the mark. Images are served at `/og/<slug>.png`, mirroring each route, and are prerendered as static files even in server mode:
|
|
110
129
|
|
|
111
130
|
| Page route | Image URL |
|
|
112
131
|
| ------------------- | -------------------------- |
|
|
@@ -532,14 +532,14 @@ export interface ButtonProps {
|
|
|
532
532
|
|
|
533
533
|
A card linking to a GitHub repository with its live star and fork counts. Counts are fetched at build time — no client JavaScript — and the card still renders if the API is unreachable. Pass `owner` and `repo`, or omit them to use the repository from your `blume.config`. Set a `GITHUB_TOKEN` environment variable to lift the API rate limit.
|
|
534
534
|
|
|
535
|
-
<GithubInfo owner="
|
|
535
|
+
<GithubInfo owner="haydenbleasel" repo="blume" />
|
|
536
536
|
|
|
537
537
|
```astro lineNumbers
|
|
538
538
|
<!-- Uses the repo from blume.config -->
|
|
539
539
|
<GithubInfo />
|
|
540
540
|
|
|
541
541
|
<!-- Or point it at any repository -->
|
|
542
|
-
<GithubInfo owner="
|
|
542
|
+
<GithubInfo owner="haydenbleasel" repo="blume" />
|
|
543
543
|
```
|
|
544
544
|
|
|
545
545
|
## Component
|
|
@@ -619,7 +619,6 @@ An Astro example renders live with no client JavaScript:
|
|
|
619
619
|
|
|
620
620
|
<CodeBlock
|
|
621
621
|
lang="ts"
|
|
622
|
-
icons={false}
|
|
623
622
|
code={`export const greet = (name: string): string =>
|
|
624
623
|
\`Hello, \${name}!\`;`}
|
|
625
624
|
/>
|
|
@@ -629,7 +628,7 @@ An Astro example renders live with no client JavaScript:
|
|
|
629
628
|
import CodeBlock from "blume/components/content/CodeBlock.astro";
|
|
630
629
|
---
|
|
631
630
|
|
|
632
|
-
<CodeBlock lang="ts" code={source}
|
|
631
|
+
<CodeBlock lang="ts" code={source} />
|
|
633
632
|
```
|
|
634
633
|
|
|
635
634
|
To highlight to an HTML string yourself (e.g. inside your own component), import the underlying helper from `blume/markdown`:
|
|
@@ -670,6 +669,28 @@ Diff two files in your project, relative to its root:
|
|
|
670
669
|
|
|
671
670
|
<Diff before="diffs/button-before.ts" after="diffs/button-after.ts" />
|
|
672
671
|
|
|
673
|
-
|
|
672
|
+
```astro
|
|
673
|
+
<Diff before="diffs/button-before.ts" after="diffs/button-after.ts" />
|
|
674
|
+
```
|
|
675
|
+
|
|
676
|
+
Or render a unified patch — either from a file with `src`, or inline with `patch`:
|
|
674
677
|
|
|
675
678
|
<Diff src="diffs/greet.patch" />
|
|
679
|
+
|
|
680
|
+
```astro
|
|
681
|
+
<Diff src="diffs/greet.patch" />
|
|
682
|
+
```
|
|
683
|
+
|
|
684
|
+
```astro
|
|
685
|
+
<Diff
|
|
686
|
+
patch={`--- a/greet.ts
|
|
687
|
+
+++ b/greet.ts
|
|
688
|
+
@@ -1,3 +1,4 @@
|
|
689
|
+
-export function greet(name) {
|
|
690
|
+
- return "Hi, " + name;
|
|
691
|
+
+export function greet(name: string): string {
|
|
692
|
+
+ const greeting = "Hi, " + name + "!";
|
|
693
|
+
+ return greeting;
|
|
694
|
+
}`}
|
|
695
|
+
/>
|
|
696
|
+
```
|
|
@@ -109,6 +109,16 @@ navigation: {
|
|
|
109
109
|
}
|
|
110
110
|
```
|
|
111
111
|
|
|
112
|
+
An enabled [OpenAPI or AsyncAPI reference](/docs/advanced/api-reference) mounts at its route but doesn't add a tab on its own — point a tab at that route to surface it in the header (and, for the native renderer, to scope its operations sidebar), with whatever label you like:
|
|
113
|
+
|
|
114
|
+
```ts blume.config.ts
|
|
115
|
+
navigation: {
|
|
116
|
+
tabs: [
|
|
117
|
+
{ label: "API", path: "/reference" },
|
|
118
|
+
],
|
|
119
|
+
}
|
|
120
|
+
```
|
|
121
|
+
|
|
112
122
|
Tabs also **scope the sidebar**: when the current route falls under a tab's `path`, the sidebar shows only that section's pages — so `/adapters/*` lists the adapters and nothing else. The folder at a tab's `path` becomes the section, so this needs no extra config beyond the tabs themselves; structure your content into a folder per tab and point each tab at it.
|
|
113
123
|
|
|
114
124
|
On a route under no tab (or a tab whose `path` is `/`), the sidebar shows the pages that _don't_ belong to a tab — each tab's folder is hidden from it, since that section already has its own tab in the header. So a root landing page lists your loose top-level pages while the sectioned content stays behind its tab, mirroring Fumadocs' root folders. If a route has no pages of its own to show this way, the full tree is shown instead, so the sidebar is never left blank.
|
package/docs/content/syntax.mdx
CHANGED
|
@@ -275,25 +275,137 @@ npm i blume
|
|
|
275
275
|
|
|
276
276
|
## Diagrams
|
|
277
277
|
|
|
278
|
-
A `mermaid` block renders a [Mermaid](https://mermaid.js.org) diagram
|
|
278
|
+
A `mermaid` block renders a [Mermaid](https://mermaid.js.org) diagram straight from text. The fence contents are passed to Mermaid verbatim, so every diagram type Mermaid supports works here. Diagrams follow the active color theme and re-render when it changes. Author one by fencing the source with `mermaid`:
|
|
279
279
|
|
|
280
|
+
````md
|
|
280
281
|
```mermaid
|
|
281
282
|
flowchart LR
|
|
282
283
|
A[Markdown] --> B{blume build}
|
|
283
284
|
B --> C[Static HTML]
|
|
284
285
|
B --> D[llms.txt]
|
|
285
286
|
```
|
|
287
|
+
````
|
|
288
|
+
|
|
289
|
+
Diagrams render on the client, so this is an MDX-only feature, and the Mermaid library loads only on pages that include one. The rest of this section is a gallery of common types — see the [Mermaid docs](https://mermaid.js.org/intro/) for the full list.
|
|
290
|
+
|
|
291
|
+
### Flowchart
|
|
286
292
|
|
|
287
|
-
````md
|
|
288
293
|
```mermaid
|
|
289
294
|
flowchart LR
|
|
290
295
|
A[Markdown] --> B{blume build}
|
|
291
296
|
B --> C[Static HTML]
|
|
292
297
|
B --> D[llms.txt]
|
|
293
298
|
```
|
|
294
|
-
````
|
|
295
299
|
|
|
296
|
-
|
|
300
|
+
### Sequence diagram
|
|
301
|
+
|
|
302
|
+
```mermaid
|
|
303
|
+
sequenceDiagram
|
|
304
|
+
participant R as Reader
|
|
305
|
+
participant B as Blume
|
|
306
|
+
R->>B: Request /docs
|
|
307
|
+
B-->>R: Prerendered HTML
|
|
308
|
+
```
|
|
309
|
+
|
|
310
|
+
### Class diagram
|
|
311
|
+
|
|
312
|
+
```mermaid
|
|
313
|
+
classDiagram
|
|
314
|
+
class Page {
|
|
315
|
+
+string title
|
|
316
|
+
+string route
|
|
317
|
+
+render()
|
|
318
|
+
}
|
|
319
|
+
Page <|-- Doc
|
|
320
|
+
Page <|-- Changelog
|
|
321
|
+
```
|
|
322
|
+
|
|
323
|
+
### State diagram
|
|
324
|
+
|
|
325
|
+
```mermaid
|
|
326
|
+
stateDiagram-v2
|
|
327
|
+
[*] --> Draft
|
|
328
|
+
Draft --> Published: build
|
|
329
|
+
Published --> [*]
|
|
330
|
+
```
|
|
331
|
+
|
|
332
|
+
### Entity relationship
|
|
333
|
+
|
|
334
|
+
```mermaid
|
|
335
|
+
erDiagram
|
|
336
|
+
PAGE ||--o{ HEADING : contains
|
|
337
|
+
PAGE {
|
|
338
|
+
string title
|
|
339
|
+
string route
|
|
340
|
+
}
|
|
341
|
+
```
|
|
342
|
+
|
|
343
|
+
### User journey
|
|
344
|
+
|
|
345
|
+
```mermaid
|
|
346
|
+
journey
|
|
347
|
+
title Publishing a page
|
|
348
|
+
section Write
|
|
349
|
+
Draft MDX: 5: Author
|
|
350
|
+
section Ship
|
|
351
|
+
blume build: 4: Author
|
|
352
|
+
Deploy: 3: Author
|
|
353
|
+
```
|
|
354
|
+
|
|
355
|
+
### Gantt
|
|
356
|
+
|
|
357
|
+
```mermaid
|
|
358
|
+
gantt
|
|
359
|
+
title Release plan
|
|
360
|
+
dateFormat YYYY-MM-DD
|
|
361
|
+
section Docs
|
|
362
|
+
Draft :a1, 2026-01-01, 7d
|
|
363
|
+
Review :after a1, 3d
|
|
364
|
+
```
|
|
365
|
+
|
|
366
|
+
### Git graph
|
|
367
|
+
|
|
368
|
+
```mermaid
|
|
369
|
+
gitGraph
|
|
370
|
+
commit
|
|
371
|
+
branch develop
|
|
372
|
+
checkout develop
|
|
373
|
+
commit
|
|
374
|
+
checkout main
|
|
375
|
+
merge develop
|
|
376
|
+
commit
|
|
377
|
+
```
|
|
378
|
+
|
|
379
|
+
### Pie chart
|
|
380
|
+
|
|
381
|
+
```mermaid
|
|
382
|
+
pie title Content types
|
|
383
|
+
"Docs" : 70
|
|
384
|
+
"Blog" : 20
|
|
385
|
+
"Changelog" : 10
|
|
386
|
+
```
|
|
387
|
+
|
|
388
|
+
### Mindmap
|
|
389
|
+
|
|
390
|
+
```mermaid
|
|
391
|
+
mindmap
|
|
392
|
+
root((Blume))
|
|
393
|
+
Content
|
|
394
|
+
MDX
|
|
395
|
+
Markdown
|
|
396
|
+
Build
|
|
397
|
+
Static HTML
|
|
398
|
+
llms.txt
|
|
399
|
+
```
|
|
400
|
+
|
|
401
|
+
### Timeline
|
|
402
|
+
|
|
403
|
+
```mermaid
|
|
404
|
+
timeline
|
|
405
|
+
title Blume milestones
|
|
406
|
+
2025 : Prototype
|
|
407
|
+
2026 : 1.0 release
|
|
408
|
+
```
|
|
297
409
|
|
|
298
410
|
## Callouts
|
|
299
411
|
|
package/package.json
CHANGED
|
@@ -0,0 +1,170 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: blume-migrate
|
|
3
|
+
description: Migrate an existing documentation site (Mintlify, Docusaurus, Fumadocs, Nextra, Starlight, or any docs framework) to Blume, the markdown-first docs framework on Astro. Translate the source config to blume.config.ts, restructure content into Blume's filesystem-derived navigation, rewrite JSX callouts to directives, convert icons to Lucide, and inline snippets. Use when the user asks to migrate/convert/port a docs repo to Blume, or when the repo has a docs.json/mint.json, docusaurus.config.*, meta.json with fumadocs, _meta.* with nextra, or an astro.config.* with starlight().
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Migrate to Blume
|
|
7
|
+
|
|
8
|
+
Blume is a **markdown-first** documentation framework on Astro/Vite. You drop Markdown/MDX into a folder and get navigation, search, theming, Open Graph images, and a component library with no app boilerplate — **the framework is the template**. There is no starter to clone; the only thing a project owns is its content and a `blume.config.ts`.
|
|
9
|
+
|
|
10
|
+
Your job is to convert a source docs repo into an **idiomatic** Blume project — not a 1:1 transliteration. Read this file, detect the source framework, open the matching `references/<framework>.md` for the exact mappings, and work the loop below. Report everything you drop or approximate.
|
|
11
|
+
|
|
12
|
+
## Migration philosophy
|
|
13
|
+
|
|
14
|
+
- **Target idiomatic Blume, not a mechanical port.** Prefer filesystem-derived navigation over an exhaustive explicit `navigation.sidebar`. Prefer `:::` directives over JSX callouts. Prefer Blume defaults over restating them in config.
|
|
15
|
+
- **Every field has a default; `{}` is a valid config.** Map only what the source _declares_. If the source uses a framework default, don't write it.
|
|
16
|
+
- **Drop chrome that has no Blume equivalent — and say so.** Navbar CTAs, footer columns, custom theming, dynamic redirects, and unmappable icons get reported to the user, not silently discarded or faked.
|
|
17
|
+
- **Convert, don't preserve.** Blume's page frontmatter schema is **strict** — unknown keys are build errors. A source-only frontmatter key must be mapped to a Blume key or removed (and reported), never left to "maybe validate."
|
|
18
|
+
|
|
19
|
+
## Migration workflow
|
|
20
|
+
|
|
21
|
+
1. **Detect the source framework** and read its reference file:
|
|
22
|
+
- `docs.json` / `mint.json` → **Mintlify** (`references/mintlify.md`) — the deepest, config-declared nav.
|
|
23
|
+
- `docusaurus.config.*` → **Docusaurus** (`references/docusaurus.md`).
|
|
24
|
+
- `meta.json` + `fumadocs-*` deps (content under `content/docs/`) → **Fumadocs** (`references/fumadocs.md`).
|
|
25
|
+
- `_meta.{js,ts,json}` + `nextra` deps → **Nextra** (`references/nextra.md`).
|
|
26
|
+
- `astro.config.*` calling `starlight({…})` → **Starlight** (`references/starlight.md`).
|
|
27
|
+
- Anything else → apply this file's mental model directly; there's no framework-specific reference, so inventory by hand.
|
|
28
|
+
- **Also note the host repo, independent of source framework:** a pnpm/Turbo workspace, a non-`docs/` content layout, or a Vercel deploy each need integration steps (`content.root` scoping, `minimumReleaseAge`, lockfile, `vercel.json`, an Astro/Vite patch) — all in `references/monorepo.md`. Read it whenever the target isn't a bare single-package docs folder.
|
|
29
|
+
2. **Inventory the repo** before changing anything: the config file(s), the content tree, the nav definition, snippets/partials/includes, static assets, OpenAPI/AsyncAPI specs, redirects, i18n locales, custom components, and icon usage. Note what's declared vs. defaulted.
|
|
30
|
+
3. **Write `blume.config.ts`** with `defineConfig` from `blume`. Map only declared fields (see the reference's mapping table); rely on defaults everywhere else. A minimal result is `defineConfig({ title: "…" })`.
|
|
31
|
+
4. **Restructure content.** Choose `content.root` (default `docs`) — **detect where `.md`/`.mdx` actually live, don't assume a `docs/` folder.** Many repos keep content directly under an app dir (`apps/docs/api/`, `.../getting-started/`) with no `docs/` subfolder; when so, set `content.root` to that dir and scope `content.include` to the real content folders rather than leaving a bare `content.root: "."` that scans everything (see `references/monorepo.md` §1). Order with numeric prefixes (`01-intro.mdx`), group without a URL segment via `(group)/` folders, and add a `meta.ts` (`defineMeta`) only where filesystem order isn't enough. **A source that already declares per-folder navigation in a sidecar file — Fumadocs `meta.json`, Nextra `_meta.*` — _is_ that case: convert each one to a `meta.ts`, carrying over its title/icon/order/collapse, rather than dropping it and hoping filenames reproduce the intent. Filesystem inference is the fallback for folders that declare no per-folder nav, never a reason to discard one that does.** Reach for an explicit `navigation.sidebar` only when the source nav genuinely can't be expressed by files. **Reshaping into folder-per-tab moves URLs** — track every old→new path as you go; you'll turn them into `redirects` in step 5.
|
|
32
|
+
5. **Rewrite pages.** Map frontmatter to Blume's strict schema; convert callout JSX to `:::` directives — **directives (and math/mermaid/package-install fences) are MDX-only, so rename any `.md` page that needs them to `.mdx`**; rename components; inline snippets/partials (Blume has no import-based includes); fix asset paths; **rewrite internal links** to their new routes (including OpenAPI operation links — see the OpenAPI section, their slugs differ from most sources); **add a `redirects` entry for every route you moved** in step 4; **convert every icon name to Lucide** (Blume is Lucide-only — no FontAwesome/Tabler). Remove any duplicated H1 in the body (`title` renders the H1; bodies start at `##`). **If the source has a hand-maintained changelog and the repo is open source on GitHub, offer to swap it for the `github-releases` source** (see "Changelogs" below) rather than porting the entries. For **Mintlify**, run the bundled codemod first — `node <skill>/scripts/mintlify-codemod.mjs --write <content-dir>` deterministically remaps icons and drops/renames unsupported frontmatter keys, and reports the rest (unknown icons, OpenAPI-stub flags) for you to finish by hand (see `references/mintlify.md`).
|
|
33
|
+
6. **Adopt `package.json`.** Repoint `dev`/`build`/`start` → `blume dev`/`blume build`/`blume preview`, remove the old framework's deps, add `blume`. A config-only source (e.g. a bare Mintlify `docs.json`) has no manifest — scaffold one. **In a pnpm workspace:** if `pnpm-workspace.yaml`/`.npmrc` sets `minimumReleaseAge`, add **only** `blume` to `minimumReleaseAgeExclude` (don't disable the guard) so the just-published version installs. **Always regenerate the lockfile in the same change:** after editing deps run a plain `pnpm install` (from the workspace root) and commit `pnpm-lock.yaml` alongside `package.json` — CI/Vercel use `--frozen-lockfile`, so a stale lockfile fails the build before it starts. **If the repo uses (or the user wants) [Ultracite](https://www.ultracite.ai) for formatting:** its oxfmt formatter mangles the `:::` directives you just wrote unless you ship the bundled `assets/oxfmt@0.55.0.patch` and register it under `patchedDependencies` — see `references/monorepo.md` §6. See `references/monorepo.md` §2–3.
|
|
34
|
+
7. **Wire up the host repo & deploy (non-trivial repos).** For a monorepo on Vercel, emit the root-aware install/build recipe and `apps/docs/vercel.json`, and tell the user the two settings you can't commit (Vercel Root Directory, Node 22). If the workspace pins Vite and `blume build` crashes inside Astro/Vite, apply the pnpm-patch workaround. All copy-pasteable in `references/monorepo.md` §4–5.
|
|
35
|
+
8. **Verify.** Run `blume build --strict` (frontmatter schema, duplicate routes, config — **without `--strict` a build exits 0 despite content errors**, silently dropping invalid pages) and `blume validate --strict` (internal links, heading anchors, assets — the link checker lives in `validate`, not `build`), fix diagnostics, then `blume dev` for a visual pass. End with a written summary of what was migrated, dropped, and approximated — **and every repo-specific edit you made** (pnpm-workspace, vercel.json, config globs) with the reason, plus any manual step left to the user (the Astro patch, Vercel dashboard settings).
|
|
36
|
+
|
|
37
|
+
## The Blume mental model
|
|
38
|
+
|
|
39
|
+
The single biggest shift for most sources — especially Mintlify — is that **navigation is derived from the filesystem**, not declared in config.
|
|
40
|
+
|
|
41
|
+
### Navigation is the file tree
|
|
42
|
+
|
|
43
|
+
- **Folders become groups, files become pages.** A page's sidebar label is its frontmatter `title`; a group's label is the humanized folder name.
|
|
44
|
+
- **Ordering resolves highest-priority-first:** an explicit `navigation.sidebar` (replaces the whole tree) → a folder's `meta.ts` `pages` array → a page's frontmatter `sidebar.order` → the filesystem (`index` first, then numeric filename prefix like `01-`, then alphabetical).
|
|
45
|
+
- **`meta.ts` refines one folder** (`defineMeta({ title, icon, order, collapsed, pages })`). The `pages` array lists children by slug (numeric prefix and parentheses stripped); children you omit fall back to their own `sidebar.order`, then filesystem order (`index` still sorts first) — so a partial `pages` list is safe, but list every child when the source declared a complete order.
|
|
46
|
+
- **Sidebar render mode is global, not per-folder.** `navigation.sidebar.display` in `blume.config.ts` is `"flat"` (default), `"group"` (collapsible), or `"page"` (drill-in sub-panel) and applies to **every** group at once. (It used to live on each folder's `meta.ts` as `display`; that field was **removed** — writing it in a `meta.ts` is now a build error. Set it once in config instead.) An explicit `navigation.sidebar` item may still override its own group's `display`.
|
|
47
|
+
- **An explicit `navigation.sidebar` replaces filesystem generation entirely.** Use it only for a nav shape files can't express. Its items are a page route string, a group (`{ label, items }`), or a link (`{ label, href }`).
|
|
48
|
+
- **Config-declared nesting has no on-disk counterpart — materialize it or it flattens silently.** When a source (Mintlify `groups`, Nextra `_meta`, a Docusaurus sidebar…) declares a nested group, its pages usually sit **flat in one folder** and the grouping lives only in config. Filesystem-derived nav sees the flat folder and drops the inner group. To keep the nesting you must **either** move those pages into a real subfolder (`meta.ts` for label/`collapsed`) — which changes their URLs, so add `redirects` — **or** declare the group in an explicit `navigation.sidebar`, which nests the existing routes without moving a file. Walk config `pages`/nav arrays **recursively** during inventory and record where config nesting depth exceeds on-disk depth; that gap is exactly what gets lost.
|
|
49
|
+
|
|
50
|
+
### Tabs and selectors
|
|
51
|
+
|
|
52
|
+
- **`navigation.tabs`** (`{ label, path, icon? }`) render top-of-header sections and **scope the sidebar by route** — the folder at a tab's `path` becomes the section, so this needs no config beyond the tabs themselves; structure content as **one folder per tab**. **A source's top-level tabs (Mintlify `navigation.tabs`, a top-level product/section switcher) map to these header tabs — keep them as tabs; don't flatten them into a single global `navigation.sidebar`.** Blume picks the active tab by **URL prefix** (longest tab `path` that prefixes the route), so every page in a tab must live under that tab's single `path`; a source tab that mixes arbitrary routes isn't portable as-is — either move its pages under one prefix (route change → add `redirects`) or accept the closest shape, and say which in the report (details in `references/mintlify.md`). The filtering runs both ways: on a route **under** a tab's `path`, the sidebar shows **only** that tab's folder (a tab also highlights when the current route is under it); on a **root or untabbed** route (or a tab whose `path` is `/`), the tab folders are **hidden** and the sidebar shows only the loose pages that belong to no tab (full tree as a fallback, so it's never blank). Consequence for migrations: once you add tabs, the landing sidebar automatically drops the sectioned content — that's intended, not lost pages; don't hand-build excludes for it.
|
|
53
|
+
- **`navigation.selectors`** (`{ kind, label, items: [{ label, path, icon?, description?, tag? }] }`, `kind` = `dropdown`/`product`/`version`/`language`) partition a whole site (products, versions) via a header dropdown keyed on the current route.
|
|
54
|
+
- **`navigation.featured`** (`{ label, href, icon? }`) pins links to the **top of the sidebar, above every section** — a blog, changelog, or support page that should always be one click away. These are the **exception to tab scoping**: unlike the generated tree, featured links show on **every** route and breakpoint. `href` points anywhere — an external URL opens in a new tab, an internal route (`/contact`) is validated against your pages at build time. `icon` is a Lucide name (or image path/URL/inline SVG), as everywhere else. This is the home for a source's always-visible header/utility links (Mintlify anchors, Blog/Contact links) — see `references/mintlify.md`.
|
|
55
|
+
|
|
56
|
+
### Routes and pathing
|
|
57
|
+
|
|
58
|
+
- A route is the content path relative to `content.root`, with **numeric prefixes stripped** (`01-intro.mdx` → `/intro`) and **`(group)/` folders adding no segment**. An `index` file maps to its folder's route. Frontmatter `slug` overrides the generated route.
|
|
59
|
+
|
|
60
|
+
### `blume.config.ts` shape
|
|
61
|
+
|
|
62
|
+
`defineConfig({...})` — every field optional, all with defaults:
|
|
63
|
+
|
|
64
|
+
- **Site:** `title`, `description`, `logo` (string SVG, or `{ image: string | { light, dark, alt }, text, href }`), `banner` (`{ content, link, dismissible, id }` — no color/type). A logo renders beside `title` in the header, so a **wordmark logo doubles the brand** ("Acme Acme") — set `text: ""` to render the mark alone. **Prefer the string form over `{ light, dark }`:** if you have the logo SVG locally and it's monochrome (solid black or white), rewrite its `fill`/`stroke` to `currentColor` and use `logo: "/logo.svg"` — it then inherits the theme's text color and adapts to light/dark automatically, so you don't need separate light/dark files.
|
|
65
|
+
- **`theme`:** `accent` (a color string for both modes, or `{ light, dark }` per mode), `action` (color), `mode` (`light`/`dark`/`system`), `radius`, `fonts` (`{ body, display, mono }` — curated Google-font slugs), `background` and `backgroundImage` (each a string, or `{ light, dark }` per mode). The old `accentDark`/`backgroundDark`/`backgroundImageDark` fields were **merged into these per-mode objects** — a bare string still applies to both modes, so only reach for `{ light, dark }` when the two modes differ. There is **no** `theme.strict` and **no** `theme.css` config field — custom CSS goes in a project-root **`theme.css` file** (auto-picked-up), and a source's "strict appearance" flags drop.
|
|
66
|
+
- **`content`:** `root` (default `"docs"`, relative to the project dir where `blume` runs), `include`/`exclude` (arrays of globs **relative to `content.root`**; defaults `["**/*.{md,mdx}"]` / `["**/_*", "**/.*"]`), `sources` (staged sources: `filesystem`, `github-releases`, `notion`, `sanity`, `mdx-remote`, `custom` — OpenAPI is **not** one of these; it's the top-level `openapi` field), `pages` (custom `.astro` dir), `defaultType`. When docs sit directly under the project dir (no `docs/` subfolder), set `root` there and **scope `include` to the real content folders** instead of scanning everything — `references/monorepo.md` §1.
|
|
67
|
+
- **`basePath`** (top-level): a site-wide mount point (e.g. `"/docs"`) prepended to **every** route while staying invisible to the sidebar (no wrapper group). This is the right target for a source that served all docs under a prefix (Docusaurus `routeBasePath`, a Fumadocs `baseUrl` of `/docs`) — distinct from a per-source `prefix` (which adds a nav group) and from `deployment.base` (host subdirectory).
|
|
68
|
+
- **`navigation`:** `tabs`, `selectors`, `featured` (links pinned above the sidebar on every route), `sidebar` (`{ display, items }` — `display` is the global render mode above; `items` is an explicit tree), `repo`. **Avoid an explicit `navigation.sidebar` unless you have to** — lean on the filesystem-derived sidebar. It only works when the file tree roughly matches the intended sidebar layout, so reshape folders to match first; reach for `sidebar.items` only for a shape files genuinely can't express (see "Config-declared nesting" above).
|
|
69
|
+
- **`search`** (Orama default, Pagefind opt-in), **`ai`** (llms.txt, Ask AI), **`mcp`**, **`openapi`**, **`redirects`**, **`seo`**, **`markdown`**, **`analytics`**, **`deployment`**, **`i18n`**, **`toc`**, **`lastModified`**, **`github`**.
|
|
70
|
+
- **Don't set `deployment.site`.** Blume auto-fills it: the dev server's `localhost` URL in dev, and the deployment URL (`VERCEL_PROJECT_PRODUCTION_URL`/`VERCEL_URL`) on Vercel. Hardcoding it in `blume.config.ts` overrides that auto-detection and pins the wrong absolute URL (canonical links, sitemap, OG, llms.txt) everywhere but the one host you typed — so leave it unset even when a source config had a `url`/`site` field. (Sitemap still generates in production because the deploy URL is present there.)
|
|
71
|
+
- **Favicon is a filename convention, not config.** Drop `icon`/`favicon.{svg,png,ico}` (and `apple-icon.png`) in the project root or `public/` — Blume auto-detects it. There is **no** `favicon` config field. A source favicon given as `{ light, dark }` **collapses to one** — pick a single file and report the loss.
|
|
72
|
+
|
|
73
|
+
The schema is exported from `blume/schema`; the full field reference is in `node_modules/blume/docs/configuration/`.
|
|
74
|
+
|
|
75
|
+
### Icons are Lucide, period
|
|
76
|
+
|
|
77
|
+
Blume resolves **bare kebab-case [Lucide](https://lucide.dev) names** everywhere an icon is accepted — frontmatter `icon`, `sidebar.icon`, `meta.ts` `icon`, `navigation.tabs`/`selectors` icons, and `Card`/`Step`/`Icon`/etc. props. There is **no** FontAwesome or Tabler support and **no** `iconType` prop. Names must be **kebab-case** (`book-open`, not `BookOpen`) — a PascalCase React-component name (common in Fumadocs/lucide-react sources) does not resolve and renders nothing. When migrating a source that uses another icon set (Mintlify defaults to FontAwesome), **map each name to its closest Lucide equivalent**; where none exists, drop the icon and report it. Verify a name exists at [lucide.dev/icons](https://lucide.dev/icons) before writing it.
|
|
78
|
+
|
|
79
|
+
### Page frontmatter (strict — unknown keys are build errors)
|
|
80
|
+
|
|
81
|
+
```yaml
|
|
82
|
+
---
|
|
83
|
+
title: Install # renders as the page H1 — remove any duplicate H1 in the body
|
|
84
|
+
description: Install Blume and scaffold your first project.
|
|
85
|
+
type: doc # doc (default) | blog | changelog | api
|
|
86
|
+
icon: download # a Lucide name
|
|
87
|
+
sidebar:
|
|
88
|
+
label: Install # overrides title in the sidebar
|
|
89
|
+
order: 2
|
|
90
|
+
icon: download
|
|
91
|
+
badge: New
|
|
92
|
+
hidden: false
|
|
93
|
+
seo:
|
|
94
|
+
title: …
|
|
95
|
+
description: …
|
|
96
|
+
image: /og/install.png
|
|
97
|
+
canonical: https://…
|
|
98
|
+
noindex: false
|
|
99
|
+
search:
|
|
100
|
+
exclude: false
|
|
101
|
+
tags: [api]
|
|
102
|
+
slug: install # override the generated route
|
|
103
|
+
draft: false
|
|
104
|
+
lastModified: 2026-06-20 # pin the "last updated" date
|
|
105
|
+
---
|
|
106
|
+
```
|
|
107
|
+
|
|
108
|
+
Also valid: `date`/`authors` (blog/changelog feeds), `changelog` (changelog metadata), `deprecated`, `hidden`, `noindex`.
|
|
109
|
+
|
|
110
|
+
### Authoring features (no imports needed in `.mdx`)
|
|
111
|
+
|
|
112
|
+
- **The rich features are MDX-only.** Directives, `package-install`, mermaid, and math are wired into the MDX processor; in a plain `.md` file a `:::note` stays **literal text** — and the build stays green. **Rename any `.md` file that uses (or should use) these to `.mdx` during migration.** This bites hardest on Docusaurus/Starlight sources, whose `.md` content is full of `:::` admonitions. Plain Markdown (headings, tables, fenced code with titles/highlighting) is fine in `.md`.
|
|
113
|
+
- **Callouts as directives:** `:::note`, `:::tip`, `:::warning`, `:::danger`, `:::info`, `:::success`, with an optional title in brackets: `:::warning[Heads up]`. Aliases `caution`→warning, `error`→danger, `important`→note, `warn`→warning.
|
|
114
|
+
- **No-import MDX components:** `Callout`, `Card`/`CardGroup`, `Columns`/`Column`, `Steps`/`Step`, `Tabs`/`Tab`, `Accordion`/`AccordionItem`, `Expandable`, `FileTree`, `Tree`/`Tree.Folder`/`Tree.File`, `CodeGroup`, `Frame`, `Panel`, `Tooltip`, `Tile`, `Badge`, `Icon`, `TypeTable`/`AutoTypeTable`, `Color`, `YouTube`, `Visibility`, `GithubInfo`, `Component`, `CodeBlock`, `Diff`, `Prompt`, `Math`. (**Not** shipped — convert away: `<Warning>` → the `:::warning` directive, and the `ParamField`/`ResponseField`/`RequestField` field family → `TypeTable` rows or the OpenAPI reference. See the reference files for targets.)
|
|
115
|
+
- **Fenced-code superpowers:** ` ```package-install ` → package-manager tabs; ` ```mermaid ` → a rendered diagram; code-block titles (` ```ts server.ts `), line numbers (`lineNumbers`), and highlighting (`{1,4-5}`, `// [!code ++]`).
|
|
116
|
+
- **Math:** block math `$$…$$` renders in `.mdx` with **no config** (there is no `markdown.math` field). Inline `$…$` is **not** supported — a bare `$` stays literal text; convert inline math to display math or drop it (report).
|
|
117
|
+
|
|
118
|
+
### OpenAPI
|
|
119
|
+
|
|
120
|
+
`openapi: { enabled: true, sources: [{ spec, label?, route? }] }` generates **one real page per operation** — with routing, sidebar, search, and OG images for free. **The reference does not get a header tab automatically** — add a `navigation.tabs` entry pointing at the reference's `route` (reference routes are valid tab targets) or the API reference is unreachable from the header. **Never hand-migrate generated API-reference pages** (per-endpoint stub pages in the source): delete them and point `openapi.sources` at the spec. (`renderer: "scalar"` keeps the Scalar embed instead; AsyncAPI uses the same embed.)
|
|
121
|
+
|
|
122
|
+
- **Vendor the spec by default.** A remote `spec:` URL makes every build depend on fetching it at build time — a single point of failure in CI, offline, or behind a proxy, and a failed fetch skips the whole reference. Prefer committing the spec into the repo (`openapi/<name>.json`) and pointing `spec` at the local path; if you keep the URL, say so and consider a `prebuild` step that refreshes the local copy with a fallback.
|
|
123
|
+
- **Operation routes have their own slug scheme** — `<route>/<slugified-tag>/<slugified-operationId>` (e.g. tag `Models`, id `listModels` → `/api-reference/models/listmodels`). This rarely matches the source's endpoint links (Mintlify/others kebab-case differently), so **rewrite every inbound link to an operation**. `blume validate` resolves operation pages like any other route, so it catches the ones you miss.
|
|
124
|
+
- **Keep hand-written conceptual pages.** Sources often pair a written "Introduction/Authentication" page with the endpoint group in the same tab. A normal content page placed under the openapi `route` merges into the reference tab's sidebar — so keep those (auth, errors, rate limits) and delete only the per-endpoint stubs.
|
|
125
|
+
|
|
126
|
+
### Changelogs
|
|
127
|
+
|
|
128
|
+
If the source ships a **hand-maintained changelog** (a `changelog.mdx`, a folder of dated entries, Mintlify `<Update>` blocks) **and the project is open source on GitHub**, offer to replace it with the **`github-releases`** content source — release notes become the changelog automatically, with no files to maintain. It's an offer, not an automatic rewrite: some teams keep a curated changelog that doesn't map 1:1 to GitHub releases, so confirm the release notes are the source of truth before deleting their pages.
|
|
129
|
+
|
|
130
|
+
Add it under `content.sources` alongside the filesystem source:
|
|
131
|
+
|
|
132
|
+
```ts
|
|
133
|
+
content: {
|
|
134
|
+
sources: [
|
|
135
|
+
{ include: ["docs/**/*.mdx"], root: ".", type: "filesystem" },
|
|
136
|
+
{
|
|
137
|
+
owner: "haydenbleasel",
|
|
138
|
+
repo: "ultracite",
|
|
139
|
+
prefix: "changelog",
|
|
140
|
+
type: "github-releases",
|
|
141
|
+
},
|
|
142
|
+
],
|
|
143
|
+
},
|
|
144
|
+
```
|
|
145
|
+
|
|
146
|
+
- Each release materializes as a `type: changelog` page under `/<prefix>/` (`prefix: "changelog"` → `/changelog/…`); omit `prefix` to mount at the root.
|
|
147
|
+
- Optional fields: `limit` (cap materialized releases, newest-first, default 100), `prereleases` (include prereleases), `drafts` (include drafts — needs a token with repo write access), `pollInterval` (dev polling seconds; omit to freeze for the session).
|
|
148
|
+
- A **private** repo reads a token from `GITHUB_TOKEN`; it is never inlined in config. A public repo needs no token.
|
|
149
|
+
- **Delete the old changelog pages** once the source is wired (and add `redirects` from their old routes to the new `/<prefix>/…` slugs). Pin a header/sidebar link with `navigation.featured` if the source had one.
|
|
150
|
+
|
|
151
|
+
### Redirects are static
|
|
152
|
+
|
|
153
|
+
A `redirects: [{ from, to, status? }]` array **in `blume.config.ts`** maps old URLs when you restructure routes — Blume serves these itself, so any reorganization that moves a page (folder-per-tab, materialized nested groups, renamed slugs, index promotion) is fixed by adding an entry there; no host config needed. **Restructuring is the main source of these:** every page you moved in step 4 (folder-per-tab, renamed slugs, index promotion) needs an entry, or old URLs 404. `status` defaults to **301 (permanent — browsers cache it indefinitely)**; that's correct for genuine moves, but never use 301/308 for redirects you might reverse. Dynamic/wildcard patterns (`:slug*`) can't be modeled as static path-to-path; move those to host-level config (`_redirects`, `vercel.json`) and report them.
|
|
154
|
+
|
|
155
|
+
## Verification & reporting
|
|
156
|
+
|
|
157
|
+
1. Run **`blume build --strict`** — it validates the frontmatter schema, duplicate routes, and config, and `--strict` makes diagnostics fail the build (without it, `blume build` **exits 0 despite content errors** and silently drops invalid pages). Then run **`blume validate --strict`** — links, heading anchors, and assets live here, not in `build` (add `--external` to also check outbound HTTP links). OpenAPI operation pages are real routes to `validate`, so dead links to them are caught too. Iterate until both are clean.
|
|
158
|
+
2. Run `blume dev` and review the site visually — nav structure, tabs, theme, rendered components.
|
|
159
|
+
3. **Write a migration summary** covering: what was migrated (config, N pages, nav, OpenAPI), what was **dropped** (navbar CTAs, footers, custom theming, dynamic redirects, unmappable icons, unsupported components), and suggested follow-ups (`blume eject` for full control, `blume add` to vendor a component for customization).
|
|
160
|
+
|
|
161
|
+
## Full documentation
|
|
162
|
+
|
|
163
|
+
The mapping details live in `references/`: one file per source framework (`mintlify.md`, `docusaurus.md`, `fumadocs.md`, `nextra.md`, `starlight.md`), plus **`monorepo.md`** for host-repo integration (content-layout detection, pnpm `minimumReleaseAge`, frozen-lockfile regeneration, the Vercel monorepo recipe, and the Astro/Vite patch). The Mintlify icon + frontmatter pass is automated by **`scripts/mintlify-codemod.mjs`** (zero-dependency, deterministic, idempotent; `--write` to apply). The authoritative Blume docs are bundled in the installed package at **`node_modules/blume/docs`** (or `apps/docs/content/docs` in a repo checkout). The most relevant pages:
|
|
164
|
+
|
|
165
|
+
- `configuration/index.mdx` — every `blume.config.ts` field.
|
|
166
|
+
- `content/navigation.mdx` — the sidebar/tabs/selectors model.
|
|
167
|
+
- `content/meta.mdx` — `meta.ts` and display modes.
|
|
168
|
+
- `content/syntax.mdx` — directives, code features, math.
|
|
169
|
+
- `content/components.mdx` — the component library and APIs.
|
|
170
|
+
- `reference/frontmatter.mdx` — the strict page schema.
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
diff --git a/dist/markdown-Bowe09rB.js b/dist/markdown-Bowe09rB.js
|
|
2
|
+
index 0fe63ff712e07c9c2188711fa0940f7a7d8f7d74..44435d91a2f5a6711512981c9bcaddedc1760be4 100644
|
|
3
|
+
--- a/dist/markdown-Bowe09rB.js
|
|
4
|
+
+++ b/dist/markdown-Bowe09rB.js
|
|
5
|
+
@@ -1141,7 +1141,14 @@ function Yf(e, r, t) {
|
|
6
|
+
case "sentence": return Yi(e, t);
|
|
7
|
+
case "word": return Li(e);
|
|
8
|
+
case "whitespace": {
|
|
9
|
+
- let { next: i } = e, u = i && /^>|^(?:[*+-]|#{1,6}|\d+[).])$/u.test(i.value) ? "never" : r.proseWrap;
|
|
10
|
+
+ let { next: i, previous: oxfmtFencePrev } = e;
|
|
11
|
+
+ // Preserve line breaks that sit directly against a `:::` container
|
|
12
|
+
+ // directive fence, so `proseWrap: "never"` keeps the opening/closing
|
|
13
|
+
+ // fence on their own lines instead of joining them into the prose (which
|
|
14
|
+
+ // breaks the directive). Ordinary prose still wraps per proseWrap.
|
|
15
|
+
+ // See prettier/prettier#19040.
|
|
16
|
+
+ let oxfmtIsFence = (w) => w != null && typeof w.value === "string" && w.value.startsWith(":::");
|
|
17
|
+
+ let u = oxfmtIsFence(oxfmtFencePrev) || oxfmtIsFence(i) ? "preserve" : i && /^>|^(?:[*+-]|#{1,6}|\d+[).])$/u.test(i.value) ? "never" : r.proseWrap;
|
|
18
|
+
return qt(e, n.value, u);
|
|
19
|
+
}
|
|
20
|
+
case "emphasis": {
|