diff --git a/apps/docs/blume.config.ts b/apps/docs/blume.config.ts index 86c516b..b19d0a4 100644 --- a/apps/docs/blume.config.ts +++ b/apps/docs/blume.config.ts @@ -66,7 +66,7 @@ export default defineConfig({ theme: { accent: "teal", radius: "md", mode: "system" }, search: { provider: "orama", - // Keep Cmd+K empty-state in sync with custom Search + 404. + // Cmd+K empty-state + shared with 404 via CURATED_POPULAR. popular: CURATED_POPULAR.map(({ route, label }) => ({ href: route, label, diff --git a/apps/docs/components.ts b/apps/docs/components.ts index c8434c3..740148a 100644 --- a/apps/docs/components.ts +++ b/apps/docs/components.ts @@ -1,7 +1,6 @@ import { defineComponents } from "blume"; import Pagination from "./components/blume/Pagination.astro"; -import Search from "./components/blume/Search.astro"; import RecipeCodeBlock from "./components/RecipeCodeBlock.astro"; export default defineComponents({ @@ -16,6 +15,5 @@ export default defineComponents({ // Use the theme radius token (rounded-blume) instead of the built-in pills // (rounded-full) — softer corners that match the table/install cards. Pagination, - Search, }, }); diff --git a/apps/docs/components/blume/Search.astro b/apps/docs/components/blume/Search.astro deleted file mode 100644 index c44b67a..0000000 --- a/apps/docs/components/blume/Search.astro +++ /dev/null @@ -1,712 +0,0 @@ ---- -import { EN_UI } from "blume/core/i18n-ui.ts"; -import type { UIStrings } from "blume/core/i18n-ui.ts"; -import Icon from "blume/components/Icon.astro"; -import { CURATED_POPULAR } from "../curated-popular.ts"; - -// The provider-specific loader is generated per project into `blume:search-client` -// (an alias to `.blume/src/generated/search-client.ts`), so this component is -// provider-agnostic: it lazy-imports that module on first open and uses the -// `SearchFn` it returns. Only the configured provider's SDK is bundled. - -interface Props { - askEnabled?: boolean; - strings?: UIStrings["search"]; - /** Active locale to filter results to; omitted disables locale filtering. */ - locale?: string; -} - -const { askEnabled = false, strings, locale } = Astro.props; -// Merge over the English baseline per key (rather than `strings ?? …`) so a -// partial — or empty `{}` — strings object still resolves every label to a -// default, matching the pattern PageActions uses for its own dictionary. -const s = { ...EN_UI.search, popular: "Start here", ...strings }; - -// Curated empty-state links — not the first six sidebar entries. -const popular = CURATED_POPULAR.map(({ route, label }) => ({ route, label })); - -const kbd = "rounded border border-border bg-muted px-1 py-0.5 font-mono"; ---- - - - - - -
- - - Esc -
-
-
- -
-
- -
- -
-
- { - locale ? ( - - ) : ( - - ) - } -
- - - - {s.navigate} - - - - {s.open} - - - ⌘J - {s.preview} - -
-
-
- - -
diff --git a/apps/docs/components/curated-popular.ts b/apps/docs/components/curated-popular.ts index 54ad68a..95a5f11 100644 --- a/apps/docs/components/curated-popular.ts +++ b/apps/docs/components/curated-popular.ts @@ -1,4 +1,4 @@ -/** Site-wide Cmd+K / 404 destinations — not derived from sidebar order. */ +/** Shared Cmd+K (`search.popular`) + 404 destinations — not sidebar order. */ export const CURATED_POPULAR = [ { route: "/guides/getting-started", label: "Getting started" }, { route: "/guides/install", label: "Install" },