navigation.mdx 1.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687
  1. ---
  2. title: "Navigation"
  3. description: "The navigation field in docs.json defines the pages that go in the navigation menu"
  4. icon: "map"
  5. ---
  6. The navigation menu is the list of links on every website.
  7. You will likely update `docs.json` every time you add a new page. Pages do not show up automatically.
  8. ## Navigation syntax
  9. Our navigation syntax is recursive which means you can make nested navigation groups. You don't need to include `.mdx` in page names.
  10. <CodeGroup>
  11. ```json Regular Navigation
  12. "navigation": {
  13. "tabs": [
  14. {
  15. "tab": "Docs",
  16. "groups": [
  17. {
  18. "group": "Getting Started",
  19. "pages": ["quickstart"]
  20. }
  21. ]
  22. }
  23. ]
  24. }
  25. ```
  26. ```json Nested Navigation
  27. "navigation": {
  28. "tabs": [
  29. {
  30. "tab": "Docs",
  31. "groups": [
  32. {
  33. "group": "Getting Started",
  34. "pages": [
  35. "quickstart",
  36. {
  37. "group": "Nested Reference Pages",
  38. "pages": ["nested-reference-page"]
  39. }
  40. ]
  41. }
  42. ]
  43. }
  44. ]
  45. }
  46. ```
  47. </CodeGroup>
  48. ## Folders
  49. Simply put your MDX files in folders and update the paths in `docs.json`.
  50. For example, to have a page at `https://yoursite.com/your-folder/your-page` you would make a folder called `your-folder` containing an MDX file called `your-page.mdx`.
  51. <Warning>
  52. You cannot use `api` for the name of a folder unless you nest it inside another folder. Mintlify uses Next.js which reserves the top-level `api` folder for internal server calls. A folder name such as `api-reference` would be accepted.
  53. </Warning>
  54. ```json Navigation With Folder
  55. "navigation": {
  56. "tabs": [
  57. {
  58. "tab": "Docs",
  59. "groups": [
  60. {
  61. "group": "Group Name",
  62. "pages": ["your-folder/your-page"]
  63. }
  64. ]
  65. }
  66. ]
  67. }
  68. ```
  69. ## Hidden pages
  70. MDX files not included in `docs.json` will not show up in the sidebar but are accessible through the search bar and by linking directly to them.