The docs feature provides users with a way to organize Markdown files in a hierarchical format.
Every document has a unique
id. By default, a document
id is the name of the document (without the extension) relative to the root docs directory.
greeting.md id is
guide/hello.md id is
However, the last part of the
id can be defined by user in the front matter. For example, if
guide/hello.md's content is defined as below, its final
If you want more control over the last part of the document URL, it is possible to add a
slug (defaults to the
It is possible to use:
- absolute slugs:
- relative slugs:
If you want a document to be available at the root, and have a path like
https://docusaurus.io/docs/, you can use the slug frontmatter:
If you only want the documentation feature, you can run your Docusaurus 2 site without a landing page and display your documentation page as the index page instead.
To enable docs-only mode, set the docs plugin
routeBasePath: '/', and use the frontmatter
slug: / on the document that should be the index page (more infos).
You should delete the existing homepage at
./src/pages/index.js, or else there will be two files mapping to the same route!
There's also a "blog-only mode" for those who only want to use the blog feature of Docusaurus 2. You can use the same method detailed above. Follow the setup instructions on Blog-only mode.