Mirror of https://forge.levinkeller.de/levin/dorfarchiv.git
140869e5f8f8800ceb90c04a2f58ab0a1065b01a
| 1 | --- |
| 2 | sidebar_position: 2 |
| 3 | --- |
| 4 | |
| 5 | # Create a Document |
| 6 | |
| 7 | Documents are **groups of pages** connected through: |
| 8 | |
| 9 | - a **sidebar** |
| 10 | - **previous/next navigation** |
| 11 | - **versioning** |
| 12 | |
| 13 | ## Create your first Doc |
| 14 | |
| 15 | Create a Markdown file at `docs/hello.md`: |
| 16 | |
| 17 | ```md title="docs/hello.md" |
| 18 | # Hello |
| 19 | |
| 20 | This is my **first Docusaurus document**! |
| 21 | ``` |
| 22 | |
| 23 | A new document is now available at [http://localhost:3000/docs/hello](http://localhost:3000/docs/hello). |
| 24 | |
| 25 | ## Configure the Sidebar |
| 26 | |
| 27 | Docusaurus automatically **creates a sidebar** from the `docs` folder. |
| 28 | |
| 29 | Add metadata to customize the sidebar label and position: |
| 30 | |
| 31 | ```md title="docs/hello.md" {1-4} |
| 32 | --- |
| 33 | sidebar_label: 'Hi!' |
| 34 | sidebar_position: 3 |
| 35 | --- |
| 36 | |
| 37 | # Hello |
| 38 | |
| 39 | This is my **first Docusaurus document**! |
| 40 | ``` |
| 41 | |
| 42 | It is also possible to create your sidebar explicitly in `sidebars.js`: |
| 43 | |
| 44 | ```js title="sidebars.js" |
| 45 | export default { |
| 46 | tutorialSidebar: [ |
| 47 | 'intro', |
| 48 | // highlight-next-line |
| 49 | 'hello', |
| 50 | { |
| 51 | type: 'category', |
| 52 | label: 'Tutorial', |
| 53 | items: ['tutorial-basics/create-a-document'], |
| 54 | }, |
| 55 | ], |
| 56 | }; |
| 57 | ``` |