@marlinjai/clearify 1.14.0 → 1.14.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/src/theme/NotFound.tsx +3 -3
package/package.json
CHANGED
package/src/theme/NotFound.tsx
CHANGED
|
@@ -23,7 +23,7 @@ function findSimilarRoutes(currentPath: string, maxResults = 5) {
|
|
|
23
23
|
const normalizedCurrent = currentPath.toLowerCase().replace(/\/+$/, '') || '/';
|
|
24
24
|
|
|
25
25
|
const scored = routes
|
|
26
|
-
.filter((r) => r.path !== normalizedCurrent)
|
|
26
|
+
.filter((r) => r.path !== normalizedCurrent && !r.redirectTo)
|
|
27
27
|
.map((r) => {
|
|
28
28
|
const normalizedRoute = r.path.toLowerCase().replace(/\/+$/, '') || '/';
|
|
29
29
|
const distance = levenshtein(normalizedCurrent, normalizedRoute);
|
|
@@ -41,8 +41,8 @@ function findSimilarRoutes(currentPath: string, maxResults = 5) {
|
|
|
41
41
|
return scored;
|
|
42
42
|
}
|
|
43
43
|
|
|
44
|
-
function formatTitle(route: { path: string; frontmatter
|
|
45
|
-
if (route.frontmatter
|
|
44
|
+
function formatTitle(route: { path: string; frontmatter?: { title?: string } }): string {
|
|
45
|
+
if (route.frontmatter?.title) return route.frontmatter.title;
|
|
46
46
|
// Derive a title from the path
|
|
47
47
|
const segments = route.path.split('/').filter(Boolean);
|
|
48
48
|
if (segments.length === 0) return 'Home';
|