How can I disable the 'My Site' landing page in Docusaurus

101 Views Asked by At

I created a "How to Use" document in which I want to directly show the Tutorial page. How can I Disable the 'My Site' Landing page?

I try to change the parameters on docusaurus.config.js, with to avail.

1

There are 1 best solutions below

0
minae On

You need to do three things:

  1. In the Markdown file that's your tutorial landing page (such as intro.md or index.md or whatever you're using), add this inside the front matter: slug: /

  2. Delete src/pages/index.js, or rename the file to _index.js.

  3. In docusaurus.config.js, find the presets array. Add routeBasePath: '/' as a property of the docs object in that array. Like this:

  presets: [
    [
      'classic',
      /** @type {import('@docusaurus/preset-classic').Options} */
      ({
        docs: {
          sidebarPath: './sidebars.js',
          routeBasePath: '/'
        },
  ...

That should do it.

This is called "docs-only mode". You can read more about it here: https://docusaurus.io/docs/docs-introduction#docs-only-mode