Skip to content

Commit 38fe742

Browse files
lennessyyclaude
andcommitted
fix: resolve index pages to parent path for .md URLs
encyclopedia/index.mdx now outputs encyclopedia.md instead of encyclopedia/index.md, matching how Docusaurus routes index pages. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent 9de4f89 commit 38fe742

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

plugins/markdown-pages/index.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,8 @@ module.exports = function markdownPagesPlugin(context, options = {}) {
2525
const withoutExt = rel.replace(/\.(md|mdx)$/i, '');
2626
const id = frontmatter.id || path.basename(withoutExt);
2727
const dir = path.dirname(withoutExt);
28-
if (dir === '.') return id;
28+
if (dir === '.') return id === 'index' ? 'index' : id;
29+
if (id === 'index') return dir;
2930
return `${dir}/${id}`;
3031
}
3132

0 commit comments

Comments
 (0)