github fuma-nama/fumadocs @fumadocs/cli@1.7.4

latest releases: fumadocs-openapi@12.4.1, fumadocs-typescript@5.5.0, fumadocs-twoslash@4.0.2...
4 hours ago

Search hooks for each provider

fumadocs-core/search/client exports a hook for each search client, like useFetchSearch(). They return the props of <SearchDialog />:

const search = useFetchSearch({ locale });

<SearchDialog {...search} {...props}>
  <SearchDialogList />
</SearchDialog>;

data is the last successful search, its items have their content parsed into hastContent. error is set when the last search failed.

  • experimental_useSearch() creates a search hook from a memoized search function.
  • useDocsSearch() is deprecated.
  • useFlexsearchStatic() and useOramaCloudLegacySearch() are exported from the paths of their clients.
  • <SearchDialogList /> shows defaultItems without results.
  • useSearchList() is removed, useSearch() returns getActive(), setActive() and subscribeActive() for the active item.
  • <SearchDialogListItem /> renders a div instead of a button, table rows render their cells only.
  • renderMarkdown of <SearchDialogListItem /> renders content instead of hastContent. Without it, the string content of custom items is shown as text.
  • The templates of Fumadocs CLI and Create Fumadocs App use the new hooks.

Sync Mixedbread stores with sync()

  • sync() and toDocuments() from fumadocs-core/search/mixedbread upload a file for each page, whose chunks are its title, headings and paragraphs. Results link to their headings and render tables like other search integrations.
  • Stores synced with mxbai store sync need a re-sync, the frontmatter of pages is no longer read.
  • Tag filters match the tags of pages, locale filters results by language, and the limit of requests can only lower topK.
  • The Mixedbread template of Fumadocs CLI syncs a pre-rendered static.json with sync(), debounces searches by 300 ms, and reads the API key from MXBAI_API_KEY.

Don't miss a new fumadocs release

NewReleases is sending notifications on new releases.