Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 4 additions & 5 deletions apps/docs/src/app/api/search/route.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,24 +2,23 @@ import { createMixedbreadSearchAPI } from 'fumadocs-core/search/mixedbread';
import Mixedbread from '@mixedbread/sdk';
import { SortedResult } from 'fumadocs-core/search';

/** Derive breadcrumbs from URL path segments (e.g. /console/concepts → ['Console']) */
/** Derive breadcrumbs from URL path segments (e.g. /docs/console/concepts → ['Docs', 'Console']) */
function getBreadcrumbsFromUrl(url: string): string[] {
const path = url.replace(/#.*$/, '').trim().replace(/\/$/, '') || '/';
const segments = path.split('/').filter(Boolean);
if (segments.length === 0) return ['Docs'];
if (segments.length === 0) return [];
// Strip version prefix (e.g. v6)
const normalized = segments[0] === 'v6' ? segments.slice(1) : segments;
if (normalized.length === 0) return ['Docs'];
if (normalized.length === 0) return [];
// Ancestors only (exclude last = current page), or full path for section roots
const breadcrumbSegments =
normalized.length > 1 ? normalized.slice(0, -1) : normalized;
const formatted = breadcrumbSegments.map((s) =>
return breadcrumbSegments.map((s) =>
s
.split(/[-_]/)
.map((w) => w.charAt(0).toUpperCase() + w.slice(1).toLowerCase())
.join(' ')
);
return ['Docs', ...formatted];
}

function slugger(value: string): string {
Expand Down
2 changes: 1 addition & 1 deletion apps/docs/vercel.json
Original file line number Diff line number Diff line change
Expand Up @@ -311,4 +311,4 @@
{ "source": "/postgres/database", "destination": "/docs/postgres/database/caching", "permanent": true },
{ "source": "/showcase", "destination": "/docs", "permanent": true }
]
}
}
Loading