@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 CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@marlinjai/clearify",
3
- "version": "1.14.0",
3
+ "version": "1.14.1",
4
4
  "description": "An open-source documentation site generator. Turn markdown into beautiful docs.",
5
5
  "type": "module",
6
6
  "bin": {
@@ -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: { title?: string } }): string {
45
- if (route.frontmatter.title) return route.frontmatter.title;
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';