Skip to content

admin/dorfarchiv

PublicMirror

Mirror of https://forge.levinkeller.de/levin/dorfarchiv.git

Levin KellerInitial commit140869eHistory
55 lines · 1.2 KB
1---
2sidebar_position: 1
3---
4
5# Manage Docs Versions
6
7Docusaurus can manage multiple versions of your docs.
8
9## Create a docs version
10
11Release a version 1.0 of your project:
12
13```bash
14npm run docusaurus docs:version 1.0
15```
16
17The `docs` folder is copied into `versioned_docs/version-1.0` and `versions.json` is created.
18
19Your docs now have 2 versions:
20
21- `1.0` at `http://localhost:3000/docs/` for the version 1.0 docs
22- `current` at `http://localhost:3000/docs/next/` for the **upcoming, unreleased docs**
23
24## Add a Version Dropdown
25
26To navigate seamlessly across versions, add a version dropdown.
27
28Modify the `docusaurus.config.js` file:
29
30```js title="docusaurus.config.js"
31export default {
32 themeConfig: {
33 navbar: {
34 items: [
35 // highlight-start
36 {
37 type: 'docsVersionDropdown',
38 },
39 // highlight-end
40 ],
41 },
42 },
43};
44```
45
46The docs version dropdown appears in your navbar:
47
48![Docs Version Dropdown](./img/docsVersionDropdown.png)
49
50## Update an existing version
51
52It is possible to edit versioned docs in their respective folder:
53
54- `versioned_docs/version-1.0/hello.md` updates `http://localhost:3000/docs/hello`
55- `docs/hello.md` updates `http://localhost:3000/docs/next/hello`