Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

docs(v2): add section for docs-only mode #2378

Merged
merged 2 commits into from
Mar 8, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 27 additions & 0 deletions website/docs/configuration.md
Original file line number Diff line number Diff line change
Expand Up @@ -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).