blume 0.5.4 → 0.6.0
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 +380 -157
- package/dist/cli/index.js.map +23 -22
- 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 +328 -39
- package/dist/types/core/types.d.ts +8 -0
- package/docs/configuration/ai.mdx +56 -0
- 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/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 +4 -0
- package/src/astro/templates.ts +24 -5
- package/src/cli/commands/build.ts +15 -0
- 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/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 +48 -2
- 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 +124 -9
- 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/robots.ts +37 -4
- package/src/openapi/scalar.ts +1 -1
- package/src/search/documents.ts +9 -2
- package/src/theme/palette.ts +21 -14
package/src/search/documents.ts
CHANGED
|
@@ -114,10 +114,15 @@ const buildCrumbIndex = (sidebar: NavNode[]): Map<string, Crumbs> => {
|
|
|
114
114
|
* Pass `includeWhenDisabled` to index pages on their content merits even when
|
|
115
115
|
* the search provider is `none` — used by the MCP server, which is a separate
|
|
116
116
|
* feature from on-page search.
|
|
117
|
+
*
|
|
118
|
+
* `content` selects the extraction: `"plain"` (default) strips Markdown to bare
|
|
119
|
+
* searchable text; `"markdown"` keeps the body's Markdown — code blocks, lists,
|
|
120
|
+
* headings — for Ask AI grounding, where fenced examples are often the answer
|
|
121
|
+
* and stripping them makes the model unable to cite content the docs do contain.
|
|
117
122
|
*/
|
|
118
123
|
export const buildSearchDocuments = async (
|
|
119
124
|
project: BlumeProject,
|
|
120
|
-
options?: { includeWhenDisabled?: boolean }
|
|
125
|
+
options?: { includeWhenDisabled?: boolean; content?: "markdown" | "plain" }
|
|
121
126
|
): Promise<SearchDocument[]> => {
|
|
122
127
|
const pageById = new Map(project.graph.pages.map((page) => [page.id, page]));
|
|
123
128
|
|
|
@@ -148,7 +153,9 @@ export const buildSearchDocuments = async (
|
|
|
148
153
|
indexable.map(async (route) => {
|
|
149
154
|
const page = pageById.get(route.id);
|
|
150
155
|
const raw = page ? await readEntryText(project, page) : "";
|
|
151
|
-
const
|
|
156
|
+
const source = raw ? matter(raw).content : "";
|
|
157
|
+
const body =
|
|
158
|
+
options?.content === "markdown" ? source.trim() : toPlainText(source);
|
|
152
159
|
const tags = page?.meta?.search?.tags;
|
|
153
160
|
const crumb = crumbs.get(route.path);
|
|
154
161
|
return {
|
package/src/theme/palette.ts
CHANGED
|
@@ -67,10 +67,12 @@ const themeRootCss = (
|
|
|
67
67
|
"--blume-action-foreground",
|
|
68
68
|
options.action ? "oklch(1 0 0)" : null
|
|
69
69
|
),
|
|
70
|
-
...cssToken("--blume-background", safeColorOrNull(theme.background)),
|
|
70
|
+
...cssToken("--blume-background", safeColorOrNull(theme.background?.light)),
|
|
71
71
|
...cssToken(
|
|
72
72
|
"--blume-background-image",
|
|
73
|
-
theme.backgroundImage
|
|
73
|
+
theme.backgroundImage?.light
|
|
74
|
+
? backgroundImageCss(theme.backgroundImage.light)
|
|
75
|
+
: null
|
|
74
76
|
),
|
|
75
77
|
` --blume-radius: ${options.radius};`,
|
|
76
78
|
]
|
|
@@ -96,11 +98,11 @@ const themeDarkCss = (
|
|
|
96
98
|
"--blume-action-foreground",
|
|
97
99
|
options.action ? "oklch(1 0 0)" : null
|
|
98
100
|
),
|
|
99
|
-
...cssToken("--blume-background", safeColorOrNull(theme.
|
|
101
|
+
...cssToken("--blume-background", safeColorOrNull(theme.background?.dark)),
|
|
100
102
|
...cssToken(
|
|
101
103
|
"--blume-background-image",
|
|
102
|
-
theme.
|
|
103
|
-
? backgroundImageCss(theme.
|
|
104
|
+
theme.backgroundImage?.dark
|
|
105
|
+
? backgroundImageCss(theme.backgroundImage.dark)
|
|
104
106
|
: null
|
|
105
107
|
),
|
|
106
108
|
].filter(Boolean);
|
|
@@ -111,12 +113,18 @@ ${tokens.join("\n")}
|
|
|
111
113
|
};
|
|
112
114
|
|
|
113
115
|
/**
|
|
114
|
-
* Resolve the configured accent to
|
|
115
|
-
* preset; any other value is treated as a raw CSS color so
|
|
116
|
-
* arbitrary colors without a config change.
|
|
116
|
+
* Resolve the configured accent to per-mode CSS colors. A named accent
|
|
117
|
+
* resolves to its preset; any other value is treated as a raw CSS color so
|
|
118
|
+
* users can pass arbitrary colors without a config change. A string accent
|
|
119
|
+
* has already been normalized by the config schema to the same color for
|
|
120
|
+
* both modes.
|
|
117
121
|
*/
|
|
118
|
-
export const resolveAccent = (
|
|
119
|
-
|
|
122
|
+
export const resolveAccent = (
|
|
123
|
+
theme: ResolvedConfig["theme"]
|
|
124
|
+
): { dark: string; light: string } => ({
|
|
125
|
+
dark: presetOrColor(theme.accent.dark),
|
|
126
|
+
light: presetOrColor(theme.accent.light),
|
|
127
|
+
});
|
|
120
128
|
|
|
121
129
|
/** Resolve the configured radius preset to a CSS length. */
|
|
122
130
|
export const resolveRadius = (theme: ResolvedConfig["theme"]): string =>
|
|
@@ -128,17 +136,16 @@ export const resolveRadius = (theme: ResolvedConfig["theme"]): string =>
|
|
|
128
136
|
* arbitrary colors without a config change.
|
|
129
137
|
*/
|
|
130
138
|
export const buildThemeCss = (theme: ResolvedConfig["theme"]): string => {
|
|
131
|
-
const accent =
|
|
132
|
-
const accentDark = theme.accentDark ? presetOrColor(theme.accentDark) : null;
|
|
139
|
+
const accent = resolveAccent(theme);
|
|
133
140
|
const action = theme.action ? presetOrColor(theme.action) : null;
|
|
134
141
|
const radius = RADII[theme.radius];
|
|
135
142
|
const root = themeRootCss(theme, {
|
|
136
|
-
accent,
|
|
143
|
+
accent: accent.light,
|
|
137
144
|
action,
|
|
138
145
|
radius,
|
|
139
146
|
});
|
|
140
147
|
const dark = themeDarkCss(theme, {
|
|
141
|
-
accent:
|
|
148
|
+
accent: accent.dark,
|
|
142
149
|
action,
|
|
143
150
|
});
|
|
144
151
|
|