(basePath)
| 59 | } |
| 60 | |
| 61 | function routeExists(basePath) { |
| 62 | const candidates = [ |
| 63 | basePath + '.mdx', |
| 64 | basePath + '.en.mdx', |
| 65 | basePath + '.md', |
| 66 | path.join(basePath, 'index.mdx'), |
| 67 | path.join(basePath, 'index.en.mdx'), |
| 68 | path.join(basePath, 'index.md') |
| 69 | ]; |
| 70 | return candidates.some(fileExists); |
| 71 | } |
| 72 | |
| 73 | function isExternal(url) { |
| 74 | return /^(https?:|mailto:|tel:|data:|ftp:|ws:|wss:)/i.test(url) || url.startsWith('#'); |