mirror of
https://github.com/andwati/zitadel.git
synced 2026-11-13 01:25:11 +00:00
docs: migrate to native Fumadocs search & UI fixes (#12732)
Changes: - **Search**: Replaced Inkeep with Fumadocs' native built-in search (createFromSource). Removed @inkeep/cxkit-react and custom search dialogs. - **Hydration Fix**: Removed markdown links from ### headings in egress.mdx (across all versions) to fix the <a inside a> DOM mismatch error. - **Console Fix**: Added the missing key prop to <VersionSelector/> in the layout to resolve the React list warning. --------- Co-authored-by: Florian Forster <[email protected]> Co-authored-by: Claude Fable 5.1 <[email protected]>
This commit is contained in:
co-authored by
Florian Forster
Claude Fable 5.1
parent
7e34f04361
commit
8ccd5b206f
@@ -1,7 +1,32 @@
|
||||
import { source } from '@/lib/source';
|
||||
import { createFromSource } from 'fumadocs-core/search/server';
|
||||
import { getBreadcrumbItems } from 'fumadocs-core/breadcrumb';
|
||||
import { createSearchAPI } from 'fumadocs-core/search/server';
|
||||
import { source, versionSource } from '@/lib/source';
|
||||
import { getVersionFromUrl, LATEST_VERSION } from '@/lib/versions';
|
||||
|
||||
export const { GET } = createFromSource(source, {
|
||||
// Both loaders share one index. Every entry is tagged with its docs version so the
|
||||
// client can scope results to the version being viewed (see app/providers.tsx).
|
||||
function indexPages(loader: typeof source | typeof versionSource, getTag: (url: string) => string) {
|
||||
const tree = loader.getPageTree();
|
||||
|
||||
return loader.getPages().map((page) => ({
|
||||
id: page.url,
|
||||
url: page.url,
|
||||
title: page.data.title,
|
||||
description: page.data.description,
|
||||
structuredData: page.data.structuredData,
|
||||
// Sidebar path (e.g. "Deploy & Operate › Self-Hosted"), shown with each result.
|
||||
breadcrumbs: getBreadcrumbItems(page.url, tree)
|
||||
.map((item) => item.name)
|
||||
.filter((name): name is string => typeof name === 'string'),
|
||||
tag: getTag(page.url),
|
||||
}));
|
||||
}
|
||||
|
||||
export const { GET } = createSearchAPI('advanced', {
|
||||
// https://docs.orama.com/docs/orama-js/supported-languages
|
||||
language: 'english',
|
||||
indexes: [
|
||||
...indexPages(source, () => LATEST_VERSION),
|
||||
...indexPages(versionSource, getVersionFromUrl),
|
||||
],
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user