'Does Docusaurus support renaming the 'docs' output folder?

I am currently evaluating using Docusaurus to generate a static web site. The site itself is not documentation focused, in fact, the site is not even computer or technology related. But as a techie myself, I want a CI and Git-powered publishing strategy for this web site.

Docusaurus uses Markdown for its page content (outside of custom React-based pages). However, when these Markdown pages are built, they are all placed in a top-level folder in the static site called docs. This folder naming doesn't really fit with the web site I want to produce.

There is a configuration setting for customDocsPath but this only changes where the build looks for Markdown files, not the output path in the created site content.

I'm not a React developer, but aside from hacking away at the JavaScript in the build engine to search/replace instances of docs, is there a better way to do this?



Solution 1:[1]

We don't currently support routes other than /docs - yet. There is a pull request that started back in August, but has been recently resurrected again. The PR is being reviewed and updated to allow more customizable routes.

Solution 2:[2]

As of Docusaurus 1.6, this is now implemented. The pull request has been merged.

More details about this are found in the site configuration.

Simply add the following to the siteConfig section in siteConfig.js:

const siteConfig = {
  title: 'My Awesome Site',
  docsUrl: '',
  // ...
};

Solution 3:[3]

In docusaurus 2 changing main docs folder is quite straightforward:

  • rename docs/ to whatever/

  • add following to docusaurus.config.js

    presets: [
    [
      '@docusaurus/preset-classic', // should be already there
      {
        docs: {
          path: 'whatever',
          routeBasePath: 'whatever',
    // ...
    

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 Joel Marcey
Solution 2 cleardemon
Solution 3 Cezary Daniel Nowak