docusaurus

How to set "Docs" as the main page


I am using the theme template and I am trying to change the main page of my website.

That is, how do I remove the index page and replace it with the "Docs" page as the main page on my website?


Solution

    1. Delete src/pages/index.js
    2. Add the following to docusaurus.config.js
    module.exports = {
      // ...
      presets: [
        [
          '@docusaurus/preset-classic',
          {
            docs: {
              routeBasePath: '/', // Set this value to '/'.
              homePageId: 'getting-started', // Set to existing document id.
              // ...
            },
          },
        ],
      ],
      // ...
    };
    

    Follow the instructions here