create-a-document.mdx 1.0 KB

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