"use strict";(self.webpackChunkitblog_site=self.webpackChunkitblog_site||[]).push([[1953],{6546:(e,t,s)=>{s.r(t),s.d(t,{assets:()=>c,contentTitle:()=>i,default:()=>u,frontMatter:()=>o,metadata:()=>n,toc:()=>l});const n=JSON.parse('{"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":false,"unlisted":false,"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"}}');var r=s(4848),a=s(8453);const o={sidebar_position:2},i="Create a Document",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",header:"header",li:"li",p:"p",pre:"pre",strong:"strong",ul:"ul",...(0,a.R)(),...e.components};return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(t.header,{children:(0,r.jsx)(t.h1,{id:"create-a-document",children:"Create a Document"})}),"\n",(0,r.jsxs)(t.p,{children:["Documents are ",(0,r.jsx)(t.strong,{children:"groups of pages"})," connected through:"]}),"\n",(0,r.jsxs)(t.ul,{children:["\n",(0,r.jsxs)(t.li,{children:["a ",(0,r.jsx)(t.strong,{children:"sidebar"})]}),"\n",(0,r.jsx)(t.li,{children:(0,r.jsx)(t.strong,{children:"previous/next navigation"})}),"\n",(0,r.jsx)(t.li,{children:(0,r.jsx)(t.strong,{children:"versioning"})}),"\n"]}),"\n",(0,r.jsx)(t.h2,{id:"create-your-first-doc",children:"Create your first Doc"}),"\n",(0,r.jsxs)(t.p,{children:["Create a Markdown file at ",(0,r.jsx)(t.code,{children:"docs/hello.md"}),":"]}),"\n",(0,r.jsx)(t.pre,{children:(0,r.jsx)(t.code,{className:"language-md",metastring:'title="docs/hello.md"',children:"# Hello\n\nThis is my **first Docusaurus document**!\n"})}),"\n",(0,r.jsxs)(t.p,{children:["A new document is now available at ",(0,r.jsx)(t.a,{href:"http://localhost:3000/docs/hello",children:"http://localhost:3000/docs/hello"}),"."]}),"\n",(0,r.jsx)(t.h2,{id:"configure-the-sidebar",children:"Configure the Sidebar"}),"\n",(0,r.jsxs)(t.p,{children:["Docusaurus automatically ",(0,r.jsx)(t.strong,{children:"creates a sidebar"})," from the ",(0,r.jsx)(t.code,{children:"docs"})," folder."]}),"\n",(0,r.jsx)(t.p,{children:"Add metadata to customize the sidebar label and position:"}),"\n",(0,r.jsx)(t.pre,{children:(0,r.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,r.jsxs)(t.p,{children:["It is also possible to create your sidebar explicitly in ",(0,r.jsx)(t.code,{children:"sidebars.js"}),":"]}),"\n",(0,r.jsx)(t.pre,{children:(0,r.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,a.R)(),...e.components};return t?(0,r.jsx)(t,{...e,children:(0,r.jsx)(d,{...e})}):d(e)}},8453:(e,t,s)=>{s.d(t,{R:()=>o,x:()=>i});var n=s(6540);const r={},a=n.createContext(r);function o(e){const t=n.useContext(a);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:o(e.components),n.createElement(a.Provider,{value:t},e.children)}}}]);