question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

[V2] Configure multiple docs

See original GitHub issue

❓ Questions and Help

Is it possible to configure multiple documentation routes?

My motivation is that I need a doc route for ‘Guidelines’, another for ‘API Documentation’ and so on.

I’m trying to configure multiple @docusaurus/plugin-content-docs plugins but this error occur:

Identifier 'React' has already been declared (21:133)

My config:

{
  ...
  presets: [
    [
      '@docusaurus/preset-classic',
      {
        blog: {...},
        theme: {...},
        docs: {
          sidebarPath: require.resolve('./sidebars.js'),
        },
      },
    ],
  ],
  plugins: [
    ['@docusaurus/plugin-content-docs', {
      path: 'docs2',
      routeBasePath: 'docs2',
      sidebarPath: require.resolve('./sidebars2.js'),
    }],
  ],
  ...
}

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:5 (1 by maintainers)

github_iconTop GitHub Comments

1reaction
krossekrabbecommented, Dec 4, 2021

@jwitz In my case it was because the docs were actually included two times. Make sure the path of your second docs plugin config does not point to a subdirectory of the docs folder.

Or try deactivating the preset docs plugin and configure everything manually:

  presets: [
    [
      '@docusaurus/preset-classic',
      /** @type {import('@docusaurus/preset-classic').Options} */
      ({
        docs: false,
        theme: {
          customCss: require.resolve('./src/css/custom.css'),
        }
      }),
    ],
  ],

  plugins: [
    ['@docusaurus/plugin-content-docs', {
      path: 'docs1',
      routeBasePath: 'docs1',
      sidebarPath: './sidebars1.js'
    }],
    ['@docusaurus/plugin-content-docs', {
      id: 'docs2',
      path: 'docs2',
      routeBasePath: 'docs2',
      sidebarPath: './sidebars2.js',
    }]
  ],
1reaction
jwitzcommented, Nov 5, 2021

@rayronvictor I know this was ages ago, but do you remember how you ended up fixing this? I don’t see anything related on the linked doc, and now I’m running into the same problem even as I follow these steps exactly: https://docusaurus.io/docs/docs-multi-instance

Read more comments on GitHub >

github_iconTop Results From Across the Web

Configuration File V2 - Read the Docs
Read the Docs supports configuring your documentation builds with a YAML file. The configuration file must be in the root directory of your...
Read more >
Working with multiple Documents | Royal Apps
In short, you can have multiple files open at the same time, ... With Royal TS V2 we've also streamlined the way you...
Read more >
Generate multiple different documents at once with one ...
Generate multiple different documents at once with one Google Form · 1. Copy the predefined templates · 2. Configure Form Publisher on the...
Read more >
Configuring the AWS SDK for Go V2
In the AWS SDK for Go V2, you can configure common settings for service clients, such as the logger, log level, and retry...
Read more >
How to: Share multiple files in Google Drive - YouTube
Share multiple files in Google DriveLearn More → https://goo.gle/3PDoWLQTry Google Drive for yourself → https://goo.gle/3vtlf2b What is ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found