From ad3accd3fb109ec0f60ddc68ddf4e55d6be74a10 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Linus=20L=C3=A5ngberg?= Date: Sun, 8 Mar 2020 14:09:40 +0100 Subject: [PATCH] docs(v2): add section for docs-only mode (#2378) * docs(v2): add section for docs-only mode * docs(v2): use correct section in document Co-Authored-By: Alexey Pyltsyn Co-authored-by: Alexey Pyltsyn --- website/docs/configuration.md | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) diff --git a/website/docs/configuration.md b/website/docs/configuration.md index 9c377a58d2..0e8f36b1ae 100644 --- a/website/docs/configuration.md +++ b/website/docs/configuration.md @@ -147,3 +147,30 @@ const Hello = () => { If you just want to use those fields on the client side, you could create your own JS files and import them as ES6 modules, there is no need to put them in `docusaurus.config.js`. ::: + +## Docs-only mode + +You can run your Docusaurus 2 site without a landing page and instead have a page from your documentation as the index page. + +Set the `routeBasePath` to indicate that it’s the root path. + +**Note**: Make sure there’s no `index.js` page in `src/pages` or there will be two files mapped to the same route! + +```js {9} +// docusaurus.config.js +module.exports = { + // ... + presets: [ + [ + '@docusaurus/preset-classic', + { + docs: { + routeBasePath: '/' // Set this value to '/'. + }, + }, + ], + ], +}; +``` + +You can apply the same principle for blogs with the [Blog-only mode](blog.md#blog-only-mode).