Skip to content

Commit 88614e1

Browse files
author
Eric Lin
committed
feat(docs): versioned and non-versioned docs
1 parent 6bd46be commit 88614e1

File tree

4 files changed

+38
-3
lines changed

4 files changed

+38
-3
lines changed

docs/advanced/manage-docs-versions.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
---
2-
title: Manage versioned docs
2+
title: Creating versioned docs
33
sidebar_position: 2
44
---
55

docs/advanced/multi-instance-docs.mdx

+35
Original file line numberDiff line numberDiff line change
@@ -3,3 +3,38 @@ sidebar_position: 3
33
---
44

55
# Support versioned and non-versioned docs
6+
7+
You may have a use-case where some part of your documentation is non-versioned and another part is versioned. Docusaurus supports multi-instance docs since the docs functionality is a plugin itself and can be re-used multiple times.
8+
9+
```js title="docusaurus.config.js" {6-11,18-24}
10+
module.exports = {
11+
presets: [
12+
[
13+
"@docusaurus/preset-classic",
14+
{
15+
docs: {
16+
// id: 'product', // omitted => default instance
17+
path: "product",
18+
routeBasePath: "product",
19+
sidebarPath: require.resolve("./sidebarsProduct.js"),
20+
// ... other options
21+
},
22+
},
23+
],
24+
],
25+
plugins: [
26+
[
27+
"@docusaurus/plugin-content-docs",
28+
{
29+
id: "community",
30+
path: "community",
31+
routeBasePath: "community",
32+
sidebarPath: require.resolve("./sidebarsCommunity.js"),
33+
// ... other options
34+
},
35+
],
36+
],
37+
};
38+
```
39+
40+
Up-to-date documentation on how to set this up can be found on Docusaurus' [documentation](https://docusaurus.io/docs/docs-multi-instance#use-cases).

docs/getting-started/index.mdx

+1-1
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@ It is highly recommended that you use a tool like [`nvm`](https://github.com/nvm
9696

9797
```bash
9898
npm install
99-
npm prepare
99+
npm run prepare
100100
```
101101

102102
3. To preview and for every time afterwards:

docs/getting-started/running-workflow.mdx

+1-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ Ideally, you would be somewhat acquainted with `npm` or `yarn` project workflows
1010

1111
## 👨‍💻 Committing to your repo
1212

13-
As part of running `npm prepare` when initializing this repo, [**`husky`**](https://typicode.github.io/husky/#/) is installed to manage pre-commit hooks.
13+
As part of running `npm run prepare` when initializing this repo, [**`husky`**](https://typicode.github.io/husky/#/) is installed to manage pre-commit hooks.
1414

1515
All commits are linted with `commitlint` with the conventional rules found in `package.json`.
1616

0 commit comments

Comments
 (0)