index.mdx files are served at the parent directory path
(relativePath: string)
| 162 | |
| 163 | /** index.mdx files are served at the parent directory path */ |
| 164 | private generateDocumentUrl(relativePath: string): string { |
| 165 | let urlPath = relativePath.replace(/\.mdx$/, '').replace(/\\/g, '/') |
| 166 | |
| 167 | if (urlPath.endsWith('/index')) { |
| 168 | urlPath = urlPath.slice(0, -6) |
| 169 | } else if (urlPath === 'index') { |
| 170 | urlPath = '' |
| 171 | } |
| 172 | |
| 173 | return `${this.baseUrl}/${urlPath}` |
| 174 | } |
| 175 | |
| 176 | private findRelevantHeader(headers: HeaderInfo[], position: number): HeaderInfo | null { |
| 177 | if (headers.length === 0) return null |