mirror of
https://github.com/andwati/zitadel.git
synced 2026-11-26 22:38:45 +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
@@ -0,0 +1,20 @@
|
||||
/**
|
||||
* Versioned docs are downloaded into `content/v{major}.{minor}/` by
|
||||
* `scripts/fetch-remote-content.mjs` and served under `/docs/v{major}.{minor}/...`.
|
||||
* The search index tags every page with its version so results can be scoped to
|
||||
* the version currently being viewed.
|
||||
*/
|
||||
export const LATEST_VERSION = 'latest';
|
||||
|
||||
const VERSION_SEGMENT = /^v\d+\.\d+$/;
|
||||
|
||||
/** `['v4.17', 'guides', ...]` -> `'v4.17'`; anything else -> `'latest'`. */
|
||||
export function getVersionFromSlug(slug: string[] | undefined): string {
|
||||
const first = slug?.[0];
|
||||
return first && VERSION_SEGMENT.test(first) ? first : LATEST_VERSION;
|
||||
}
|
||||
|
||||
/** `/v4.17/guides/...` -> `'v4.17'`; `/guides/...` -> `'latest'`. */
|
||||
export function getVersionFromUrl(url: string): string {
|
||||
return getVersionFromSlug(url.split('/').filter(Boolean));
|
||||
}
|
||||
Reference in New Issue
Block a user