If you'd prefer to show the Docusaurus docs section as a homepage instead of the regular landing page, you can use the snippet below.
Official solution: configure the docs plugin
Follow these 3 steps:
1. Set a document with a slug /
Create the markdown file you want as homepage inside
/docs/ and set the slug to
--- id: my-home-doc slug: / --- My home doc content....
2. Set the docs plugin to /
3. Delete the single.js file
Find the following file and delete it:
Check out the documentation for Docs-only mode.
Hack: use a redirect
The initial version of this post I pointed out that you could replace the file contents of
src/pages/index.js with this:
While this works it's an unnecessary redirect given the out of the box solution described above.
This was tested on Docusaurus 2.0.0
Sebastien Lorber, one of the maintainers replied my tweet with: