Skip to content

[v2] Support index.md filenames / IDs #2537

@aeneasr

Description

@aeneasr

🚀 Feature

Docusaurus v1 had a feature where creating an index.md file would generate an index.html file at the same, relative, directory path:

+ docs
   + getting-started
      + index.md (id: index)

generates

+ docs
   + getting-started
      + index.html

In v2, creating - using the docs plugin - an index.md file results in a structure of index/index.html.

+ docs
   + getting-started
      + index.md (id: index)

generates

+ docs
   + getting-started
      + index
        + index.html

This requires calling http://foo.bar/docs/getting-started/index or even http://foo.bar/docs/getting-started/index.html which is probably not intentional.

Have you read the Contributing Guidelines on issues?

yes

Motivation

Directory structure is important for SEO. Additionally, the index behavior is weird and (I think) unintentional as one ends up with urls like: http://foo.bar/docs/getting-started/index or http://foo.bar/docs/getting-started/index.html.

Pitch

I think Docusaurus v1 solved this correctly and this should be ported into v2 as well!

Metadata

Metadata

Assignees

No one assigned

    Labels

    difficulty: intermediateIssues that are medium difficulty level, e.g. moderate refactoring with a clear test plan.featureThis is not a bug or issue with Docusausus, per se. It is a feature request for the future.mlhMajor League Hacking Fellowship

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions