"use strict";(self.webpackChunkdoc=self.webpackChunkdoc||[]).push([[953],{23:(e,t,s)=>{s.r(t),s.d(t,{assets:()=>c,contentTitle:()=>a,default:()=>u,frontMatter:()=>o,metadata:()=>i,toc:()=>l});var n=s(4848),r=s(8453);const o={sidebar_position:2},a="Create a Document",i={id:"tutorial-basics/create-a-document",title:"Create a Document",description:"Documents are groups of pages connected through:",source:"@site/docs/tutorial-basics/create-a-document.md",sourceDirName:"tutorial-basics",slug:"/tutorial-basics/create-a-document",permalink:"/docs/tutorial-basics/create-a-document",draft:!1,unlisted:!1,editUrl:"https://github.com/facebook/docusaurus/tree/main/packages/create-docusaurus/templates/shared/docs/tutorial-basics/create-a-document.md",tags:[],version:"current",sidebarPosition:2,frontMatter:{sidebar_position:2},sidebar:"tutorialSidebar",previous:{title:"Create a Page",permalink:"/docs/tutorial-basics/create-a-page"},next:{title:"Create a Blog Post",permalink:"/docs/tutorial-basics/create-a-blog-post"}},c={},l=[{value:"Create your first Doc",id:"create-your-first-doc",level:2},{value:"Configure the Sidebar",id:"configure-the-sidebar",level:2}];function d(e){const t={a:"a",code:"code",h1:"h1",h2:"h2",li:"li",p:"p",pre:"pre",strong:"strong",ul:"ul",...(0,r.R)(),...e.components};return(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(t.h1,{id:"create-a-document",children:"Create a Document"}),"\n",(0,n.jsxs)(t.p,{children:["Documents are ",(0,n.jsx)(t.strong,{children:"groups of pages"})," connected through:"]}),"\n",(0,n.jsxs)(t.ul,{children:["\n",(0,n.jsxs)(t.li,{children:["a ",(0,n.jsx)(t.strong,{children:"sidebar"})]}),"\n",(0,n.jsx)(t.li,{children:(0,n.jsx)(t.strong,{children:"previous/next navigation"})}),"\n",(0,n.jsx)(t.li,{children:(0,n.jsx)(t.strong,{children:"versioning"})}),"\n"]}),"\n",(0,n.jsx)(t.h2,{id:"create-your-first-doc",children:"Create your first Doc"}),"\n",(0,n.jsxs)(t.p,{children:["Create a Markdown file at ",(0,n.jsx)(t.code,{children:"docs/hello.md"}),":"]}),"\n",(0,n.jsx)(t.pre,{children:(0,n.jsx)(t.code,{className:"language-md",metastring:'title="docs/hello.md"',children:"# Hello\n\nThis is my **first Docusaurus document**!\n"})}),"\n",(0,n.jsxs)(t.p,{children:["A new document is now available at ",(0,n.jsx)(t.a,{href:"http://localhost:3000/docs/hello",children:"http://localhost:3000/docs/hello"}),"."]}),"\n",(0,n.jsx)(t.h2,{id:"configure-the-sidebar",children:"Configure the Sidebar"}),"\n",(0,n.jsxs)(t.p,{children:["Docusaurus automatically ",(0,n.jsx)(t.strong,{children:"creates a sidebar"})," from the ",(0,n.jsx)(t.code,{children:"docs"})," folder."]}),"\n",(0,n.jsx)(t.p,{children:"Add metadata to customize the sidebar label and position:"}),"\n",(0,n.jsx)(t.pre,{children:(0,n.jsx)(t.code,{className:"language-md",metastring:'title="docs/hello.md" {1-4}',children:"---\nsidebar_label: 'Hi!'\nsidebar_position: 3\n---\n\n# Hello\n\nThis is my **first Docusaurus document**!\n"})}),"\n",(0,n.jsxs)(t.p,{children:["It is also possible to create your sidebar explicitly in ",(0,n.jsx)(t.code,{children:"sidebars.js"}),":"]}),"\n",(0,n.jsx)(t.pre,{children:(0,n.jsx)(t.code,{className:"language-js",metastring:'title="sidebars.js"',children:"export default {\n tutorialSidebar: [\n 'intro',\n // highlight-next-line\n 'hello',\n {\n type: 'category',\n label: 'Tutorial',\n items: ['tutorial-basics/create-a-document'],\n },\n ],\n};\n"})})]})}function u(e={}){const{wrapper:t}={...(0,r.R)(),...e.components};return t?(0,n.jsx)(t,{...e,children:(0,n.jsx)(d,{...e})}):d(e)}},8453:(e,t,s)=>{s.d(t,{R:()=>a,x:()=>i});var n=s(6540);const r={},o=n.createContext(r);function a(e){const t=n.useContext(o);return n.useMemo((function(){return"function"==typeof e?e(t):{...t,...e}}),[t,e])}function i(e){let t;return t=e.disableParentContext?"function"==typeof e.components?e.components(r):e.components||r:a(e.components),n.createElement(o.Provider,{value:t},e.children)}}}]);