chore: updated for proper path
94ec5161
3 file(s) · +7 −2
| 99 | 99 | className="border-b pb-6 mb-6 last:border-b-0" |
|
| 100 | 100 | > |
|
| 101 | 101 | <a |
|
| 102 | - | href={`/now/${path}`} |
|
| 102 | + | href={`/${path}`} |
|
| 103 | 103 | className="block hover:opacity-80 transition-opacity" |
|
| 104 | 104 | > |
|
| 105 | 105 | <h3 className="text-lg font-semibold mb-3">{value.title}</h3> |
| 49 | 49 | const normalizedPath = docPath.startsWith("/") |
|
| 50 | 50 | ? docPath.slice(1) |
|
| 51 | 51 | : docPath; |
|
| 52 | - | return normalizedPath === slug; |
|
| 52 | + | // Match against the full path including /now/ |
|
| 53 | + | return normalizedPath === `now/${slug}`; |
|
| 53 | 54 | } |
|
| 54 | 55 | return false; |
|
| 55 | 56 | }); |
| 107 | 107 | if (!normalizedPath.startsWith("/")) { |
|
| 108 | 108 | normalizedPath = `/${normalizedPath}`; |
|
| 109 | 109 | } |
|
| 110 | + | // Ensure path starts with /now/ |
|
| 111 | + | if (!normalizedPath.startsWith("/now/")) { |
|
| 112 | + | normalizedPath = `/now${normalizedPath}`; |
|
| 113 | + | } |
|
| 110 | 114 | // Basic validation: no spaces, no special chars except dashes and underscores |
|
| 111 | 115 | if (!/^\/[a-zA-Z0-9\-_\/]*$/.test(normalizedPath)) { |
|
| 112 | 116 | return c.json( |