["'])(?.*?)\1/,M=/\{(? [\d,-]+)\}/,A={js:{start:"\\/\\/",end:""},jsBlock:{start:"\\/\\*",end:"\\*\\/"},jsx:{start:"\\{\\s*\\/\\*",end:"\\*\\/\\s*\\}"},bash:{start:"#",end:""},html:{start:"\x3c!--",end:"--\x3e"}},R={...A,lua:{start:"--",end:""},wasm:{start:"\\;\\;",end:""},tex:{start:"%",end:""},vb:{start:"['\u2018\u2019]",end:""},vbnet:{start:"(?:_\\s*)?['\u2018\u2019]",end:""},rem:{start:"[Rr][Ee][Mm]\\b",end:""},f90:{start:"!",end:""},ml:{start:"\\(\\*",end:"\\*\\)"},cobol:{start:"\\*>",end:""}},H=Object.keys(A);function O(e,t){let n=e.map(e=>{let{start:n,end:r}=R[e];return`(?:${n}\\s*(${t.flatMap(e=>[e.line,e.block?.start,e.block?.end].filter(Boolean)).join("|")})\\s*${r})`}).join("|");return RegExp(`^\\s*(?:${n})\\s*$`)}let $=(0,i.createContext)(null);function z(e){let{metadata:t,wordWrap:n,children:r}=e,l=(0,i.useMemo)(()=>({metadata:t,wordWrap:n}),[t,n]);return(0,a.jsx)($.Provider,{value:l,children:r})}function S(){let e=(0,i.useContext)($);if(null===e)throw new E.i6("CodeBlockContextProvider");return e}function P(e){let{as:t,...n}=e,r=function(e){let t={color:"--prism-color",backgroundColor:"--prism-background-color"},n={};return Object.entries(e.plain).forEach(e=>{let[r,l]=e,a=t[r];a&&"string"==typeof l&&(n[a]=l)}),n}(x());return(0,a.jsx)(t,{...n,style:r,className:(0,s.Z)(n.className,"codeBlockContainer_jDV4",L.k.common.codeBlock)})}let F={codeBlock:"codeBlock_Gebt",codeBlockStandalone:"codeBlockStandalone_i_cY",codeBlockLines:"codeBlockLines_FJaf",codeBlockLinesWithNumbering:"codeBlockLinesWithNumbering_FU9Q"};function W(e){let{children:t,className:n}=e;return(0,a.jsx)(P,{as:"pre",tabIndex:0,className:(0,s.Z)(F.codeBlockStandalone,"thin-scrollbar",n),children:(0,a.jsx)("code",{className:F.codeBlockLines,children:t})})}let D={attributes:!0,characterData:!0,childList:!0,subtree:!0};function U(e){let{children:t}=e;return t}var V=n(7316);function G(e){let{line:t,token:n,...r}=e;return(0,a.jsx)("span",{...r})}let q={codeLine:"codeLine_qRmp",codeLineNumber:"codeLineNumber_dS_J",codeLineContent:"codeLineContent_XF5l"};function X(e){let{line:t,classNames:n,showLineNumbers:r,getLineProps:l,getTokenProps:i}=e,o=function(e){let t=1===e.length&&"\n"===e[0].content?e[0]:void 0;return t?[{...t,content:""}]:e}(t),c=l({line:o,className:(0,s.Z)(n,r&&q.codeLine)}),u=o.map((e,t)=>{let n=i({token:e});return(0,a.jsx)(G,{...n,line:o,token:e,children:n.children},t)});return(0,a.jsxs)("span",{...c,children:[r?(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)("span",{className:q.codeLineNumber}),(0,a.jsx)("span",{className:q.codeLineContent,children:u})]}):u,(0,a.jsx)("br",{})]})}let Q=i.forwardRef((e,t)=>(0,a.jsx)("pre",{ref:t,tabIndex:0,...e,className:(0,s.Z)(e.className,F.codeBlock,"thin-scrollbar")}));function Y(e){let{metadata:t}=S();return(0,a.jsx)("code",{...e,className:(0,s.Z)(e.className,F.codeBlockLines,void 0!==t.lineNumbersStart&&F.codeBlockLinesWithNumbering),style:{...e.style,counterReset:void 0===t.lineNumbersStart?void 0:`line-count ${t.lineNumbersStart-1}`}})}function J(e){let{className:t}=e,{metadata:n,wordWrap:r}=S(),l=x(),{code:i,language:o,lineNumbersStart:c,lineClassNames:u}=n;return(0,a.jsx)(V.y$,{theme:l,code:i,language:o,children:e=>{let{className:n,style:l,tokens:i,getLineProps:o,getTokenProps:d}=e;return(0,a.jsx)(Q,{ref:r.codeBlockRef,className:(0,s.Z)(t,n),style:l,children:(0,a.jsx)(Y,{children:i.map((e,t)=>(0,a.jsx)(X,{line:e,getLineProps:o,getTokenProps:d,classNames:u[t],showLineNumbers:void 0!==c},t))})})}})}var K=n(44771);function ee(e){let{className:t,...n}=e;return(0,a.jsx)("button",{type:"button",...n,className:(0,s.Z)("clean-btn",t)})}function et(e){return(0,a.jsx)("svg",{viewBox:"0 0 24 24",...e,children:(0,a.jsx)("path",{fill:"currentColor",d:"M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"})})}function en(e){return(0,a.jsx)("svg",{viewBox:"0 0 24 24",...e,children:(0,a.jsx)("path",{fill:"currentColor",d:"M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"})})}let er={copyButtonCopied:"copyButtonCopied_wDuR",copyButtonIcons:"copyButtonIcons_gMWc",copyButtonIcon:"copyButtonIcon_GXfb",copyButtonSuccessIcon:"copyButtonSuccessIcon_ktUX"};function el(e){let{className:t}=e,{copyCode:n,isCopied:r}=function(){let{metadata:{code:e}}=S(),[t,n]=(0,i.useState)(!1),r=(0,i.useRef)(void 0),l=(0,i.useCallback)(()=>{(0,K.Z)(e),n(!0),r.current=window.setTimeout(()=>{n(!1)},1e3)},[e]);return(0,i.useEffect)(()=>()=>window.clearTimeout(r.current),[]),{copyCode:l,isCopied:t}}();return(0,a.jsx)(ee,{"aria-label":r?(0,u.I)({id:"theme.CodeBlock.copied",message:"Copied",description:"The copied button label on code blocks"}):(0,u.I)({id:"theme.CodeBlock.copyButtonAriaLabel",message:"Copy code to clipboard",description:"The ARIA label for copy code blocks button"}),title:(0,u.I)({id:"theme.CodeBlock.copy",message:"Copy",description:"The copy button label on code blocks"}),className:(0,s.Z)(t,er.copyButton,r&&er.copyButtonCopied),onClick:n,children:(0,a.jsxs)("span",{className:er.copyButtonIcons,"aria-hidden":"true",children:[(0,a.jsx)(et,{className:er.copyButtonIcon}),(0,a.jsx)(en,{className:er.copyButtonSuccessIcon})]})})}function ea(e){return(0,a.jsx)("svg",{viewBox:"0 0 24 24",...e,children:(0,a.jsx)("path",{fill:"currentColor",d:"M4 19h6v-2H4v2zM20 5H4v2h16V5zm-3 6H4v2h13.25c1.1 0 2 .9 2 2s-.9 2-2 2H15v-2l-3 3l3 3v-2h2c2.21 0 4-1.79 4-4s-1.79-4-4-4z"})})}let ei={wordWrapButtonIcon:"wordWrapButtonIcon___5r",wordWrapButtonEnabled:"wordWrapButtonEnabled_nam_"};function es(e){let{className:t}=e,{wordWrap:n}=S();if(!(n.isEnabled||n.isCodeScrollable))return!1;let r=(0,u.I)({id:"theme.CodeBlock.wordWrapToggle",message:"Toggle word wrap",description:"The title attribute for toggle word wrapping button of code block lines"});return(0,a.jsx)(ee,{onClick:()=>n.toggle(),className:(0,s.Z)(t,n.isEnabled&&ei.wordWrapButtonEnabled),"aria-label":r,title:r,children:(0,a.jsx)(ea,{className:ei.wordWrapButtonIcon,"aria-hidden":"true"})})}function eo(e){let{className:t}=e;return(0,a.jsx)(m.Z,{children:()=>(0,a.jsxs)("div",{className:(0,s.Z)(t,"buttonGroup_KXnS"),children:[(0,a.jsx)(es,{}),(0,a.jsx)(el,{})]})})}let ec={codeBlockContent:"codeBlockContent_cKMj",codeBlockTitle:"codeBlockTitle_U6Q0"};function eu(e){let{className:t}=e,{metadata:n}=S();return(0,a.jsxs)(P,{as:"div",className:(0,s.Z)(t,n.className),children:[n.title&&(0,a.jsx)("div",{className:ec.codeBlockTitle,children:(0,a.jsx)(U,{children:n.title})}),(0,a.jsxs)("div",{className:ec.codeBlockContent,children:[(0,a.jsx)(J,{}),(0,a.jsx)(eo,{})]})]})}function ed(e){let t=function(e){let{prism:t}=(0,g.L)();return function(e){var t,n,r;let l=(n=(t={language:e.language,defaultLanguage:e.defaultLanguage,className:e.className}).language??function(e){if(!e)return;let t=e.split(" ").find(e=>e.startsWith("language-"));return t?.replace(/language-/,"")}(t.className)??t.defaultLanguage,n?.toLowerCase()??"text"),{lineClassNames:a,code:i}=function(e,t){let n=e.replace(/\r?\n$/,"");return function(e,t){let{metastring:n,magicComments:r}=t;if(n&&M.test(n)){let t=n.match(M).groups.range;if(0===r.length)throw Error(`A highlight range has been given in code block's metastring (\`\`\` ${n}), but no magic comment config is available. Docusaurus applies the first magic comment entry's className for metastring ranges.`);let l=r[0].className;return{lineClassNames:Object.fromEntries(I()(t).filter(e=>e>0).map(e=>[e-1,[l]])),code:e}}return null}(n,{...t})??function(e,t){let{language:n,magicComments:r}=t;if(void 0===n)return{lineClassNames:{},code:e};let l=function(e,t){switch(e){case"js":case"javascript":case"ts":case"typescript":return O(["js","jsBlock"],t);case"jsx":case"tsx":return O(["js","jsBlock","jsx"],t);case"html":return O(["js","jsBlock","html"],t);case"python":case"py":case"bash":return O(["bash"],t);case"markdown":case"md":return O(["html","jsx","bash"],t);case"tex":case"latex":case"matlab":return O(["tex"],t);case"lua":case"haskell":return O(["lua"],t);case"sql":return O(["lua","jsBlock"],t);case"wasm":return O(["wasm"],t);case"vb":case"vba":case"visual-basic":return O(["vb","rem"],t);case"vbnet":return O(["vbnet","rem"],t);case"batch":return O(["rem"],t);case"basic":return O(["rem","f90"],t);case"fsharp":return O(["js","ml"],t);case"ocaml":case"sml":return O(["ml"],t);case"fortran":return O(["f90"],t);case"cobol":return O(["cobol"],t);default:return O(H,t)}}(n,r),a=e.split(/\r?\n/),i=Object.fromEntries(r.map(e=>[e.className,{start:0,range:""}])),s=Object.fromEntries(r.filter(e=>e.line).map(e=>{let{className:t,line:n}=e;return[n,t]})),o=Object.fromEntries(r.filter(e=>e.block).map(e=>{let{className:t,block:n}=e;return[n.start,t]})),c=Object.fromEntries(r.filter(e=>e.block).map(e=>{let{className:t,block:n}=e;return[n.end,t]}));for(let e=0;e void 0!==e);s[n]?i[s[n]].range+=`${e},`:o[n]?i[o[n]].start=e:c[n]&&(i[c[n]].range+=`${i[c[n]].start}-${e-1},`),a.splice(e,1)}let u={};return Object.entries(i).forEach(e=>{let[t,{range:n}]=e;I()(n).forEach(e=>{u[e]??=[],u[e].push(t)})}),{code:a.join("\n"),lineClassNames:u}}(n,{...t})}(e.code,{metastring:e.metastring,magicComments:e.magicComments,language:l}),o=function(e){let{className:t,language:n}=e;return(0,s.Z)(t,n&&!t?.includes(`language-${n}`)&&`language-${n}`)}({className:e.className,language:l}),c=(r=e.metastring,(r?.match(T)?.groups.title??"")||e.title),u=function(e){let{showLineNumbers:t,metastring:n}=e;if("boolean"==typeof t)return t?1:void 0;if("number"==typeof t)return t;let r=n?.split(" ").find(e=>e.startsWith("showLineNumbers"));if(r)return r.startsWith("showLineNumbers=")?parseInt(r.replace("showLineNumbers=",""),10):1}({showLineNumbers:e.showLineNumbers,metastring:e.metastring});return{codeInput:e.code,code:i,className:o,language:l,title:c,lineNumbersStart:u,lineClassNames:a}}({code:e.children,className:e.className,metastring:e.metastring,magicComments:t.magicComments,defaultLanguage:t.defaultLanguage,language:e.language,title:e.title,showLineNumbers:e.showLineNumbers})}(e),n=function(){let[e,t]=(0,i.useState)(!1),[n,r]=(0,i.useState)(!1),l=(0,i.useRef)(null),a=(0,i.useCallback)(()=>{let n=l.current.querySelector("code");e?n.removeAttribute("style"):(n.style.whiteSpace="pre-wrap",n.style.overflowWrap="anywhere"),t(e=>!e)},[l,e]),s=(0,i.useCallback)(()=>{let{scrollWidth:e,clientWidth:t}=l.current;r(e>t||l.current.querySelector("code").hasAttribute("style"))},[l]),[o,c]=(0,i.useState)(),u=(0,i.useCallback)(()=>{c(l.current?.closest("[role=tabpanel][hidden]"))},[l,c]);return(0,i.useEffect)(()=>{u()},[u]),!function(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:D,r=(0,E.zX)(t),l=(0,E.Ql)(n);(0,i.useEffect)(()=>{let t=new MutationObserver(r);return e&&t.observe(e,l),()=>t.disconnect()},[e,r,l])}(o,e=>{e.forEach(e=>{"attributes"===e.type&&"hidden"===e.attributeName&&(s(),u())})},{attributes:!0,characterData:!1,childList:!1,subtree:!1}),(0,i.useEffect)(()=>{s()},[e,s]),(0,i.useEffect)(()=>(window.addEventListener("resize",s,{passive:!0}),()=>{window.removeEventListener("resize",s)}),[s]),{codeBlockRef:l,isEnabled:e,isCodeScrollable:n,toggle:a}}();return(0,a.jsx)(z,{metadata:t,wordWrap:n,children:(0,a.jsx)(eu,{})})}let em=(r=function(e){let{children:t,...n}=e,r=(0,o.Z)(),l=i.Children.toArray(t).some(e=>(0,i.isValidElement)(e))?t:Array.isArray(t)?t.join(""):t;return(0,a.jsx)("string"==typeof l?ed:W,{...n,children:l},String(r))},function(e){return e.live?(0,a.jsx)(w,{scope:C,...e}):(0,a.jsx)(r,{...e})});function eh(e){return(0,a.jsx)(em,{...e})}}}]); \ No newline at end of file +`),s}},[e])}();return{selectMessage:(t,n)=>(function(e,t,n){let r=e.split("|");if(1===r.length)return r[0];r.length>n.pluralForms.length&&console.error(`For locale=${n.locale}, a maximum of ${n.pluralForms.length} plural forms are expected (${n.pluralForms.join(",")}), but the message contains ${r.length}: ${e}`);let l=n.select(t);return r[Math.min(n.pluralForms.indexOf(l),r.length-1)]})(n,t,e)}}},56497:function(e,t,n){n.d(t,{Z:()=>a});var r=n(85893);n(67294);var l=n(71607);function a(e){let{children:t,fallback:n}=e;return(0,l.Z)()?(0,r.jsx)(r.Fragment,{children:t?.()}):n??null}},61420:function(e,t,n){n.d(t,{Z:()=>b});var r=n(85893),l=n(67294),a=n(5666),i=n(37147),s=n(54505),o=n(90496),c=n(35363);let u={image:"image_oRbT"};function d(e){let{author:t,className:n}=e,{name:l,url:a,imageURL:i}=t;return(0,r.jsx)("div",{className:(0,o.Z)("avatar margin-bottom--sm",n),children:i&&(0,r.jsx)(c.Z,{className:"avatar__photo-link avatar__photo",href:a,children:(0,r.jsx)("img",{className:u.image,src:i,alt:l,onError:e=>{e.currentTarget.src='data:image/svg+xml,'}})})})}function m(e){let{expanded:t,...n}=e;return t?(0,r.jsx)("svg",{viewBox:"0 0 1024 1024",width:"20",height:"20",fill:"currentColor",...n,children:(0,r.jsx)("path",{d:"M783.915092 1009.031953l-271.898251-277.615587-271.930737 277.550617a49.214558 49.214558 0 0 1-70.752018 0 51.780862 51.780862 0 0 1 0-72.246322l307.274261-313.706262a49.279528 49.279528 0 0 1 70.784503 0l307.33923 313.706262a51.975771 51.975771 0 0 1 0 72.311292 49.409467 49.409467 0 0 1-70.816988 0z m-307.306745-608.05155L169.269117 87.274141A51.975771 51.975771 0 0 1 169.269117 14.96285a49.409467 49.409467 0 0 1 70.816987 0l271.930737 277.615586L783.850122 14.96285a49.409467 49.409467 0 0 1 70.816988 0 51.975771 51.975771 0 0 1 0 72.311291l-307.33923 313.706262a49.376982 49.376982 0 0 1-70.719533 0z"})}):(0,r.jsx)("svg",{viewBox:"0 0 1024 1024",width:"20",height:"20",fill:"currentColor",...n,children:(0,r.jsx)("path",{d:"M476.612887 1009.12034L169.240699 695.380437a51.981345 51.981345 0 0 1 0-72.319045 49.382277 49.382277 0 0 1 70.824582 0l271.959897 277.645356 271.862433-277.645356a49.382277 49.382277 0 0 1 70.824582 0 51.981345 51.981345 0 0 1 0 72.319045l-307.307212 313.739903a49.447254 49.447254 0 0 1-70.792094 0z m307.274724-608.116755L511.99269 123.455693l-271.959897 277.645357a49.382277 49.382277 0 0 1-70.824582 0 51.981345 51.981345 0 0 1 0-72.319045L476.580399 15.042102a49.382277 49.382277 0 0 1 70.727117 0l307.372188 313.739903a51.981345 51.981345 0 0 1 0 72.319045 49.414766 49.414766 0 0 1-70.824582 0z"})})}let h={imageOnlyAuthorRow:"imageOnlyAuthorRow_WiD6",imageOnlyAuthorCol:"imageOnlyAuthorCol_uiac",toggleButton:"toggleButton_WvRg"};function f(e){let{className:t}=e,{metadata:{authors:n},assets:i}=(0,a.nO)(),[s,c]=(0,l.useState)(!1);if(0===n.length)return null;let u=n.slice(0,s?n.length:10);return(0,r.jsxs)("div",{className:(0,o.Z)("margin-top--md margin-bottom--sm",h.imageOnlyAuthorRow,t),children:[u.map((e,t)=>(0,r.jsx)("div",{className:h.imageOnlyAuthorCol,children:(0,r.jsx)(d,{author:{...e,imageURL:i.authorsImageUrls[t]??e.imageURL}})},t)),n.length>10&&(0,r.jsx)("button",{className:(0,o.Z)("clean-btn",h.toggleButton),type:"button",onClick:()=>c(e=>!e),"aria-label":"expand",children:(0,r.jsx)(m,{expanded:s})})]})}let g={changelogItemTitleList:"changelogItemTitleList_sueG"};function x(){let{isBlogPostPage:e}=(0,a.nO)();return(0,r.jsx)(i.Z,{className:e?void 0:g.changelogItemTitleList})}function j(){return(0,r.jsxs)("header",{children:[(0,r.jsx)(x,{}),(0,r.jsx)(s.Z,{}),(0,r.jsx)(f,{})]})}var p=n(76460),v=n(90437);function b(e){let{children:t}=e;return(0,r.jsxs)(p.Z,{className:"changelogItemContainer_jeDt",children:[(0,r.jsx)(j,{}),(0,r.jsx)(v.Z,{children:t})]})}},70944:function(e,t,n){n.r(t),n.d(t,{default:()=>p});var r=n(85893);n(67294);var l=n(90496),a=n(77827),i=n(35363),s=n(57335),o=n(55951),c=n(5666),u=n(81061),d=n(9942),m=n(61420),h=n(65773);function f(e){let{nextItem:t,prevItem:n}=e;return(0,r.jsxs)("nav",{className:"pagination-nav docusaurus-mt-lg","aria-label":(0,a.I)({id:"theme.changelog.post.paginator.navAriaLabel",message:"Changelog item navigation",description:"The ARIA label for the changelog pagination"}),children:[n&&(0,r.jsx)(h.Z,{...n,subLabel:(0,r.jsx)(a.Z,{id:"theme.changelog.post.paginator.newerRelease",description:"The changelog button label to navigate to the newer release",children:"Newer release"})}),t&&(0,r.jsx)(h.Z,{...t,subLabel:(0,r.jsx)(a.Z,{id:"theme.changelog.post.paginator.olderRelease",description:"The changelog button label to navigate to the older release",children:"Older release"}),isNext:!0})]})}var g=n(4458);function x(){let{metadata:e}=(0,c.nO)(),{listPageLink:t}=e;return(0,r.jsx)(i.Z,{to:t,children:(0,r.jsx)(a.Z,{id:"changelog.backLink",children:"\u2190 Back to index page"})})}function j(e){let{sidebar:t,children:n}=e,{metadata:l,toc:a}=(0,c.nO)(),{nextItem:i,prevItem:s,frontMatter:o}=l,{hide_table_of_contents:u,toc_min_heading_level:h,toc_max_heading_level:j}=o;return(0,r.jsxs)(d.Z,{sidebar:t,toc:!u&&a.length>0?(0,r.jsx)(g.Z,{toc:a,minHeadingLevel:h,maxHeadingLevel:j}):void 0,children:[(0,r.jsx)(x,{}),(0,r.jsx)(m.Z,{children:n}),(i||s)&&(0,r.jsx)(f,{nextItem:i,prevItem:s})]})}function p(e){let t=e.content;return(0,r.jsx)(c.n4,{content:e.content,isBlogPostPage:!0,children:(0,r.jsxs)(s.FG,{className:(0,l.Z)(o.k.wrapper.blogPages,o.k.page.blogPostPage),children:[(0,r.jsx)(u.Z,{}),(0,r.jsx)(j,{sidebar:e.sidebar,children:(0,r.jsx)(t,{})})]})})}},27817:function(e,t,n){n.d(t,{Z:()=>eg});var r={};n.r(r),n.d(r,{ButtonExample:()=>ed});var l=n(85893),a=n(67294),i=n(71607),s=n(90496),o=n(45245),c=n(26378);function u(){let{prism:e}=(0,c.L)(),{colorMode:t}=(0,o.I)(),n=e.theme,r=e.darkTheme||n;return"dark"===t?r:n}var d=n(55951),m=n(6324),h=n.n(m),f=n(50923);let g=/title=(? ["'])(?.*?)\1/,x=/\{(? [\d,-]+)\}/,j={js:{start:"\\/\\/",end:""},jsBlock:{start:"\\/\\*",end:"\\*\\/"},jsx:{start:"\\{\\s*\\/\\*",end:"\\*\\/\\s*\\}"},bash:{start:"#",end:""},html:{start:"\x3c!--",end:"--\x3e"}},p={...j,lua:{start:"--",end:""},wasm:{start:"\\;\\;",end:""},tex:{start:"%",end:""},vb:{start:"['\u2018\u2019]",end:""},vbnet:{start:"(?:_\\s*)?['\u2018\u2019]",end:""},rem:{start:"[Rr][Ee][Mm]\\b",end:""},f90:{start:"!",end:""},ml:{start:"\\(\\*",end:"\\*\\)"},cobol:{start:"\\*>",end:""}},v=Object.keys(j);function b(e,t){let n=e.map(e=>{let{start:n,end:r}=p[e];return`(?:${n}\\s*(${t.flatMap(e=>[e.line,e.block?.start,e.block?.end].filter(Boolean)).join("|")})\\s*${r})`}).join("|");return RegExp(`^\\s*(?:${n})\\s*$`)}let N=(0,a.createContext)(null);function y(e){let{metadata:t,wordWrap:n,children:r}=e,i=(0,a.useMemo)(()=>({metadata:t,wordWrap:n}),[t,n]);return(0,l.jsx)(N.Provider,{value:i,children:r})}function k(){let e=(0,a.useContext)(N);if(null===e)throw new f.i6("CodeBlockContextProvider");return e}function Z(e){let{as:t,...n}=e,r=function(e){let t={color:"--prism-color",backgroundColor:"--prism-background-color"},n={};return Object.entries(e.plain).forEach(e=>{let[r,l]=e,a=t[r];a&&"string"==typeof l&&(n[a]=l)}),n}(u());return(0,l.jsx)(t,{...n,style:r,className:(0,s.Z)(n.className,"codeBlockContainer_jDV4",d.k.common.codeBlock)})}let w={codeBlock:"codeBlock_Gebt",codeBlockStandalone:"codeBlockStandalone_i_cY",codeBlockLines:"codeBlockLines_FJaf",codeBlockLinesWithNumbering:"codeBlockLinesWithNumbering_FU9Q"};function _(e){let{children:t,className:n}=e;return(0,l.jsx)(Z,{as:"pre",tabIndex:0,className:(0,s.Z)(w.codeBlockStandalone,"thin-scrollbar",n),children:(0,l.jsx)("code",{className:w.codeBlockLines,children:t})})}let C={attributes:!0,characterData:!0,childList:!0,subtree:!0};function L(e){let{children:t}=e;return t}var B=n(7316);function I(e){let{line:t,token:n,...r}=e;return(0,l.jsx)("span",{...r})}let E={codeLine:"codeLine_qRmp",codeLineNumber:"codeLineNumber_dS_J",codeLineContent:"codeLineContent_XF5l"};function T(e){let{line:t,classNames:n,showLineNumbers:r,getLineProps:a,getTokenProps:i}=e,o=function(e){let t=1===e.length&&"\n"===e[0].content?e[0]:void 0;return t?[{...t,content:""}]:e}(t),c=a({line:o,className:(0,s.Z)(n,r&&E.codeLine)}),u=o.map((e,t)=>{let n=i({token:e});return(0,l.jsx)(I,{...n,line:o,token:e,children:n.children},t)});return(0,l.jsxs)("span",{...c,children:[r?(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)("span",{className:E.codeLineNumber}),(0,l.jsx)("span",{className:E.codeLineContent,children:u})]}):u,(0,l.jsx)("br",{})]})}let M=a.forwardRef((e,t)=>(0,l.jsx)("pre",{ref:t,tabIndex:0,...e,className:(0,s.Z)(e.className,w.codeBlock,"thin-scrollbar")}));function A(e){let{metadata:t}=k();return(0,l.jsx)("code",{...e,className:(0,s.Z)(e.className,w.codeBlockLines,void 0!==t.lineNumbersStart&&w.codeBlockLinesWithNumbering),style:{...e.style,counterReset:void 0===t.lineNumbersStart?void 0:`line-count ${t.lineNumbersStart-1}`}})}function R(e){let{className:t}=e,{metadata:n,wordWrap:r}=k(),a=u(),{code:i,language:o,lineNumbersStart:c,lineClassNames:d}=n;return(0,l.jsx)(B.y$,{theme:a,code:i,language:o,children:e=>{let{className:n,style:a,tokens:i,getLineProps:o,getTokenProps:u}=e;return(0,l.jsx)(M,{ref:r.codeBlockRef,className:(0,s.Z)(t,n),style:a,children:(0,l.jsx)(A,{children:i.map((e,t)=>(0,l.jsx)(T,{line:e,getLineProps:o,getTokenProps:u,classNames:d[t],showLineNumbers:void 0!==c},t))})})}})}var H=n(56497),O=n(44771),$=n(77827);function z(e){let{className:t,...n}=e;return(0,l.jsx)("button",{type:"button",...n,className:(0,s.Z)("clean-btn",t)})}function P(e){return(0,l.jsx)("svg",{viewBox:"0 0 24 24",...e,children:(0,l.jsx)("path",{fill:"currentColor",d:"M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"})})}function S(e){return(0,l.jsx)("svg",{viewBox:"0 0 24 24",...e,children:(0,l.jsx)("path",{fill:"currentColor",d:"M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"})})}let F={copyButtonCopied:"copyButtonCopied_wDuR",copyButtonIcons:"copyButtonIcons_gMWc",copyButtonIcon:"copyButtonIcon_GXfb",copyButtonSuccessIcon:"copyButtonSuccessIcon_ktUX"};function D(e){let{className:t}=e,{copyCode:n,isCopied:r}=function(){let{metadata:{code:e}}=k(),[t,n]=(0,a.useState)(!1),r=(0,a.useRef)(void 0),l=(0,a.useCallback)(()=>{(0,O.Z)(e),n(!0),r.current=window.setTimeout(()=>{n(!1)},1e3)},[e]);return(0,a.useEffect)(()=>()=>window.clearTimeout(r.current),[]),{copyCode:l,isCopied:t}}();return(0,l.jsx)(z,{"aria-label":r?(0,$.I)({id:"theme.CodeBlock.copied",message:"Copied",description:"The copied button label on code blocks"}):(0,$.I)({id:"theme.CodeBlock.copyButtonAriaLabel",message:"Copy code to clipboard",description:"The ARIA label for copy code blocks button"}),title:(0,$.I)({id:"theme.CodeBlock.copy",message:"Copy",description:"The copy button label on code blocks"}),className:(0,s.Z)(t,F.copyButton,r&&F.copyButtonCopied),onClick:n,children:(0,l.jsxs)("span",{className:F.copyButtonIcons,"aria-hidden":"true",children:[(0,l.jsx)(P,{className:F.copyButtonIcon}),(0,l.jsx)(S,{className:F.copyButtonSuccessIcon})]})})}function U(e){return(0,l.jsx)("svg",{viewBox:"0 0 24 24",...e,children:(0,l.jsx)("path",{fill:"currentColor",d:"M4 19h6v-2H4v2zM20 5H4v2h16V5zm-3 6H4v2h13.25c1.1 0 2 .9 2 2s-.9 2-2 2H15v-2l-3 3l3 3v-2h2c2.21 0 4-1.79 4-4s-1.79-4-4-4z"})})}let W={wordWrapButtonIcon:"wordWrapButtonIcon___5r",wordWrapButtonEnabled:"wordWrapButtonEnabled_nam_"};function V(e){let{className:t}=e,{wordWrap:n}=k();if(!(n.isEnabled||n.isCodeScrollable))return!1;let r=(0,$.I)({id:"theme.CodeBlock.wordWrapToggle",message:"Toggle word wrap",description:"The title attribute for toggle word wrapping button of code block lines"});return(0,l.jsx)(z,{onClick:()=>n.toggle(),className:(0,s.Z)(t,n.isEnabled&&W.wordWrapButtonEnabled),"aria-label":r,title:r,children:(0,l.jsx)(U,{className:W.wordWrapButtonIcon,"aria-hidden":"true"})})}function G(e){let{className:t}=e;return(0,l.jsx)(H.Z,{children:()=>(0,l.jsxs)("div",{className:(0,s.Z)(t,"buttonGroup_KXnS"),children:[(0,l.jsx)(V,{}),(0,l.jsx)(D,{})]})})}let q={codeBlockContent:"codeBlockContent_cKMj",codeBlockTitle:"codeBlockTitle_U6Q0"};function X(e){let{className:t}=e,{metadata:n}=k();return(0,l.jsxs)(Z,{as:"div",className:(0,s.Z)(t,n.className),children:[n.title&&(0,l.jsx)("div",{className:q.codeBlockTitle,children:(0,l.jsx)(L,{children:n.title})}),(0,l.jsxs)("div",{className:q.codeBlockContent,children:[(0,l.jsx)(R,{}),(0,l.jsx)(G,{})]})]})}function Q(e){let t=function(e){let{prism:t}=(0,c.L)();return function(e){var t,n,r;let l=(n=(t={language:e.language,defaultLanguage:e.defaultLanguage,className:e.className}).language??function(e){if(!e)return;let t=e.split(" ").find(e=>e.startsWith("language-"));return t?.replace(/language-/,"")}(t.className)??t.defaultLanguage,n?.toLowerCase()??"text"),{lineClassNames:a,code:i}=function(e,t){let n=e.replace(/\r?\n$/,"");return function(e,t){let{metastring:n,magicComments:r}=t;if(n&&x.test(n)){let t=n.match(x).groups.range;if(0===r.length)throw Error(`A highlight range has been given in code block's metastring (\`\`\` ${n}), but no magic comment config is available. Docusaurus applies the first magic comment entry's className for metastring ranges.`);let l=r[0].className;return{lineClassNames:Object.fromEntries(h()(t).filter(e=>e>0).map(e=>[e-1,[l]])),code:e}}return null}(n,{...t})??function(e,t){let{language:n,magicComments:r}=t;if(void 0===n)return{lineClassNames:{},code:e};let l=function(e,t){switch(e){case"js":case"javascript":case"ts":case"typescript":return b(["js","jsBlock"],t);case"jsx":case"tsx":return b(["js","jsBlock","jsx"],t);case"html":return b(["js","jsBlock","html"],t);case"python":case"py":case"bash":return b(["bash"],t);case"markdown":case"md":return b(["html","jsx","bash"],t);case"tex":case"latex":case"matlab":return b(["tex"],t);case"lua":case"haskell":return b(["lua"],t);case"sql":return b(["lua","jsBlock"],t);case"wasm":return b(["wasm"],t);case"vb":case"vba":case"visual-basic":return b(["vb","rem"],t);case"vbnet":return b(["vbnet","rem"],t);case"batch":return b(["rem"],t);case"basic":return b(["rem","f90"],t);case"fsharp":return b(["js","ml"],t);case"ocaml":case"sml":return b(["ml"],t);case"fortran":return b(["f90"],t);case"cobol":return b(["cobol"],t);default:return b(v,t)}}(n,r),a=e.split(/\r?\n/),i=Object.fromEntries(r.map(e=>[e.className,{start:0,range:""}])),s=Object.fromEntries(r.filter(e=>e.line).map(e=>{let{className:t,line:n}=e;return[n,t]})),o=Object.fromEntries(r.filter(e=>e.block).map(e=>{let{className:t,block:n}=e;return[n.start,t]})),c=Object.fromEntries(r.filter(e=>e.block).map(e=>{let{className:t,block:n}=e;return[n.end,t]}));for(let e=0;e void 0!==e);s[n]?i[s[n]].range+=`${e},`:o[n]?i[o[n]].start=e:c[n]&&(i[c[n]].range+=`${i[c[n]].start}-${e-1},`),a.splice(e,1)}let u={};return Object.entries(i).forEach(e=>{let[t,{range:n}]=e;h()(n).forEach(e=>{u[e]??=[],u[e].push(t)})}),{code:a.join("\n"),lineClassNames:u}}(n,{...t})}(e.code,{metastring:e.metastring,magicComments:e.magicComments,language:l}),o=function(e){let{className:t,language:n}=e;return(0,s.Z)(t,n&&!t?.includes(`language-${n}`)&&`language-${n}`)}({className:e.className,language:l}),c=(r=e.metastring,(r?.match(g)?.groups.title??"")||e.title),u=function(e){let{showLineNumbers:t,metastring:n}=e;if("boolean"==typeof t)return t?1:void 0;if("number"==typeof t)return t;let r=n?.split(" ").find(e=>e.startsWith("showLineNumbers"));if(r)return r.startsWith("showLineNumbers=")?parseInt(r.replace("showLineNumbers=",""),10):1}({showLineNumbers:e.showLineNumbers,metastring:e.metastring});return{codeInput:e.code,code:i,className:o,language:l,title:c,lineNumbersStart:u,lineClassNames:a}}({code:e.children,className:e.className,metastring:e.metastring,magicComments:t.magicComments,defaultLanguage:t.defaultLanguage,language:e.language,title:e.title,showLineNumbers:e.showLineNumbers})}(e),n=function(){let[e,t]=(0,a.useState)(!1),[n,r]=(0,a.useState)(!1),l=(0,a.useRef)(null),i=(0,a.useCallback)(()=>{let n=l.current.querySelector("code");e?n.removeAttribute("style"):(n.style.whiteSpace="pre-wrap",n.style.overflowWrap="anywhere"),t(e=>!e)},[l,e]),s=(0,a.useCallback)(()=>{let{scrollWidth:e,clientWidth:t}=l.current;r(e>t||l.current.querySelector("code").hasAttribute("style"))},[l]),[o,c]=(0,a.useState)(),u=(0,a.useCallback)(()=>{c(l.current?.closest("[role=tabpanel][hidden]"))},[l,c]);return(0,a.useEffect)(()=>{u()},[u]),!function(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:C,r=(0,f.zX)(t),l=(0,f.Ql)(n);(0,a.useEffect)(()=>{let t=new MutationObserver(r);return e&&t.observe(e,l),()=>t.disconnect()},[e,r,l])}(o,e=>{e.forEach(e=>{"attributes"===e.type&&"hidden"===e.attributeName&&(s(),u())})},{attributes:!0,characterData:!1,childList:!1,subtree:!1}),(0,a.useEffect)(()=>{s()},[e,s]),(0,a.useEffect)(()=>(window.addEventListener("resize",s,{passive:!0}),()=>{window.removeEventListener("resize",s)}),[s]),{codeBlockRef:l,isEnabled:e,isCodeScrollable:n,toggle:i}}();return(0,l.jsx)(y,{metadata:t,wordWrap:n,children:(0,l.jsx)(X,{})})}function Y(e){let{children:t,...n}=e,r=(0,i.Z)(),s=a.Children.toArray(t).some(e=>(0,a.isValidElement)(e))?t:Array.isArray(t)?t.join(""):t;return(0,l.jsx)("string"==typeof s?Q:_,{...n,children:s},String(r))}var J=n(10075);let K=e=>`${e};`;function ee(e){let{code:t,children:n,...r}=e,a=u(),i=r.metastring?.includes("noInline")??!1;return(0,l.jsx)(J.nu,{noInline:i,theme:a,...r,code:t?.replace(/\n$/,""),transformCode:r.transformCode??K,children:n})}function et(e){let{children:t}=e;return(0,l.jsx)("div",{className:"playgroundContainer_TDLX",children:t})}var en=n(85108),er=n(67490);function el(e){let{children:t}=e;return(0,l.jsx)("div",{className:(0,s.Z)("playgroundHeader_h_Hu"),children:t})}function ea(){return(0,l.jsx)("div",{children:"Loading..."})}function ei(){return(0,l.jsx)(H.Z,{fallback:(0,l.jsx)(ea,{}),children:()=>(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)(er.Z,{fallback:e=>(0,l.jsx)(en.Ac,{...e}),children:(0,l.jsx)(J.i5,{})}),(0,l.jsx)(J.IF,{})]})})}function es(){return(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)(el,{children:(0,l.jsx)($.Z,{id:"theme.Playground.result",description:"The result label of the live codeblocks",children:"Result"})}),(0,l.jsx)("div",{className:"playgroundPreview_u2xE",children:(0,l.jsx)(ei,{})})]})}function eo(){let e=(0,i.Z)();return(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)(el,{children:(0,l.jsx)($.Z,{id:"theme.Playground.liveEditor",description:"The live editor label of the live codeblocks",children:"Live Editor"})}),(0,l.jsx)(J.uz,{className:"playgroundEditor_uqZ4"},String(e))]})}function ec(){let{playgroundPosition:e}=(0,c.L)().liveCodeBlock;return(0,l.jsx)(l.Fragment,{children:"top"===e?(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)(es,{}),(0,l.jsx)(eo,{})]}):(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)(eo,{}),(0,l.jsx)(es,{})]})})}function eu(e){let{children:t,transformCode:n,...r}=e;return(0,l.jsx)(et,{children:(0,l.jsx)(ee,{code:t,...r,children:(0,l.jsx)(ec,{})})})}function ed(e){return(0,l.jsx)("button",{type:"button",...e,style:{backgroundColor:"white",color:"black",border:"solid red",borderRadius:20,padding:10,cursor:"pointer",...e.style}})}let em={React:a,...a,...r};function eh(e){return(0,l.jsx)(eu,{scope:em,...e})}function ef(e){return e.live?(0,l.jsx)(eh,{...e}):(0,l.jsx)(Y,{...e})}function eg(e){return(0,l.jsx)(ef,{...e})}}}]); \ No newline at end of file diff --git a/assets/js/01657c2b.5830feac.js b/assets/js/01657c2b.5830feac.js deleted file mode 100644 index 05176e8ce1..0000000000 --- a/assets/js/01657c2b.5830feac.js +++ /dev/null @@ -1 +0,0 @@ -(self.webpackChunkwebsite=self.webpackChunkwebsite||[]).push([["8623"],{64027:function(e,t,n){"use strict";n.d(t,{Z:()=>o});let o=n.p+"assets/images/oss_logo-25c7e8934a28d0f23722c77adb6e7da4.png"},65945:function(e,t,n){"use strict";n.d(t,{Z:()=>o});let o="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAQAAAABSCAYAAAC7QwouAAAACXBIWXMAAAsSAAALEgHS3X78AAASKklEQVR42u1dPXbbuhL+mJPeuisQswJTKzDdPhVWSlVmiqfWzApMr8BKqyZy81RGLlSHXoGkFYRewZVXwFdoEI0hAARJ/VHGdw5Prq+IHwKYDzODAeDleY5jozuYtADEAO4BPAOIZ6N+BgcHh73COzYBdAeTCMAQwIX00wOA4WzUX7lucnA4MwLoDiYhCf6l4bU30gbGrqscHM6AALqDiU+Cf1Mi2QuAZDbqp67LHBwaSADMzo8V6r7AM4DQ8PsTEYHzDzg47ACfDmjnL7B28l1oZvgvs1G/B8AnQVfhFsCiO5gkruscHE5cAyA7PwFwpXnlFUCkUu27g0lApoIpbTwb9aeuGx0cTogASN0f0oytwhvWHv7EIq8e5dU2+Afi2ai/cN3p4HBkAiD1PC6w4+Oyy3v7ytfBwRHAbgR/7zM1rSAkBZpFMhv1h65rHRwOQADHsNXr+BYcHBx2QABk5ycA7kx2PvYYzUerC0mB1hG5ZUMHhx0SQHcwiUnwjr5eL+0j0OEH1cf5BxwcqhIAqd5jw4y7JHX/4Kq3RYShCys+LoYAAvrvGOu4kKYhogckB+MPQQBNEi6LPQZHIykNfDaobJA0dKyl2PhsrunvpiFhmuZDg/vCjgAs1euT3LVn2GUocCrbjkMAv8v0mSMARwC7wqcCAcoMwv+MdfjuSdrWpI34ZP+rcAMKKyaic3BwPgALFXpnS2zeHAGpvwHeL+ktyUac5h3UXj4kE2YM87JhciQThmsAL/T3OcJpAKdMAIcMsvHmKBLILcLJO/UHjIUT8xjbjh0BOAI4Gj5bbtPdyTKaN0dR7IAKbQC/vfnaZs87qGyzk2D7hrDiKwC/u4NJ08KKAwCyGZPRYwOfHllgy6QpUx7PI6B/F/TYtnkLm1UF2zqryJejTPlngU+w26Yb70D4hU/hrmIWNwD+eHMkRCR1/AMJircdZxTleMoYA8gBzEmL4M8fEoigQAAW9K6cPtfMcLo0NuVxwkopzS8Aj5THv2R+tgoEf0zvynVeWc7KCb0rp/+X8q46vhJqt5zy95tAAG2N2v11NuqHdb3k3hyhN8cCwE8NySwBfAPwT96Bl3fgAfhK5KPCPYCMCKUOCaxmo34EoKMp66LGQDgUigbYFQma6jt6NOgvS5RXlObKkgQeDebfnWEmb9FvOjP1gsbHuIA07w3a7q2hzYrahjvMowoa0VEIQMbDbNT368bue3P43hxTw4B5A/At7yDIOxjnnY3qlXcwzTsIyVZ81XT0T2+O1JvXs5lno/5iNuqHRDpvDdPgplivxjxQ/a/p+cG+5QLbcQYtSUieKd0/RIgij9SQ5oHe9+jfJ1aezdh5pjr/A+AL5SdwCXVsxJiNpVeaOL5Qnb+xb77VaAIxI483KrNDeXylyUiUX2b8+4q2acQ5Fd5//vu/XBIIr6bgW4fmcqEvyNMq9LiOfwAAuoNJKs1M1wdwCIbYjxMwpplWlW9EGlmZMnl+TxoB5e33VRIC/tt3UvVNZbxKGk5Apo4QXl9hrxe9s2JjSOWIbJF509a8k0DtBFwwYmqUI3enR4KRWr4wCP8LgC95B7Gt8JNGMIR5Tf8WwGIX/oETcOalhqeMT2JRoK4K2K7q2KQZGhxsNnUbslm8LRFAJL230uT7zDSRnlT/C6Z9qIh9JX1Dz6Jd+JL5m2Wa8yIAb47AmyOlWUXnU7jOOwirztJ5B6u8g7jAZr8nIug1lAAuaJbUPbsiN9+SKGRyKkqTad5HReLyNfmZtLJUkyaw/Oa0xDf08N6pHaJhqwifdyD8PbJ/LjR2fkIz+E6Qd7AAEFK5qgNI2gB+eXN8yzuN26zxVjA4VwqVNVQM7iKhvtQIbRE51dE6bMFNhZAJpC0BLDQCHFZIf1VAojH7+zsauMHpc03hDwzC/wSUU/VLEsEUwNSbI4F6Tf+nNwcaRgKLEvZjBPNeh9c91vMYt8lcnFhf3UpjvZGnUNU1AaaKjnkB0Mk7iPYl/BIRJNCv6Q8p6vDc4GN7WfUFGy82oI92dHCorwHQzCsPsh9kpx8URDQR80PwWSMB6sUMnCB4Gz/T960k1Vdel94lHizeyc5cdp6wcSyK2IHxhyEAhVA9H0P4JSIY0yrAI1fVvHn9JcITA7dtVR7xBfkH7g3mQZv5EcpqasmetRuVPf7CbPLAYG/7GhJaSOlTi/TLAoKLsI5kBE08Nv6X5psAFHzTNsxKthAxA1NquJwaNqVB5lcggaHC/u3hfFFlwGUaMjHhpUKauuSWVahzqGmbRc30OhOYL02nQLOWoav6AELF7J+VFPyEOvUR6zj/S2a7XtHs9QfVYrOHBfU9J1QRxqlBk7NJE++pzgHer6kvNOUnhnHV06SZShOCb2FepZbm2JKZnNOPQAB1ZiERz22Kx+a4JaKoEwRzbgd+LAqEMSqwR6dS+8ZSG7UUQqJKoxPAIlv4kd7xJeEfa8oTfy/ZJDFVpE/ZmHqStIYVm62FoIaS6j/F+1BjW5s+xCaA6QoNWhH4dODyhPBflkx3gfKRcOcMPsBumNmUkhmlC8ji6vSDJJD/MjPsX7JtIynNNylNzspdsXS3FubbLWl4K3rm0uyvI7Y39t1/qF5y+qUmfYL38f5iB2FGed2w8suYjSvp/Ts0xPF8aAIYK4RfbMq4xnpjSQfroIpXBQlMz3A2rwJZGIXZdMVmrweYnVgJvcM3QMl94yv675uURpTLtbnXgn7im7wuFGlD6EN9Q2wvd8rLobr0K/rtRRpXbUX5ZX0rqUSqwyZMWJ8PWFaI7VOFl4rOEp7UIQ24W6mzY5zBSSzS916zAVqGTFOaeVrSQEyZ2mzy8ifUziqbONXYwGN6eooBnkHvCedmRkrlyXksLGzoBaUJFb6dqYXgChIQebRKlD9mbZJp2jOVynIEoLFVTUzPVb6WRBzRmRHACtWPx8oK7M2FZfnjCmVPUc7htdhBHjYEVaY+iwrtnVnUqzE4pAlwoxBuG4aUbam28wU4ODSLAELF7G/LlCtstnjq8nNwcDhxDUBWpcqqaxzOEejg0GACcHBw+MAE4Jd8P1CYBQ4ODg0hANneb5ew4+VVAJVJ4ODgcOIagOzIKzr/XWAs/f2GZt4q4+DwoQlAXq++RPHuqbFi9h+ecX/49H0ZNhdMiCfDOv7BOUDX2uOYTMFc8aTY3t/gcGQCSBVawCUb2AETgoj+v3wBxOsZE0BEps0d1HH8bdClKDjv7c027fSbxoZuM9kV1nsVfCfiZnw+QueleB9zLk7zLTq9RmzQOEcHYA/vTzJ6xTpCTnxri9pOxM3/wnrPxEfzhYSKdhpjs6zs0xMSYTpf0YkRgIjDlkkAFsIfnmmHyjfu6C7dSEj7EVrR9APOcLxdngs0ITf7H9AECCqQwA/L959hPgLKpj6rEx/UQpV9gX4b6Yp+43viow82XrlQF5mCmRPv/WkAU0llv/Hm8EucCrTC2kkjdqKJ3WhtbE6CETsCq3RkrPA/NGFWs/FvDJkarDp8Q1wVvsLmbMBQIkWbXXNCO5F3ChbtmJPLB1PLeT7jCn17JdVjFyZFKI3LaUG9Qotx5bNvVV05HjKS4uZLwPqnqK6ifNOV5vJuy4zSZLUIIO9g4c3fHSwJJsxlkFG6nTn26B7BtoKwTlX9vyxZzykjgBsNQVyRfSzMBtlZdk/ahsmnksB8qGisqa8of0l5xFBfsHGP9dkC4xptV1WzC6juKmfrI5lhsSb/33y4GUhdtJ3qDkKRh7hENGF9+YLt48uGmrreY/sORUEWY+gPhfkhJsk6JoDccTfe/LjHItPdhI/S/3464ROBOTu/lNCelhbmVxv6K9nFbJoatAwu/Euq3yvL+xfMwVyX9I7pdp2fJc3HF81MXLbNU5hPTKp6RXgVTXUuEbkvfeMvFJ/uJAv/b5bmFdt3RtyJSbcyAdCFHPKJM7d0ZXdwYMH3iXx+Sj+94bTPDvAr+ilW0kxowgPW11979Fxjc6LPpcJcCrC57+4N69WGgKnw3w2TgApLbE58usb2NexltMZUIqkqPhB+mc2zom1eDW2za8gnIT1J43Us+cJ4XUV9E8PE/J2ZX4HU93cAwrpOwEjqTDGzzL353zP69yn4LbqgZIHtmAFgfTVZ1hACWFQkABPZfsXm9GUuRJHGByH7T2JFvYZsJm4XCPBXql+CzQEeU2nQlpnJ+e3BF0T44kbfwHK8tpk20VO0TU/6/n1rAU8kmD7eH+YaSLN4TzHbpxIp9qTvGyre5/0b1SIAcVGnggSEGpWRgO5D+HvYXEWuUnObeDmoLRaWGsDKMAtyLaClEciphfkXVCi/qgNPrCAtpVn0jlTpDOZoSZsrzuUrxsM992WkMcV6JTUtuS/Ghr7/29e1lwEZCWiv7PbmyHZ1ZTe7ilxnG4mryM9V+PdBIoHkOxDtuLKwO4Mj1DvA2oG4VPg9RLRkVCAgaYW2OZZ2mFqmCQ2+AU6igvzbOwkEYld2R8TAuiu7XwBEVdRyMieGGlVf2KtD8k2cO/w95RsoZtui944Vbz/G5m6BHgn8pWQeyDNh29LnkmLjBA0a2sememeirXYaCUh3803JzlBd2X0F4I83xw8Aie3twYYrwLkdFR/iNuI9olVxcKQVy+N35anqIM7NP3Vk2Cwlh/TvJVPzp6gXCNbUDUWPNi9tmQDdwSSpSQIrmoUDqK/sBtlsGa3ZmwQ/9ObIDHb+C6n7ta8i7w4mvSOwfXpEVfMcd8qleO+TusDH3jhVCJUGcN8dTCIA8WzUn9YgggzrK7vHEitz/8AjkUACIM07yEjVD6EPIBH2abILO787mATYBK8cY/aqovLtIiLOL6iP7nYdlU15ShDHnN/VUKVbJ/x9tvhuMzY+A1sRfX9t9u5g8gIgmo36WQ0iSAEE5B9QRaWJgBV488Ls3oS6t4MZ38ansDoAAYj2b9NgLWrrQBLS1Z4I6RLNPXhlZZg42owYMos2PtYGtIwRfRVtbWHTf5/oY+Urot7Z7N3BZEgCU8s/QI3+UDGLZwBB3rH3HRiEP4H6vAHuU/Bno/4hOt/m1luOWJO27Ax3pTFFlhW1kib4U/h3hob0vR34WOpiYVnXKt+3IYDZqL+ajfpWNnt3MIlrkoDwD3zB9uEgOizJzu/VDerpDiZhdzAp9CnMRv1oNuofSvXj69G3MEe3RYy03lC8h6JlQSLPhkEUN0Sw5XciDUmOJbJV5Rfi/SWlqUIzNAlZa0f+nFQiJJtvl699L0zj5Xm+JSQam52rUdFs1K/NjBQyHFGDXUlCvwAwzTv1N/J0BxOfOt/oU5iN+uMjDewE72Pvn6i+C6aSRpLG8l1DACn7zjdslssW2ESb8bLkzSo+vcuv2R7i/c4+ERocQL1D7UqTNxec34x0bWc44S+aYrOrLWX1CvF+GfqloH5iw1KKzc7HhH27qo15enFC1YqVL48xVRtwofMKSEBVVzEmAmqDaUGaqUROYjxFWwTAhEZns/OZI67jH9g3yGxJmENIhQcAwwPO+DqMDSaJykSJLAZN1XwibO+r0OEfyebeJwGUaSPdITIywe2jbd5Y/nUIQGxcMtVVbj/b7wOAb9pIQJoNTTb7DfkHkrr+gT0Jf0TseGcgsC+zUT85AeEXA+sbtq9FlzWVr7DfBPOs8e0A6y2hkUHQrmG+XvyNhOSQfT+F3a7JJyYIKueabzB3xXX1prb5Yeif79jd0qMpylZgVfL7OHFkWg1AoUIPod5/LhotPqIKXcaEWVJdU5wuhJrms4GQwc4jrZqBhbreQvEhElDMmOJZsefYx7OFkr0t6lTm21qsncV3pRXaJYPdzcF1wMuDZZkt1u+cEFOtD8BCuMbQ708+mnA1iaT2DBsV3MGhPAEwYYslZ4lKBUsO4R8g8yOG+VThH1Sfj3ClmCMAh/0SABO8xGBj/w3a2ZfgkZ2fGDSS2oFMjgAcHAGYhbAolPYVNcOKNaZIUlBmdOJ2viMAh+YTABNK0+GFYjaO60TXkZ2fwBy+m8xG/eEH7lNHAA6HJwAmpAkstu6WNQv2la+DgyOA3dvmVod3UAjy0TULBwdHAHtAHVv9GL4FBwdHAPshggiW3vpdag8ODg4nQADMLIgL7PhnrCO8jh5f4ODgCGA/RODDHLGn0xCSD7qs5+BwPgQg+QdMMftC3f8I4bsODh+LACT/gGrb8als03VwcARwIP/APRpwzoCDw7ng/++z7FyTnp4xAAAAAElFTkSuQmCC"},9939:function(e,t,n){"use strict";n.r(t),n.d(t,{frontMatter:()=>d,default:()=>m,contentTitle:()=>c,assets:()=>h,docusaurusRequire:()=>u,toc:()=>g,metadata:()=>o});var o=JSON.parse('{"id":"tests/images/index","title":"Image Tests","description":"URL encoded image","source":"@site/_dogfooding/_docs tests/tests/images/index.mdx","sourceDirName":"tests/images","slug":"/tests/images/","permalink":"/tests/docs/tests/images/","draft":false,"unlisted":false,"tags":[],"version":"current","lastUpdatedBy":"Ben McCann","lastUpdatedAt":1744155424000,"frontMatter":{"image":"./img/oss_logo.png"},"sidebar":"sidebar","previous":{"title":"Sample doc","permalink":"/tests/docs/tests/category-links/with-readme-doc/sample-doc"},"next":{"title":"Import Bad Package","permalink":"/tests/docs/tests/import-bad-package"}}'),s=n(85893),i=n(80980),r=n(11037),a=n(41949),l=n.n(a);let d={image:"./img/oss_logo.png"},c="Image Tests",h={image:n(64027).Z},u=n(41949),g=[{value:"Regular images",id:"regular-images",level:2},{value:"Ideal images",id:"ideal-images",level:2},{value:"CSS Image",id:"css-image",level:2}];function p(e){let t={h1:"h1",h2:"h2",header:"header",img:"img",p:"p",...(0,i.a)(),...e.components};return(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(t.header,{children:(0,s.jsx)(t.h1,{id:"image-tests",children:"Image Tests"})}),"\n","\n","\n","\n",(0,s.jsx)(t.p,{children:(0,s.jsx)(t.img,{alt:"URL encoded image",src:n(65945).Z+"",width:"256",height:"82"})}),"\n",(0,s.jsx)(t.h2,{id:"regular-images",children:"Regular images"}),"\n",(0,s.jsx)(t.p,{children:"Those only render in DEV when IdealImage plugin is disabled."}),"\n",(0,s.jsx)("img",{src:l()}),"\n",(0,s.jsx)("img",{src:u.default}),"\n",(0,s.jsx)(t.h2,{id:"ideal-images",children:"Ideal images"}),"\n",(0,s.jsx)(r.Z,{img:l()}),"\n",(0,s.jsx)(r.Z,{img:u}),"\n",(0,s.jsx)(t.h2,{id:"css-image",children:"CSS Image"}),"\n","\n",(0,s.jsx)(t.p,{children:"This should display a div with have a background image"}),"\n",(0,s.jsx)("div",{className:"dogfood-image-test-css",style:{border:"solid",height:"10rem"}})]})}function m(e={}){let{wrapper:t}={...(0,i.a)(),...e.components};return t?(0,s.jsx)(t,{...e,children:(0,s.jsx)(p,{...e})}):p(e)}m.displayName="MDXContent(_dogfooding/_docs tests/tests/images/index.mdx)"},41949:function(e,t,n){e.exports={src:{srcSet:n.p+"assets/ideal-img/docusaurus.30c6ff4.200.png 200w",images:[{path:n.p+"assets/ideal-img/docusaurus.30c6ff4.200.png",width:200,height:200}],src:n.p+"assets/ideal-img/docusaurus.30c6ff4.200.png",toString:function(){return n.p+"assets/ideal-img/docusaurus.30c6ff4.200.png"},placeholder:void 0,width:200,height:200},preSrc:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAoAAAAKCAYAAACNMs+9AAAACXBIWXMAAAsTAAALEwEAmpwYAAABm0lEQVR4nEXNP0hbQQDH8aM0RQoudlNwdZLg00IaffdCCDpoqlhSGzV3xxOz6FRq5w6BQkcVJIJYCFg6CILQQqGkgkjiu5fEf0QjBlETmyJaEKSm5n7yunT4bh9+P0IIIe2y73GgFG3u3h1rMJLGw6iMu6KIu+KQLgAPHENCu6FHdJOtepPhGz0VOaa2kB5rJNORemW3/RjcaV3rX27JP68ngfxEI7X5b/d8D559G1K+/BjC+28xeRBTbw4+4N3x7N/3p3NuErDNRn2TXfm2TOgWq1HJ1VLxq5KHhZp1WMB2oVgtnlbcxOtAya6MjIAhmfJaHHzPxMzZuFqoTCJx/vouUZrSiCfLmv7BrAC1uNItjhd7EXwsD+Ki5K9d3/Uh9nN4+v9iVkC3uPLbHJ/LIXzJdSO1ruOs0oscwj2ky+KdVPJLI2dCl0L5MgIjBYbh/VGspAO1i8texH5FZgmV7BOV3Lm9pZJVnbp2RDV4JKr2efBP+bof4ydskTxNR55402aHviE0J/+G0DxSaDOllxow0P79dtRNkrzuHtwg5HIaPwQEAAAAAElFTkSuQmCC"}},11037:function(e,t,n){"use strict";n.d(t,{Z:()=>ee});var o=n(85893),s=n(67294),i=n(77827);function r(e,t,n,o){return e.addEventListener(t,n,o),()=>e.removeEventListener(t,n,o)}function a(e){return"undefined"!=typeof window?(0,o.jsx)(l,{...e,children:e.children}):e.children}class l extends s.Component{static defaultProps={topOffset:0,bottomOffset:0,onEnter(){},onLeave(){}};scrollableAncestor;previousPosition=null;unsubscribe;innerRef=(0,s.createRef)();componentDidMount(){var e;let t;this.scrollableAncestor=function(e){let t=e;for(;t.parentNode&&(t=t.parentNode)!==document.body;){let e=window.getComputedStyle(t),n=e.getPropertyValue("overflow-y")||e.getPropertyValue("overflow");if("auto"===n||"scroll"===n||"overlay"===n)return t}return window}(this.innerRef.current);let n=r(this.scrollableAncestor,"scroll",this._handleScroll,{passive:!0}),o=r(window,"resize",this._handleScroll,{passive:!0}),s=(e=()=>{this._handleScroll()},t=!0,queueMicrotask(()=>{t&&e()}),()=>t=!1);this.unsubscribe=()=>{n(),o(),s()}}componentDidUpdate(){this._handleScroll()}componentWillUnmount(){this.unsubscribe?.()}_handleScroll=()=>{var e;let t=this.innerRef.current,{topOffset:n,bottomOffset:o,onEnter:s,onLeave:i}=this.props,r=(e=function(e){let t,n,{node:o,scrollableAncestor:s,topOffset:i,bottomOffset:r}=e,{top:a,bottom:l}=o.getBoundingClientRect();s===window?(t=window.innerHeight,n=0):(t=s.offsetHeight,n=s.getBoundingClientRect().top);let d=n+t;return{top:a,bottom:l,viewportTop:n+i,viewportBottom:d-r}}({node:t,scrollableAncestor:this.scrollableAncestor,topOffset:n,bottomOffset:o})).viewportBottom-e.viewportTop==0?"invisible":e.viewportTop<=e.top&&e.top<=e.viewportBottom||e.viewportTop<=e.bottom&&e.bottom<=e.viewportBottom||e.top<=e.viewportTop&&e.viewportBottom<=e.bottom?"inside":e.viewportBottom 1?s.join(" "):s[0],style:e}}let c="loading",h="loaded",u="error",g={load:"load",loading:c,loaded:h,error:u,noicon:"noicon",offline:"offline"},{load:p,loading:m,loaded:w,error:f,noicon:A,offline:v}=g;class b extends s.PureComponent{static defaultProps={iconColor:"#fff",iconSize:64};constructor(e){super(e),this.state={isMounted:!1}}componentDidMount(){this.setState({isMounted:!0}),this.props.onDimensions&&this.dimensionElement&&this.props.onDimensions({width:this.dimensionElement.clientWidth||this.dimensionElement.parentNode.clientWidth,height:this.dimensionElement.clientHeight||this.dimensionElement.parentNode.clientHeight})}renderIcon(e){let{icon:t,icons:n,iconColor:o,iconSize:i,theme:r}=e,a=n[t];if(!a)return null;let l=d({width:i+100,height:i,color:o},r.icon);return s.createElement("div",l,[s.createElement(a,{fill:o,size:i,key:"icon"}),s.createElement("br",{key:"br"}),this.props.message])}renderImage(e){return e.icon===w?(0,o.jsx)("img",{...d(e.theme.img),src:e.src,alt:e.alt,width:e.width,height:e.height}):(0,o.jsx)("svg",{...d(e.theme.img),width:e.width,height:e.height,ref:e=>this.dimensionElement=e})}renderNoscript(e){return this.state.isMounted?null:(0,o.jsx)("noscript",{children:(0,o.jsx)("img",{...d(e.theme.img,e.theme.noscript),src:e.nsSrc,srcSet:e.nsSrcSet,alt:e.alt,width:e.width,height:e.height})})}render(){let e,t=this.props,{placeholder:n,theme:s}=t;return e=t.icon===w?{}:n.lqip?{backgroundImage:`url("${n.lqip}")`}:{backgroundColor:n.color},(0,o.jsxs)("div",{...d(s.placeholder,e,t.style,t.className),onClick:this.props.onClick,onKeyPress:this.props.onClick,ref:this.props.innerRef,children:[this.renderImage(t),this.renderNoscript(t),this.renderIcon(t)]})}}class C{constructor(){this.signal={onabort:()=>{}},this.abort=()=>this.signal.onabort()}}let S=(e,t)=>(t=t||{},new Promise((n,o)=>{let s=new XMLHttpRequest;for(let n in s.open(t.method||"get",e,!0),t.headers)s.setRequestHeader(n,t.headers[n]);s.withCredentials="include"===t.credentials,s.onload=()=>{n(function e(){let t,n=[],o=[],i={};return s.getAllResponseHeaders().replace(/^(.*?):\s*?([\s\S]*?)$/gm,(e,s,r)=>{n.push(s=s.toLowerCase()),o.push([s,r]),t=i[s],i[s]=t?`${t},${r}`:r}),{ok:(s.status/100|0)==2,status:s.status,statusText:s.statusText,url:s.responseURL,clone:e,text:()=>Promise.resolve(s.responseText),json:()=>Promise.resolve(s.responseText).then(JSON.parse),blob:()=>Promise.resolve(new Blob([s.response])),headers:{keys:()=>n,entries:()=>o,get:e=>i[e.toLowerCase()],has:e=>e.toLowerCase()in i}}}())},s.onerror=o,t.signal&&(t.signal.onabort=()=>{s.onerror=s.onload=void 0,s.abort()}),s.send(t.body)})),x=(e,t)=>{if(!t)return e;let n=e.then(e=>e,e=>e);return n.cancel=()=>{e.cancel(),t.cancel()},n},I=e=>{let t,n=new Promise(n=>{t=setTimeout(n,e)});return n.cancel=()=>{clearTimeout(t),t=void 0},n},E=e=>{let t=new Image,n=new Promise((n,o)=>{t.onload=n,t.onabort=t.onerror=()=>o({}),t.src=e});return n.cancel=()=>{if(!t)throw Error("Already canceled");t.onload=t.onabort=t.onerror=void 0,t.src="",t=void 0},n},L=(e,t)=>{let n=new C,o=n.signal,s=new Promise((n,s)=>S(e,{...t,signal:o}).then(t=>{t.ok?t.blob().then(()=>E(e)).then(n):s({status:t.status})},s));return s.cancel=()=>{if(!n)throw Error("Already canceled");n.abort(),n=void 0},s},B="undefined"==typeof window||"ReactSnap"===window.navigator.userAgent,M=!B&&!!window.navigator.connection,k=(e,t)=>{let n;if(B)return 0;t||(t=window);let o=e.width,{screen:s}=t,i=s.width,r=s.height,{documentElement:a}=document,l=t.innerWidth||a.clientWidth,d=t.innerHeight||a.clientHeight,c=t.devicePixelRatio||1;if(i>l){let e=document.getElementsByTagName("body")[0],t=l-o;n=(e.clientHeight>d||e.clientHeight>r)&&t<=15?i-t:o/l*i}else n=o;return n*c},H=e=>{let t=["Bytes","KB","MB","GB","TB"];if(0===e)return"n/a";let n=parseInt(Math.floor(Math.log(e)/Math.log(1024)),10);return 0===n?`${e} ${t[n]}`:`${(e/1024**n).toFixed(1)} ${t[n]}`},V=(()=>{if(B)return!1;let e=document.createElement("canvas");return!!(e.getContext&&e.getContext("2d"))&&0===e.toDataURL("image/webp").indexOf("data:image/webp")})(),y=e=>"webp"===e.format||e.src&&e.src.match(/\.webp($|\?.*)/i),j=e=>{let t,n,{srcSet:o,maxImageWidth:s,supportsWebp:i}=e;if(0===o.length)throw Error("Need at least one item in srcSet");if(i)0===(t=o.filter(y)).length&&(t=o);else if(0===(t=o.filter(e=>!y(e))).length)throw Error("Need at least one supported format item in srcSet");let r=t.filter(e=>e.width>=s);return 0===r.length?(r=t,n=Math.max.apply(null,r.map(e=>e.width))):n=Math.min.apply(null,r.map(e=>e.width)),t.filter(e=>e.width===n)[0]},N=e=>{let{srcSet:t,getUrl:n}=e;if(!B)return{};let o=t.filter(e=>!y(e)),s=o[0];return{nsSrcSet:o.map(e=>`${n?n(e):e.src} ${e.width}w`).join(","),nsSrc:n?n(s):s.src,ssr:B}},{initial:O,loading:T,loaded:U,error:P}={initial:"initial",loading:c,loaded:h,error:u},D=e=>{let{connection:t,size:n,threshold:o,possiblySlowNetwork:s}=e;if(s)return!1;if(!t)return!0;let{downlink:i,rtt:r,effectiveType:a}=t;switch(a){case"slow-2g":case"2g":return!1;case"3g":if(i&&n&&o)return 8*n/(1e3*i)+r {switch(e){case g.noicon:case g.loaded:return null;case g.loading:return"Loading...";case g.load:let{pickedSrc:n}=t,{size:s}=n;if(s)return["Click to load (",(0,o.jsx)("nobr",{children:H(s)},"nb"),")"];return"Click to load";case g.offline:return"Your browser is offline. Image not loaded";case g.error:let{loadInfo:i}=t;if(404===i)return"404. Image not found";return"Error. Click to reload";default:throw Error(`Wrong icon: ${e}`)}},R=e=>{let{loadState:t,onLine:n,overThreshold:o,userTriggered:s}=e;if(B)return g.noicon;switch(t){case U:return g.loaded;case T:return o?g.loading:g.noicon;case O:if(!n)return g.offline;{let{shouldAutoDownload:t}=e;if(void 0===t)return g.noicon;return s||!t?g.load:g.noicon}case P:return n?g.error:g.offline;default:throw Error(`Wrong state: ${t}`)}};class z extends s.Component{constructor(e){super(e),this.state={loadState:O,connection:M?{downlink:navigator.connection.downlink,rtt:navigator.connection.rtt,effectiveType:navigator.connection.effectiveType}:null,onLine:!0,overThreshold:!1,inViewport:!1,userTriggered:!1,possiblySlowNetwork:!1}}static defaultProps={shouldAutoDownload:D,getMessage:J,getIcon:R,loader:"xhr"};componentDidMount(){M?(this.updateConnection=()=>{navigator.onLine&&this.state.loadState===O&&this.setState({connection:{effectiveType:navigator.connection.effectiveType,downlink:navigator.connection.downlink,rtt:navigator.connection.rtt}})},navigator.connection.addEventListener("onchange",this.updateConnection)):this.props.threshold&&(this.possiblySlowNetworkListener=e=>{if(this.state.loadState!==O)return;let{possiblySlowNetwork:t}=e.detail;!this.state.possiblySlowNetwork&&t&&this.setState({possiblySlowNetwork:t})},window.document.addEventListener("possiblySlowNetwork",this.possiblySlowNetworkListener)),this.updateOnlineStatus=()=>this.setState({onLine:navigator.onLine}),this.updateOnlineStatus(),window.addEventListener("online",this.updateOnlineStatus),window.addEventListener("offline",this.updateOnlineStatus)}componentWillUnmount(){this.clear(),M?navigator.connection.removeEventListener("onchange",this.updateConnection):this.props.threshold&&window.document.removeEventListener("possiblySlowNetwork",this.possiblySlowNetworkListener),window.removeEventListener("online",this.updateOnlineStatus),window.removeEventListener("offline",this.updateOnlineStatus)}onClick=()=>{let{loadState:e,onLine:t,overThreshold:n}=this.state;if(t)switch(e){case T:n&&this.cancel(!0);return;case U:return;case O:case P:this.load(!0);return;default:throw Error(`Wrong state: ${e}`)}};clear(){this.loader&&(this.loader.cancel(),this.loader=void 0)}cancel(e){T===this.state.loadState&&(this.clear(),this.loadStateChange(O,e))}loadStateChange(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;this.setState({loadState:e,overThreshold:!1,userTriggered:!!t,loadInfo:n})}load=e=>{let{loadState:t,url:n}=this.state;if(B||U===t||T===t)return;this.loadStateChange(T,e);let{threshold:o}=this.props,s="xhr"===this.props.loader?L(n):E(n);if(s.then(()=>{this.clear(),this.loadStateChange(U,!1)}).catch(e=>{this.clear(),404===e.status?this.loadStateChange(P,!1,404):this.loadStateChange(P,!1)}),o){let e=I(o);e.then(()=>{this.loader&&(window.document.dispatchEvent(new CustomEvent("possiblySlowNetwork",{detail:{possiblySlowNetwork:!0}})),this.setState({overThreshold:!0}),this.state.userTriggered||this.cancel(!0))}),this.loader=x(s,e)}else this.loader=s};onEnter=()=>{if(this.state.inViewport)return;this.setState({inViewport:!0});let e=j({srcSet:this.props.srcSet,maxImageWidth:this.props.srcSet.length>1?k(this.state.dimensions):0,supportsWebp:V}),{getUrl:t}=this.props,n=t?t(e):e.src,o=this.props.shouldAutoDownload({...this.state,size:e.size});this.setState({pickedSrc:e,shouldAutoDownload:o,url:n},()=>{o&&this.load(!1)})};onLeave=()=>{this.state.loadState!==T||this.state.userTriggered||(this.setState({inViewport:!1}),this.cancel(!1))};render(){let e=this.props.getIcon(this.state),t=this.props.getMessage(e,this.state);return(0,o.jsx)(a,{onEnter:this.onEnter,onLeave:this.onLeave,children:(0,o.jsx)(b,{...this.props,...N(this.props),onClick:this.onClick,icon:e,src:this.state.url||"",onDimensions:e=>this.setState({dimensions:e}),message:t})})}}let Q=e=>{let{size:t=24,fill:n="#000",className:s,path:i}=e;return(0,o.jsxs)("svg",{xmlns:"http://www.w3.org/2000/svg",width:t,height:t,viewBox:"0 0 24 24",className:s,children:[(0,o.jsx)("path",{d:"M0 0h24v24H0z",fill:"none"}),(0,o.jsx)("path",{fill:n,d:i})]})},{load:q,loading:G,loaded:Z,error:K,noicon:F,offline:Y}=g,X={[q]:e=>(0,o.jsx)(Q,{...e,path:"M19.35 10.04C18.67 6.59 15.64 4 12 4 9.11 4 6.6 5.64 5.35 8.04 2.34 8.36 0 10.91 0 14c0 3.31 2.69 6 6 6h13c2.76 0 5-2.24 5-5 0-2.64-2.05-4.78-4.65-4.96zM17 13l-5 5-5-5h3V9h4v4h3z"}),[G]:e=>(0,o.jsx)(Q,{...e,path:"M6,2V8H6V8L10,12L6,16V16H6V22H18V16H18V16L14,12L18,8V8H18V2H6M16,16.5V20H8V16.5L12,12.5L16,16.5M12,11.5L8,7.5V4H16V7.5L12,11.5Z"}),[Z]:null,[K]:e=>(0,o.jsx)(Q,{...e,path:"M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm1 15h-2v-2h2v2zm0-4h-2V7h2v6z"}),[F]:null,[Y]:e=>(0,o.jsx)(Q,{...e,path:"M19.35 10.04C18.67 6.59 15.64 4 12 4c-1.48 0-2.85.43-4.01 1.17l1.46 1.46C10.21 6.23 11.08 6 12 6c3.04 0 5.5 2.46 5.5 5.5v.5H19c1.66 0 3 1.34 3 3 0 1.13-.64 2.11-1.56 2.62l1.45 1.45C23.16 18.16 24 16.68 24 15c0-2.64-2.05-4.78-4.65-4.96zM3 5.27l2.75 2.74C2.56 8.15 0 10.77 0 14c0 3.31 2.69 6 6 6h11.73l2 2L21 20.73 4.27 4 3 5.27zM7.73 10l8 8H6c-2.21 0-4-1.79-4-4s1.79-4 4-4h1.73z"})},W={placeholder:{backgroundSize:"cover",backgroundRepeat:"no-repeat",position:"relative"},img:{width:"100%",height:"auto",maxWidth:"100%",marginBottom:"-4px"},icon:{position:"absolute",top:"50%",left:"50%",transform:"translate(-50%, -50%)",textAlign:"center"},noscript:{position:"absolute",top:0,left:0}},$=e=>{let{icons:t=X,theme:n=W,...s}=e;return(0,o.jsx)(z,{...s,icons:t,theme:n})};function _(e,t){switch(e){case"noicon":case"loaded":return null;case"loading":return(0,i.I)({id:"theme.IdealImageMessage.loading",message:"Loading...",description:"When the full-scale image is loading"});case"load":{let{pickedSrc:e}=t,{size:n}=e,o=n?` (${function(e){let t=["B","KB","MB","GB","TB"];if(0===e)return"n/a";let n=Math.floor(Math.log(e)/Math.log(1024));return 0===n?`${e} ${t[n]}`:`${(e/1024**n).toFixed(1)} ${t[n]}`}(n)})`:"";return(0,i.I)({id:"theme.IdealImageMessage.load",message:"Click to load{sizeMessage}",description:"To prompt users to load the full image. sizeMessage is a parenthesized size figure."},{sizeMessage:o})}case"offline":return(0,i.I)({id:"theme.IdealImageMessage.offline",message:"Your browser is offline. Image not loaded",description:"When the user is viewing an offline document"});case"error":{let{loadInfo:e}=t;if(404===e)return(0,i.I)({id:"theme.IdealImageMessage.404error",message:"404. Image not found",description:"When the image is not found"});return(0,i.I)({id:"theme.IdealImageMessage.error",message:"Error. Click to reload",description:"When the image fails to load for unknown error"})}default:throw Error(`Wrong icon: ${e}`)}}function ee(e){let{img:t,...n}=e;return"string"==typeof t||"default"in t?(0,o.jsx)("img",{src:"string"==typeof t?t:t.default,...n}):(0,o.jsx)($,{height:t.src.height??100,width:t.src.width??100,placeholder:{lqip:t.preSrc},src:t.src.src,srcSet:t.src.images.map(e=>({...e,src:e.path})),getMessage:_})}},80980:function(e,t,n){"use strict";n.d(t,{Z:()=>a,a:()=>r});var o=n(67294);let s={},i=o.createContext(s);function r(e){let t=o.useContext(i);return o.useMemo(function(){return"function"==typeof e?e(t):{...t,...e}},[t,e])}function a(e){let t;return t=e.disableParentContext?"function"==typeof e.components?e.components(s):e.components||s:r(e.components),o.createElement(i.Provider,{value:t},e.children)}}}]); \ No newline at end of file diff --git a/assets/js/01657c2b.69145e60.js b/assets/js/01657c2b.69145e60.js new file mode 100644 index 0000000000..7aec399f9b --- /dev/null +++ b/assets/js/01657c2b.69145e60.js @@ -0,0 +1 @@ +(self.webpackChunkwebsite=self.webpackChunkwebsite||[]).push([["8623"],{64027:function(e,t,n){"use strict";n.d(t,{Z:()=>o});let o=n.p+"assets/images/oss_logo-25c7e8934a28d0f23722c77adb6e7da4.png"},65945:function(e,t,n){"use strict";n.d(t,{Z:()=>o});let o="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAQAAAABSCAYAAAC7QwouAAAACXBIWXMAAAsSAAALEgHS3X78AAASKklEQVR42u1dPXbbuhL+mJPeuisQswJTKzDdPhVWSlVmiqfWzApMr8BKqyZy81RGLlSHXoGkFYRewZVXwFdoEI0hAARJ/VHGdw5Prq+IHwKYDzODAeDleY5jozuYtADEAO4BPAOIZ6N+BgcHh73COzYBdAeTCMAQwIX00wOA4WzUX7lucnA4MwLoDiYhCf6l4bU30gbGrqscHM6AALqDiU+Cf1Mi2QuAZDbqp67LHBwaSADMzo8V6r7AM4DQ8PsTEYHzDzg47ACfDmjnL7B28l1oZvgvs1G/B8AnQVfhFsCiO5gkruscHE5cAyA7PwFwpXnlFUCkUu27g0lApoIpbTwb9aeuGx0cTogASN0f0oytwhvWHv7EIq8e5dU2+Afi2ai/cN3p4HBkAiD1PC6w4+Oyy3v7ytfBwRHAbgR/7zM1rSAkBZpFMhv1h65rHRwOQADHsNXr+BYcHBx2QABk5ycA7kx2PvYYzUerC0mB1hG5ZUMHhx0SQHcwiUnwjr5eL+0j0OEH1cf5BxwcqhIAqd5jw4y7JHX/4Kq3RYShCys+LoYAAvrvGOu4kKYhogckB+MPQQBNEi6LPQZHIykNfDaobJA0dKyl2PhsrunvpiFhmuZDg/vCjgAs1euT3LVn2GUocCrbjkMAv8v0mSMARwC7wqcCAcoMwv+MdfjuSdrWpI34ZP+rcAMKKyaic3BwPgALFXpnS2zeHAGpvwHeL+ktyUac5h3UXj4kE2YM87JhciQThmsAL/T3OcJpAKdMAIcMsvHmKBLILcLJO/UHjIUT8xjbjh0BOAI4Gj5bbtPdyTKaN0dR7IAKbQC/vfnaZs87qGyzk2D7hrDiKwC/u4NJ08KKAwCyGZPRYwOfHllgy6QpUx7PI6B/F/TYtnkLm1UF2zqryJejTPlngU+w26Yb70D4hU/hrmIWNwD+eHMkRCR1/AMJircdZxTleMoYA8gBzEmL4M8fEoigQAAW9K6cPtfMcLo0NuVxwkopzS8Aj5THv2R+tgoEf0zvynVeWc7KCb0rp/+X8q46vhJqt5zy95tAAG2N2v11NuqHdb3k3hyhN8cCwE8NySwBfAPwT96Bl3fgAfhK5KPCPYCMCKUOCaxmo34EoKMp66LGQDgUigbYFQma6jt6NOgvS5RXlObKkgQeDebfnWEmb9FvOjP1gsbHuIA07w3a7q2hzYrahjvMowoa0VEIQMbDbNT368bue3P43hxTw4B5A/At7yDIOxjnnY3qlXcwzTsIyVZ81XT0T2+O1JvXs5lno/5iNuqHRDpvDdPgplivxjxQ/a/p+cG+5QLbcQYtSUieKd0/RIgij9SQ5oHe9+jfJ1aezdh5pjr/A+AL5SdwCXVsxJiNpVeaOL5Qnb+xb77VaAIxI483KrNDeXylyUiUX2b8+4q2acQ5Fd5//vu/XBIIr6bgW4fmcqEvyNMq9LiOfwAAuoNJKs1M1wdwCIbYjxMwpplWlW9EGlmZMnl+TxoB5e33VRIC/tt3UvVNZbxKGk5Apo4QXl9hrxe9s2JjSOWIbJF509a8k0DtBFwwYmqUI3enR4KRWr4wCP8LgC95B7Gt8JNGMIR5Tf8WwGIX/oETcOalhqeMT2JRoK4K2K7q2KQZGhxsNnUbslm8LRFAJL230uT7zDSRnlT/C6Z9qIh9JX1Dz6Jd+JL5m2Wa8yIAb47AmyOlWUXnU7jOOwirztJ5B6u8g7jAZr8nIug1lAAuaJbUPbsiN9+SKGRyKkqTad5HReLyNfmZtLJUkyaw/Oa0xDf08N6pHaJhqwifdyD8PbJ/LjR2fkIz+E6Qd7AAEFK5qgNI2gB+eXN8yzuN26zxVjA4VwqVNVQM7iKhvtQIbRE51dE6bMFNhZAJpC0BLDQCHFZIf1VAojH7+zsauMHpc03hDwzC/wSUU/VLEsEUwNSbI4F6Tf+nNwcaRgKLEvZjBPNeh9c91vMYt8lcnFhf3UpjvZGnUNU1AaaKjnkB0Mk7iPYl/BIRJNCv6Q8p6vDc4GN7WfUFGy82oI92dHCorwHQzCsPsh9kpx8URDQR80PwWSMB6sUMnCB4Gz/T960k1Vdel94lHizeyc5cdp6wcSyK2IHxhyEAhVA9H0P4JSIY0yrAI1fVvHn9JcITA7dtVR7xBfkH7g3mQZv5EcpqasmetRuVPf7CbPLAYG/7GhJaSOlTi/TLAoKLsI5kBE08Nv6X5psAFHzTNsxKthAxA1NquJwaNqVB5lcggaHC/u3hfFFlwGUaMjHhpUKauuSWVahzqGmbRc30OhOYL02nQLOWoav6AELF7J+VFPyEOvUR6zj/S2a7XtHs9QfVYrOHBfU9J1QRxqlBk7NJE++pzgHer6kvNOUnhnHV06SZShOCb2FepZbm2JKZnNOPQAB1ZiERz22Kx+a4JaKoEwRzbgd+LAqEMSqwR6dS+8ZSG7UUQqJKoxPAIlv4kd7xJeEfa8oTfy/ZJDFVpE/ZmHqStIYVm62FoIaS6j/F+1BjW5s+xCaA6QoNWhH4dODyhPBflkx3gfKRcOcMPsBumNmUkhmlC8ji6vSDJJD/MjPsX7JtIynNNylNzspdsXS3FubbLWl4K3rm0uyvI7Y39t1/qF5y+qUmfYL38f5iB2FGed2w8suYjSvp/Ts0xPF8aAIYK4RfbMq4xnpjSQfroIpXBQlMz3A2rwJZGIXZdMVmrweYnVgJvcM3QMl94yv675uURpTLtbnXgn7im7wuFGlD6EN9Q2wvd8rLobr0K/rtRRpXbUX5ZX0rqUSqwyZMWJ8PWFaI7VOFl4rOEp7UIQ24W6mzY5zBSSzS916zAVqGTFOaeVrSQEyZ2mzy8ifUziqbONXYwGN6eooBnkHvCedmRkrlyXksLGzoBaUJFb6dqYXgChIQebRKlD9mbZJp2jOVynIEoLFVTUzPVb6WRBzRmRHACtWPx8oK7M2FZfnjCmVPUc7htdhBHjYEVaY+iwrtnVnUqzE4pAlwoxBuG4aUbam28wU4ODSLAELF7G/LlCtstnjq8nNwcDhxDUBWpcqqaxzOEejg0GACcHBw+MAE4Jd8P1CYBQ4ODg0hANneb5ew4+VVAJVJ4ODgcOIagOzIKzr/XWAs/f2GZt4q4+DwoQlAXq++RPHuqbFi9h+ecX/49H0ZNhdMiCfDOv7BOUDX2uOYTMFc8aTY3t/gcGQCSBVawCUb2AETgoj+v3wBxOsZE0BEps0d1HH8bdClKDjv7c027fSbxoZuM9kV1nsVfCfiZnw+QueleB9zLk7zLTq9RmzQOEcHYA/vTzJ6xTpCTnxri9pOxM3/wnrPxEfzhYSKdhpjs6zs0xMSYTpf0YkRgIjDlkkAFsIfnmmHyjfu6C7dSEj7EVrR9APOcLxdngs0ITf7H9AECCqQwA/L959hPgLKpj6rEx/UQpV9gX4b6Yp+43viow82XrlQF5mCmRPv/WkAU0llv/Hm8EucCrTC2kkjdqKJ3WhtbE6CETsCq3RkrPA/NGFWs/FvDJkarDp8Q1wVvsLmbMBQIkWbXXNCO5F3ChbtmJPLB1PLeT7jCn17JdVjFyZFKI3LaUG9Qotx5bNvVV05HjKS4uZLwPqnqK6ifNOV5vJuy4zSZLUIIO9g4c3fHSwJJsxlkFG6nTn26B7BtoKwTlX9vyxZzykjgBsNQVyRfSzMBtlZdk/ahsmnksB8qGisqa8of0l5xFBfsHGP9dkC4xptV1WzC6juKmfrI5lhsSb/33y4GUhdtJ3qDkKRh7hENGF9+YLt48uGmrreY/sORUEWY+gPhfkhJsk6JoDccTfe/LjHItPdhI/S/3464ROBOTu/lNCelhbmVxv6K9nFbJoatAwu/Euq3yvL+xfMwVyX9I7pdp2fJc3HF81MXLbNU5hPTKp6RXgVTXUuEbkvfeMvFJ/uJAv/b5bmFdt3RtyJSbcyAdCFHPKJM7d0ZXdwYMH3iXx+Sj+94bTPDvAr+ilW0kxowgPW11979Fxjc6LPpcJcCrC57+4N69WGgKnw3w2TgApLbE58usb2NexltMZUIqkqPhB+mc2zom1eDW2za8gnIT1J43Us+cJ4XUV9E8PE/J2ZX4HU93cAwrpOwEjqTDGzzL353zP69yn4LbqgZIHtmAFgfTVZ1hACWFQkABPZfsXm9GUuRJHGByH7T2JFvYZsJm4XCPBXql+CzQEeU2nQlpnJ+e3BF0T44kbfwHK8tpk20VO0TU/6/n1rAU8kmD7eH+YaSLN4TzHbpxIp9qTvGyre5/0b1SIAcVGnggSEGpWRgO5D+HvYXEWuUnObeDmoLRaWGsDKMAtyLaClEciphfkXVCi/qgNPrCAtpVn0jlTpDOZoSZsrzuUrxsM992WkMcV6JTUtuS/Ghr7/29e1lwEZCWiv7PbmyHZ1ZTe7ilxnG4mryM9V+PdBIoHkOxDtuLKwO4Mj1DvA2oG4VPg9RLRkVCAgaYW2OZZ2mFqmCQ2+AU6igvzbOwkEYld2R8TAuiu7XwBEVdRyMieGGlVf2KtD8k2cO/w95RsoZtui944Vbz/G5m6BHgn8pWQeyDNh29LnkmLjBA0a2sememeirXYaCUh3803JzlBd2X0F4I83xw8Aie3twYYrwLkdFR/iNuI9olVxcKQVy+N35anqIM7NP3Vk2Cwlh/TvJVPzp6gXCNbUDUWPNi9tmQDdwSSpSQIrmoUDqK/sBtlsGa3ZmwQ/9ObIDHb+C6n7ta8i7w4mvSOwfXpEVfMcd8qleO+TusDH3jhVCJUGcN8dTCIA8WzUn9YgggzrK7vHEitz/8AjkUACIM07yEjVD6EPIBH2abILO787mATYBK8cY/aqovLtIiLOL6iP7nYdlU15ShDHnN/VUKVbJ/x9tvhuMzY+A1sRfX9t9u5g8gIgmo36WQ0iSAEE5B9QRaWJgBV488Ls3oS6t4MZ38ansDoAAYj2b9NgLWrrQBLS1Z4I6RLNPXhlZZg42owYMos2PtYGtIwRfRVtbWHTf5/oY+Urot7Z7N3BZEgCU8s/QI3+UDGLZwBB3rH3HRiEP4H6vAHuU/Bno/4hOt/m1luOWJO27Ax3pTFFlhW1kib4U/h3hob0vR34WOpiYVnXKt+3IYDZqL+ajfpWNnt3MIlrkoDwD3zB9uEgOizJzu/VDerpDiZhdzAp9CnMRv1oNuofSvXj69G3MEe3RYy03lC8h6JlQSLPhkEUN0Sw5XciDUmOJbJV5Rfi/SWlqUIzNAlZa0f+nFQiJJtvl699L0zj5Xm+JSQam52rUdFs1K/NjBQyHFGDXUlCvwAwzTv1N/J0BxOfOt/oU5iN+uMjDewE72Pvn6i+C6aSRpLG8l1DACn7zjdslssW2ESb8bLkzSo+vcuv2R7i/c4+ERocQL1D7UqTNxec34x0bWc44S+aYrOrLWX1CvF+GfqloH5iw1KKzc7HhH27qo15enFC1YqVL48xVRtwofMKSEBVVzEmAmqDaUGaqUROYjxFWwTAhEZns/OZI67jH9g3yGxJmENIhQcAwwPO+DqMDSaJykSJLAZN1XwibO+r0OEfyebeJwGUaSPdITIywe2jbd5Y/nUIQGxcMtVVbj/b7wOAb9pIQJoNTTb7DfkHkrr+gT0Jf0TseGcgsC+zUT85AeEXA+sbtq9FlzWVr7DfBPOs8e0A6y2hkUHQrmG+XvyNhOSQfT+F3a7JJyYIKueabzB3xXX1prb5Yeif79jd0qMpylZgVfL7OHFkWg1AoUIPod5/LhotPqIKXcaEWVJdU5wuhJrms4GQwc4jrZqBhbreQvEhElDMmOJZsefYx7OFkr0t6lTm21qsncV3pRXaJYPdzcF1wMuDZZkt1u+cEFOtD8BCuMbQ708+mnA1iaT2DBsV3MGhPAEwYYslZ4lKBUsO4R8g8yOG+VThH1Sfj3ClmCMAh/0SABO8xGBj/w3a2ZfgkZ2fGDSS2oFMjgAcHAGYhbAolPYVNcOKNaZIUlBmdOJ2viMAh+YTABNK0+GFYjaO60TXkZ2fwBy+m8xG/eEH7lNHAA6HJwAmpAkstu6WNQv2la+DgyOA3dvmVod3UAjy0TULBwdHAHtAHVv9GL4FBwdHAPshggiW3vpdag8ODg4nQADMLIgL7PhnrCO8jh5f4ODgCGA/RODDHLGn0xCSD7qs5+BwPgQg+QdMMftC3f8I4bsODh+LACT/gGrb8als03VwcARwIP/APRpwzoCDw7ng/++z7FyTnp4xAAAAAElFTkSuQmCC"},9939:function(e,t,n){"use strict";n.r(t),n.d(t,{frontMatter:()=>d,default:()=>m,contentTitle:()=>c,assets:()=>h,docusaurusRequire:()=>u,toc:()=>g,metadata:()=>o});var o=JSON.parse('{"id":"tests/images/index","title":"Image Tests","description":"URL encoded image","source":"@site/_dogfooding/_docs tests/tests/images/index.mdx","sourceDirName":"tests/images","slug":"/tests/images/","permalink":"/tests/docs/tests/images/","draft":false,"unlisted":false,"tags":[],"version":"current","lastUpdatedBy":"S\xe9bastien Lorber","lastUpdatedAt":1744293302000,"frontMatter":{"image":"./img/oss_logo.png"},"sidebar":"sidebar","previous":{"title":"Sample doc","permalink":"/tests/docs/tests/category-links/with-readme-doc/sample-doc"},"next":{"title":"Import Bad Package","permalink":"/tests/docs/tests/import-bad-package"}}'),s=n(85893),i=n(80980),r=n(11037),a=n(41949),l=n.n(a);let d={image:"./img/oss_logo.png"},c="Image Tests",h={image:n(64027).Z},u=n(41949),g=[{value:"Regular images",id:"regular-images",level:2},{value:"Ideal images",id:"ideal-images",level:2},{value:"CSS Image",id:"css-image",level:2}];function p(e){let t={h1:"h1",h2:"h2",header:"header",img:"img",p:"p",...(0,i.a)(),...e.components};return(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(t.header,{children:(0,s.jsx)(t.h1,{id:"image-tests",children:"Image Tests"})}),"\n","\n","\n","\n",(0,s.jsx)(t.p,{children:(0,s.jsx)(t.img,{alt:"URL encoded image",src:n(65945).Z+"",width:"256",height:"82"})}),"\n",(0,s.jsx)(t.h2,{id:"regular-images",children:"Regular images"}),"\n",(0,s.jsx)(t.p,{children:"Those only render in DEV when IdealImage plugin is disabled."}),"\n",(0,s.jsx)("img",{src:l()}),"\n",(0,s.jsx)("img",{src:u.default}),"\n",(0,s.jsx)(t.h2,{id:"ideal-images",children:"Ideal images"}),"\n",(0,s.jsx)(r.Z,{img:l()}),"\n",(0,s.jsx)(r.Z,{img:u}),"\n",(0,s.jsx)(t.h2,{id:"css-image",children:"CSS Image"}),"\n","\n",(0,s.jsx)(t.p,{children:"This should display a div with have a background image"}),"\n",(0,s.jsx)("div",{className:"dogfood-image-test-css",style:{border:"solid",height:"10rem"}})]})}function m(e={}){let{wrapper:t}={...(0,i.a)(),...e.components};return t?(0,s.jsx)(t,{...e,children:(0,s.jsx)(p,{...e})}):p(e)}m.displayName="MDXContent(_dogfooding/_docs tests/tests/images/index.mdx)"},41949:function(e,t,n){e.exports={src:{srcSet:n.p+"assets/ideal-img/docusaurus.30c6ff4.200.png 200w",images:[{path:n.p+"assets/ideal-img/docusaurus.30c6ff4.200.png",width:200,height:200}],src:n.p+"assets/ideal-img/docusaurus.30c6ff4.200.png",toString:function(){return n.p+"assets/ideal-img/docusaurus.30c6ff4.200.png"},placeholder:void 0,width:200,height:200},preSrc:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAoAAAAKCAYAAACNMs+9AAAACXBIWXMAAAsTAAALEwEAmpwYAAABm0lEQVR4nEXNP0hbQQDH8aM0RQoudlNwdZLg00IaffdCCDpoqlhSGzV3xxOz6FRq5w6BQkcVJIJYCFg6CILQQqGkgkjiu5fEf0QjBlETmyJaEKSm5n7yunT4bh9+P0IIIe2y73GgFG3u3h1rMJLGw6iMu6KIu+KQLgAPHENCu6FHdJOtepPhGz0VOaa2kB5rJNORemW3/RjcaV3rX27JP68ngfxEI7X5b/d8D559G1K+/BjC+28xeRBTbw4+4N3x7N/3p3NuErDNRn2TXfm2TOgWq1HJ1VLxq5KHhZp1WMB2oVgtnlbcxOtAya6MjIAhmfJaHHzPxMzZuFqoTCJx/vouUZrSiCfLmv7BrAC1uNItjhd7EXwsD+Ki5K9d3/Uh9nN4+v9iVkC3uPLbHJ/LIXzJdSO1ruOs0oscwj2ky+KdVPJLI2dCl0L5MgIjBYbh/VGspAO1i8texH5FZgmV7BOV3Lm9pZJVnbp2RDV4JKr2efBP+bof4ydskTxNR55402aHviE0J/+G0DxSaDOllxow0P79dtRNkrzuHtwg5HIaPwQEAAAAAElFTkSuQmCC"}},11037:function(e,t,n){"use strict";n.d(t,{Z:()=>ee});var o=n(85893),s=n(67294),i=n(77827);function r(e,t,n,o){return e.addEventListener(t,n,o),()=>e.removeEventListener(t,n,o)}function a(e){return"undefined"!=typeof window?(0,o.jsx)(l,{...e,children:e.children}):e.children}class l extends s.Component{static defaultProps={topOffset:0,bottomOffset:0,onEnter(){},onLeave(){}};scrollableAncestor;previousPosition=null;unsubscribe;innerRef=(0,s.createRef)();componentDidMount(){var e;let t;this.scrollableAncestor=function(e){let t=e;for(;t.parentNode&&(t=t.parentNode)!==document.body;){let e=window.getComputedStyle(t),n=e.getPropertyValue("overflow-y")||e.getPropertyValue("overflow");if("auto"===n||"scroll"===n||"overlay"===n)return t}return window}(this.innerRef.current);let n=r(this.scrollableAncestor,"scroll",this._handleScroll,{passive:!0}),o=r(window,"resize",this._handleScroll,{passive:!0}),s=(e=()=>{this._handleScroll()},t=!0,queueMicrotask(()=>{t&&e()}),()=>t=!1);this.unsubscribe=()=>{n(),o(),s()}}componentDidUpdate(){this._handleScroll()}componentWillUnmount(){this.unsubscribe?.()}_handleScroll=()=>{var e;let t=this.innerRef.current,{topOffset:n,bottomOffset:o,onEnter:s,onLeave:i}=this.props,r=(e=function(e){let t,n,{node:o,scrollableAncestor:s,topOffset:i,bottomOffset:r}=e,{top:a,bottom:l}=o.getBoundingClientRect();s===window?(t=window.innerHeight,n=0):(t=s.offsetHeight,n=s.getBoundingClientRect().top);let d=n+t;return{top:a,bottom:l,viewportTop:n+i,viewportBottom:d-r}}({node:t,scrollableAncestor:this.scrollableAncestor,topOffset:n,bottomOffset:o})).viewportBottom-e.viewportTop==0?"invisible":e.viewportTop<=e.top&&e.top<=e.viewportBottom||e.viewportTop<=e.bottom&&e.bottom<=e.viewportBottom||e.top<=e.viewportTop&&e.viewportBottom<=e.bottom?"inside":e.viewportBottom 1?s.join(" "):s[0],style:e}}let c="loading",h="loaded",u="error",g={load:"load",loading:c,loaded:h,error:u,noicon:"noicon",offline:"offline"},{load:p,loading:m,loaded:w,error:f,noicon:A,offline:v}=g;class b extends s.PureComponent{static defaultProps={iconColor:"#fff",iconSize:64};constructor(e){super(e),this.state={isMounted:!1}}componentDidMount(){this.setState({isMounted:!0}),this.props.onDimensions&&this.dimensionElement&&this.props.onDimensions({width:this.dimensionElement.clientWidth||this.dimensionElement.parentNode.clientWidth,height:this.dimensionElement.clientHeight||this.dimensionElement.parentNode.clientHeight})}renderIcon(e){let{icon:t,icons:n,iconColor:o,iconSize:i,theme:r}=e,a=n[t];if(!a)return null;let l=d({width:i+100,height:i,color:o},r.icon);return s.createElement("div",l,[s.createElement(a,{fill:o,size:i,key:"icon"}),s.createElement("br",{key:"br"}),this.props.message])}renderImage(e){return e.icon===w?(0,o.jsx)("img",{...d(e.theme.img),src:e.src,alt:e.alt,width:e.width,height:e.height}):(0,o.jsx)("svg",{...d(e.theme.img),width:e.width,height:e.height,ref:e=>this.dimensionElement=e})}renderNoscript(e){return this.state.isMounted?null:(0,o.jsx)("noscript",{children:(0,o.jsx)("img",{...d(e.theme.img,e.theme.noscript),src:e.nsSrc,srcSet:e.nsSrcSet,alt:e.alt,width:e.width,height:e.height})})}render(){let e,t=this.props,{placeholder:n,theme:s}=t;return e=t.icon===w?{}:n.lqip?{backgroundImage:`url("${n.lqip}")`}:{backgroundColor:n.color},(0,o.jsxs)("div",{...d(s.placeholder,e,t.style,t.className),onClick:this.props.onClick,onKeyPress:this.props.onClick,ref:this.props.innerRef,children:[this.renderImage(t),this.renderNoscript(t),this.renderIcon(t)]})}}class C{constructor(){this.signal={onabort:()=>{}},this.abort=()=>this.signal.onabort()}}let S=(e,t)=>(t=t||{},new Promise((n,o)=>{let s=new XMLHttpRequest;for(let n in s.open(t.method||"get",e,!0),t.headers)s.setRequestHeader(n,t.headers[n]);s.withCredentials="include"===t.credentials,s.onload=()=>{n(function e(){let t,n=[],o=[],i={};return s.getAllResponseHeaders().replace(/^(.*?):\s*?([\s\S]*?)$/gm,(e,s,r)=>{n.push(s=s.toLowerCase()),o.push([s,r]),t=i[s],i[s]=t?`${t},${r}`:r}),{ok:(s.status/100|0)==2,status:s.status,statusText:s.statusText,url:s.responseURL,clone:e,text:()=>Promise.resolve(s.responseText),json:()=>Promise.resolve(s.responseText).then(JSON.parse),blob:()=>Promise.resolve(new Blob([s.response])),headers:{keys:()=>n,entries:()=>o,get:e=>i[e.toLowerCase()],has:e=>e.toLowerCase()in i}}}())},s.onerror=o,t.signal&&(t.signal.onabort=()=>{s.onerror=s.onload=void 0,s.abort()}),s.send(t.body)})),x=(e,t)=>{if(!t)return e;let n=e.then(e=>e,e=>e);return n.cancel=()=>{e.cancel(),t.cancel()},n},I=e=>{let t,n=new Promise(n=>{t=setTimeout(n,e)});return n.cancel=()=>{clearTimeout(t),t=void 0},n},E=e=>{let t=new Image,n=new Promise((n,o)=>{t.onload=n,t.onabort=t.onerror=()=>o({}),t.src=e});return n.cancel=()=>{if(!t)throw Error("Already canceled");t.onload=t.onabort=t.onerror=void 0,t.src="",t=void 0},n},L=(e,t)=>{let n=new C,o=n.signal,s=new Promise((n,s)=>S(e,{...t,signal:o}).then(t=>{t.ok?t.blob().then(()=>E(e)).then(n):s({status:t.status})},s));return s.cancel=()=>{if(!n)throw Error("Already canceled");n.abort(),n=void 0},s},B="undefined"==typeof window||"ReactSnap"===window.navigator.userAgent,M=!B&&!!window.navigator.connection,k=(e,t)=>{let n;if(B)return 0;t||(t=window);let o=e.width,{screen:s}=t,i=s.width,r=s.height,{documentElement:a}=document,l=t.innerWidth||a.clientWidth,d=t.innerHeight||a.clientHeight,c=t.devicePixelRatio||1;if(i>l){let e=document.getElementsByTagName("body")[0],t=l-o;n=(e.clientHeight>d||e.clientHeight>r)&&t<=15?i-t:o/l*i}else n=o;return n*c},H=e=>{let t=["Bytes","KB","MB","GB","TB"];if(0===e)return"n/a";let n=parseInt(Math.floor(Math.log(e)/Math.log(1024)),10);return 0===n?`${e} ${t[n]}`:`${(e/1024**n).toFixed(1)} ${t[n]}`},V=(()=>{if(B)return!1;let e=document.createElement("canvas");return!!(e.getContext&&e.getContext("2d"))&&0===e.toDataURL("image/webp").indexOf("data:image/webp")})(),y=e=>"webp"===e.format||e.src&&e.src.match(/\.webp($|\?.*)/i),j=e=>{let t,n,{srcSet:o,maxImageWidth:s,supportsWebp:i}=e;if(0===o.length)throw Error("Need at least one item in srcSet");if(i)0===(t=o.filter(y)).length&&(t=o);else if(0===(t=o.filter(e=>!y(e))).length)throw Error("Need at least one supported format item in srcSet");let r=t.filter(e=>e.width>=s);return 0===r.length?(r=t,n=Math.max.apply(null,r.map(e=>e.width))):n=Math.min.apply(null,r.map(e=>e.width)),t.filter(e=>e.width===n)[0]},N=e=>{let{srcSet:t,getUrl:n}=e;if(!B)return{};let o=t.filter(e=>!y(e)),s=o[0];return{nsSrcSet:o.map(e=>`${n?n(e):e.src} ${e.width}w`).join(","),nsSrc:n?n(s):s.src,ssr:B}},{initial:O,loading:T,loaded:U,error:P}={initial:"initial",loading:c,loaded:h,error:u},D=e=>{let{connection:t,size:n,threshold:o,possiblySlowNetwork:s}=e;if(s)return!1;if(!t)return!0;let{downlink:i,rtt:r,effectiveType:a}=t;switch(a){case"slow-2g":case"2g":return!1;case"3g":if(i&&n&&o)return 8*n/(1e3*i)+r {switch(e){case g.noicon:case g.loaded:return null;case g.loading:return"Loading...";case g.load:let{pickedSrc:n}=t,{size:s}=n;if(s)return["Click to load (",(0,o.jsx)("nobr",{children:H(s)},"nb"),")"];return"Click to load";case g.offline:return"Your browser is offline. Image not loaded";case g.error:let{loadInfo:i}=t;if(404===i)return"404. Image not found";return"Error. Click to reload";default:throw Error(`Wrong icon: ${e}`)}},R=e=>{let{loadState:t,onLine:n,overThreshold:o,userTriggered:s}=e;if(B)return g.noicon;switch(t){case U:return g.loaded;case T:return o?g.loading:g.noicon;case O:if(!n)return g.offline;{let{shouldAutoDownload:t}=e;if(void 0===t)return g.noicon;return s||!t?g.load:g.noicon}case P:return n?g.error:g.offline;default:throw Error(`Wrong state: ${t}`)}};class z extends s.Component{constructor(e){super(e),this.state={loadState:O,connection:M?{downlink:navigator.connection.downlink,rtt:navigator.connection.rtt,effectiveType:navigator.connection.effectiveType}:null,onLine:!0,overThreshold:!1,inViewport:!1,userTriggered:!1,possiblySlowNetwork:!1}}static defaultProps={shouldAutoDownload:D,getMessage:J,getIcon:R,loader:"xhr"};componentDidMount(){M?(this.updateConnection=()=>{navigator.onLine&&this.state.loadState===O&&this.setState({connection:{effectiveType:navigator.connection.effectiveType,downlink:navigator.connection.downlink,rtt:navigator.connection.rtt}})},navigator.connection.addEventListener("onchange",this.updateConnection)):this.props.threshold&&(this.possiblySlowNetworkListener=e=>{if(this.state.loadState!==O)return;let{possiblySlowNetwork:t}=e.detail;!this.state.possiblySlowNetwork&&t&&this.setState({possiblySlowNetwork:t})},window.document.addEventListener("possiblySlowNetwork",this.possiblySlowNetworkListener)),this.updateOnlineStatus=()=>this.setState({onLine:navigator.onLine}),this.updateOnlineStatus(),window.addEventListener("online",this.updateOnlineStatus),window.addEventListener("offline",this.updateOnlineStatus)}componentWillUnmount(){this.clear(),M?navigator.connection.removeEventListener("onchange",this.updateConnection):this.props.threshold&&window.document.removeEventListener("possiblySlowNetwork",this.possiblySlowNetworkListener),window.removeEventListener("online",this.updateOnlineStatus),window.removeEventListener("offline",this.updateOnlineStatus)}onClick=()=>{let{loadState:e,onLine:t,overThreshold:n}=this.state;if(t)switch(e){case T:n&&this.cancel(!0);return;case U:return;case O:case P:this.load(!0);return;default:throw Error(`Wrong state: ${e}`)}};clear(){this.loader&&(this.loader.cancel(),this.loader=void 0)}cancel(e){T===this.state.loadState&&(this.clear(),this.loadStateChange(O,e))}loadStateChange(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;this.setState({loadState:e,overThreshold:!1,userTriggered:!!t,loadInfo:n})}load=e=>{let{loadState:t,url:n}=this.state;if(B||U===t||T===t)return;this.loadStateChange(T,e);let{threshold:o}=this.props,s="xhr"===this.props.loader?L(n):E(n);if(s.then(()=>{this.clear(),this.loadStateChange(U,!1)}).catch(e=>{this.clear(),404===e.status?this.loadStateChange(P,!1,404):this.loadStateChange(P,!1)}),o){let e=I(o);e.then(()=>{this.loader&&(window.document.dispatchEvent(new CustomEvent("possiblySlowNetwork",{detail:{possiblySlowNetwork:!0}})),this.setState({overThreshold:!0}),this.state.userTriggered||this.cancel(!0))}),this.loader=x(s,e)}else this.loader=s};onEnter=()=>{if(this.state.inViewport)return;this.setState({inViewport:!0});let e=j({srcSet:this.props.srcSet,maxImageWidth:this.props.srcSet.length>1?k(this.state.dimensions):0,supportsWebp:V}),{getUrl:t}=this.props,n=t?t(e):e.src,o=this.props.shouldAutoDownload({...this.state,size:e.size});this.setState({pickedSrc:e,shouldAutoDownload:o,url:n},()=>{o&&this.load(!1)})};onLeave=()=>{this.state.loadState!==T||this.state.userTriggered||(this.setState({inViewport:!1}),this.cancel(!1))};render(){let e=this.props.getIcon(this.state),t=this.props.getMessage(e,this.state);return(0,o.jsx)(a,{onEnter:this.onEnter,onLeave:this.onLeave,children:(0,o.jsx)(b,{...this.props,...N(this.props),onClick:this.onClick,icon:e,src:this.state.url||"",onDimensions:e=>this.setState({dimensions:e}),message:t})})}}let Q=e=>{let{size:t=24,fill:n="#000",className:s,path:i}=e;return(0,o.jsxs)("svg",{xmlns:"http://www.w3.org/2000/svg",width:t,height:t,viewBox:"0 0 24 24",className:s,children:[(0,o.jsx)("path",{d:"M0 0h24v24H0z",fill:"none"}),(0,o.jsx)("path",{fill:n,d:i})]})},{load:q,loading:G,loaded:Z,error:K,noicon:F,offline:Y}=g,X={[q]:e=>(0,o.jsx)(Q,{...e,path:"M19.35 10.04C18.67 6.59 15.64 4 12 4 9.11 4 6.6 5.64 5.35 8.04 2.34 8.36 0 10.91 0 14c0 3.31 2.69 6 6 6h13c2.76 0 5-2.24 5-5 0-2.64-2.05-4.78-4.65-4.96zM17 13l-5 5-5-5h3V9h4v4h3z"}),[G]:e=>(0,o.jsx)(Q,{...e,path:"M6,2V8H6V8L10,12L6,16V16H6V22H18V16H18V16L14,12L18,8V8H18V2H6M16,16.5V20H8V16.5L12,12.5L16,16.5M12,11.5L8,7.5V4H16V7.5L12,11.5Z"}),[Z]:null,[K]:e=>(0,o.jsx)(Q,{...e,path:"M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm1 15h-2v-2h2v2zm0-4h-2V7h2v6z"}),[F]:null,[Y]:e=>(0,o.jsx)(Q,{...e,path:"M19.35 10.04C18.67 6.59 15.64 4 12 4c-1.48 0-2.85.43-4.01 1.17l1.46 1.46C10.21 6.23 11.08 6 12 6c3.04 0 5.5 2.46 5.5 5.5v.5H19c1.66 0 3 1.34 3 3 0 1.13-.64 2.11-1.56 2.62l1.45 1.45C23.16 18.16 24 16.68 24 15c0-2.64-2.05-4.78-4.65-4.96zM3 5.27l2.75 2.74C2.56 8.15 0 10.77 0 14c0 3.31 2.69 6 6 6h11.73l2 2L21 20.73 4.27 4 3 5.27zM7.73 10l8 8H6c-2.21 0-4-1.79-4-4s1.79-4 4-4h1.73z"})},W={placeholder:{backgroundSize:"cover",backgroundRepeat:"no-repeat",position:"relative"},img:{width:"100%",height:"auto",maxWidth:"100%",marginBottom:"-4px"},icon:{position:"absolute",top:"50%",left:"50%",transform:"translate(-50%, -50%)",textAlign:"center"},noscript:{position:"absolute",top:0,left:0}},$=e=>{let{icons:t=X,theme:n=W,...s}=e;return(0,o.jsx)(z,{...s,icons:t,theme:n})};function _(e,t){switch(e){case"noicon":case"loaded":return null;case"loading":return(0,i.I)({id:"theme.IdealImageMessage.loading",message:"Loading...",description:"When the full-scale image is loading"});case"load":{let{pickedSrc:e}=t,{size:n}=e,o=n?` (${function(e){let t=["B","KB","MB","GB","TB"];if(0===e)return"n/a";let n=Math.floor(Math.log(e)/Math.log(1024));return 0===n?`${e} ${t[n]}`:`${(e/1024**n).toFixed(1)} ${t[n]}`}(n)})`:"";return(0,i.I)({id:"theme.IdealImageMessage.load",message:"Click to load{sizeMessage}",description:"To prompt users to load the full image. sizeMessage is a parenthesized size figure."},{sizeMessage:o})}case"offline":return(0,i.I)({id:"theme.IdealImageMessage.offline",message:"Your browser is offline. Image not loaded",description:"When the user is viewing an offline document"});case"error":{let{loadInfo:e}=t;if(404===e)return(0,i.I)({id:"theme.IdealImageMessage.404error",message:"404. Image not found",description:"When the image is not found"});return(0,i.I)({id:"theme.IdealImageMessage.error",message:"Error. Click to reload",description:"When the image fails to load for unknown error"})}default:throw Error(`Wrong icon: ${e}`)}}function ee(e){let{img:t,...n}=e;return"string"==typeof t||"default"in t?(0,o.jsx)("img",{src:"string"==typeof t?t:t.default,...n}):(0,o.jsx)($,{height:t.src.height??100,width:t.src.width??100,placeholder:{lqip:t.preSrc},src:t.src.src,srcSet:t.src.images.map(e=>({...e,src:e.path})),getMessage:_})}},80980:function(e,t,n){"use strict";n.d(t,{Z:()=>a,a:()=>r});var o=n(67294);let s={},i=o.createContext(s);function r(e){let t=o.useContext(i);return o.useMemo(function(){return"function"==typeof e?e(t):{...t,...e}},[t,e])}function a(e){let t;return t=e.disableParentContext?"function"==typeof e.components?e.components(s):e.components||s:r(e.components),o.createElement(i.Provider,{value:t},e.children)}}}]); \ No newline at end of file diff --git a/assets/js/028951d7.1bf6acc0.js b/assets/js/028951d7.53bc1fb3.js similarity index 97% rename from assets/js/028951d7.1bf6acc0.js rename to assets/js/028951d7.53bc1fb3.js index 85b2ea12f0..d1de368450 100644 --- a/assets/js/028951d7.1bf6acc0.js +++ b/assets/js/028951d7.53bc1fb3.js @@ -1 +1 @@ -"use strict";(self.webpackChunkwebsite=self.webpackChunkwebsite||[]).push([["23008"],{23491:function(e,s,t){t.d(s,{Z:()=>n});let n=t.p+"assets/images/social-card-e1b6e0c51be29d4ab2d4c966d220410c.png"},99203:function(e,s,t){t.d(s,{Z:()=>n});let n=t.p+"assets/images/broken-anchor-4191e5dd94aef9e8c5e3524880670f0f.jpg"},34873:function(e,s,t){t.d(s,{Z:()=>n});let n=t.p+"assets/images/social-card-e1b6e0c51be29d4ab2d4c966d220410c.png"},93e3:function(e,s,t){t.r(s),t.d(s,{assets:()=>c,contentTitle:()=>i,default:()=>u,frontMatter:()=>a,metadata:()=>n,toc:()=>l});var n=t(70694),r=t(85893),o=t(80980);t(14522),t(51118),t(39468);let a={title:"Docusaurus 3.1",authors:["slorber"],tags:["release"],image:"./img/social-card.png",date:new Date("2024-01-05T00:00:00.000Z")},i=void 0,c={image:t(23491).Z,authorsImageUrls:[void 0]},l=[{value:"Highlights",id:"highlights",level:2},{value:"Broken anchors checker",id:"broken-anchors-checker",level:3},{value:" parseFrontMatter
hook",id:"parsefrontmatter-hook",level:3},{value:"Other changes",id:"other-changes",level:2}];function d(e){let s={a:"a",admonition:"admonition",code:"code",h2:"h2",h3:"h3",img:"img",li:"li",p:"p",pre:"pre",strong:"strong",ul:"ul",...(0,o.a)(),...e.components};return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsxs)(s.p,{children:["We are happy to announce ",(0,r.jsx)(s.strong,{children:"Docusaurus 3.1"}),"."]}),"\n",(0,r.jsxs)(s.p,{children:["The upgrade should be easy: as explained in our ",(0,r.jsx)(s.a,{href:"/community/release-process",children:"release process documentation"}),", minor versions respect ",(0,r.jsx)(s.a,{href:"https://semver.org/",children:"Semantic Versioning"}),"."]}),"\n",(0,r.jsx)(s.p,{children:(0,r.jsx)(s.img,{alt:"Docusaurus blog post social card",src:t(34873).Z+"",width:"1200",height:"600"})}),"\n","\n",(0,r.jsx)(s.h2,{id:"highlights",children:"Highlights"}),"\n",(0,r.jsx)(s.h3,{id:"broken-anchors-checker",children:"Broken anchors checker"}),"\n",(0,r.jsxs)(s.p,{children:["In ",(0,r.jsx)(s.a,{href:"https://github.com/facebook/docusaurus/pull/9528",children:"#9528"}),", we improved the built-in broken links checker to also detect broken anchors."]}),"\n",(0,r.jsx)(s.p,{children:(0,r.jsx)(s.img,{alt:"Docusaurus blog post social card",src:t(99203).Z+"",width:"1920",height:"896"})}),"\n",(0,r.jsxs)(s.admonition,{title:"Make it fail fast",type:"tip",children:[(0,r.jsxs)(s.p,{children:["The new ",(0,r.jsx)(s.a,{href:"/docs/api/docusaurus-config#onBrokenAnchors",children:(0,r.jsx)(s.code,{children:"onBrokenAnchors"})})," option has value ",(0,r.jsx)(s.code,{children:"warn"})," by default, for retro-compatibility reasons."]}),(0,r.jsxs)(s.p,{children:["We recommend to turn it to ",(0,r.jsx)(s.code,{children:"throw"})," and fail your CI builds instead of deploying broken anchors to productions."]})]}),"\n",(0,r.jsxs)(s.admonition,{type:"note",children:[(0,r.jsxs)(s.p,{children:["For users and plugin authors implementing custom ",(0,r.jsx)(s.code,{children:""})," and ",(0,r.jsx)(s.code,{children:""})," components, we provide a new ",(0,r.jsx)(s.a,{href:"/docs/docusaurus-core#useBrokenLinks",children:(0,r.jsx)(s.code,{children:"useBrokenLinks"})})," React hook API."]}),(0,r.jsxs)(s.p,{children:[(0,r.jsx)(s.strong,{children:"Most Docusaurus users don't need to care about it"}),", built-in components (",(0,r.jsx)(s.code,{children:"docusaurus/Link"})," and ",(0,r.jsx)(s.code,{children:"@theme/Heading"}),") already use it internally."]})]}),"\n",(0,r.jsxs)(s.h3,{id:"parsefrontmatter-hook",children:[(0,r.jsx)(s.code,{children:"parseFrontMatter"})," hook"]}),"\n",(0,r.jsxs)(s.p,{children:["In ",(0,r.jsx)(s.a,{href:"https://github.com/facebook/docusaurus/pull/9624",children:"#9624"}),", we added a new ",(0,r.jsxs)(s.a,{href:"/docs/api/docusaurus-config#markdown",children:[(0,r.jsx)(s.code,{children:"siteConfig.markdown.parseFrontMatter"})," function hook"]}),"."]}),"\n",(0,r.jsx)(s.p,{children:"This makes it possible to implement convenient front matter transformations, shortcuts, or to integrate with external systems using front matter that Docusaurus plugins do not support."}),"\n",(0,r.jsx)(s.pre,{children:(0,r.jsx)(s.code,{className:"language-js",metastring:'title="docusaurus.config.js"',children:"export default {\n markdown: {\n // highlight-start\n parseFrontMatter: async (params) => {\n // Reuse the default parser\n const result = await params.defaultParseFrontMatter(params);\n\n // Process front matter description placeholders\n result.frontMatter.description =\n result.frontMatter.description?.replaceAll('{{MY_VAR}}', 'MY_VALUE');\n\n // Create your own front matter shortcut\n if (result.frontMatter.i_do_not_want_docs_pagination) {\n result.frontMatter.pagination_prev = null;\n result.frontMatter.pagination_next = null;\n }\n\n // Rename an unsupported front matter coming from another system\n if (result.frontMatter.cms_seo_summary) {\n result.frontMatter.description = result.frontMatter.cms_seo_summary;\n delete result.frontMatter.cms_seo_summary;\n }\n\n return result;\n },\n // highlight-end\n },\n};\n"})}),"\n",(0,r.jsxs)(s.p,{children:["Read the ",(0,r.jsx)(s.a,{href:"/docs/markdown-features#front-matter",children:"front matter guide"})," and the ",(0,r.jsxs)(s.a,{href:"/docs/api/docusaurus-config#markdown",children:[(0,r.jsx)(s.code,{children:"parseFrontMatter"})," API ref"]})," for details."]}),"\n",(0,r.jsx)(s.h2,{id:"other-changes",children:"Other changes"}),"\n",(0,r.jsx)(s.p,{children:"Other notable changes include:"}),"\n",(0,r.jsxs)(s.ul,{children:["\n",(0,r.jsxs)(s.li,{children:[(0,r.jsx)(s.a,{href:"https://github.com/facebook/docusaurus/pull/9674",children:"#9674"}),": add ",(0,r.jsx)(s.code,{children:"siteConfig.markdown.remarkRehypeOptions"})," to pass options to ",(0,r.jsx)(s.code,{children:"remark-rehype"}),", letting you customize things such as MDX footnote label"]}),"\n",(0,r.jsxs)(s.li,{children:[(0,r.jsx)(s.a,{href:"https://github.com/facebook/docusaurus/pull/9671",children:"#9671"}),": add code block MagicComments support for (Visual) Basic/Batch/Fortran/COBOL/ML"]}),"\n",(0,r.jsxs)(s.li,{children:[(0,r.jsx)(s.a,{href:"https://github.com/facebook/docusaurus/pull/9610",children:"#9610"}),": enable CLI port configuration via ",(0,r.jsx)(s.code,{children:"PORT"})," environment variable"]}),"\n",(0,r.jsxs)(s.li,{children:[(0,r.jsx)(s.a,{href:"https://github.com/facebook/docusaurus/pull/9477",children:"#9477"}),": complete Brazilian Portuguese (pt-BR) translations"]}),"\n"]}),"\n",(0,r.jsxs)(s.p,{children:["Check the ",(0,r.jsx)(s.strong,{children:(0,r.jsx)(s.a,{href:"/changelog/3.1.0",children:"3.1.0 changelog entry"})})," for an exhaustive list of changes."]})]})}function u(e={}){let{wrapper:s}={...(0,o.a)(),...e.components};return s?(0,r.jsx)(s,{...e,children:(0,r.jsx)(d,{...e})}):d(e)}},51118:function(e,s,t){t.d(s,{Z:()=>o});var n=t(85893);t(67294);var r=t(14522);function o(e){let{url:s}=e;return(0,n.jsx)("div",{style:{padding:10},children:(0,n.jsx)(r.Z,{url:s,style:{minWidth:"min(100%,45vw)",width:800,maxWidth:"100%",overflow:"hidden"},bodyStyle:{padding:0},children:(0,n.jsx)("iframe",{src:s,title:s,style:{display:"block",width:"100%",height:300}})})})}},14522:function(e,s,t){t.d(s,{Z:()=>i});var n=t(85893);t(67294);var r=t(90496);let o="dot_giz1",a="bar_rrRL";function i(e){let{children:s,minHeight:t,url:i="http://localhost:3000",style:c,bodyStyle:l}=e;return(0,n.jsxs)("div",{className:"browserWindow_my1Q",style:{...c,minHeight:t},children:[(0,n.jsxs)("div",{className:"browserWindowHeader_jXSR",children:[(0,n.jsxs)("div",{className:"buttons_uHc7",children:[(0,n.jsx)("span",{className:o,style:{background:"#f25f58"}}),(0,n.jsx)("span",{className:o,style:{background:"#fbbe3c"}}),(0,n.jsx)("span",{className:o,style:{background:"#58cb42"}})]}),(0,n.jsx)("div",{className:(0,r.Z)("browserWindowAddressBar_Pd8y","text--truncate"),children:i}),(0,n.jsx)("div",{className:"browserWindowMenuIcon_Vhuh",children:(0,n.jsxs)("div",{children:[(0,n.jsx)("span",{className:a}),(0,n.jsx)("span",{className:a}),(0,n.jsx)("span",{className:a})]})})]}),(0,n.jsx)("div",{className:"browserWindowBody_Idgs",style:l,children:s})]})}},39468:function(e,s,t){t.d(s,{Z:()=>o});var n=t(85893),r=t(67294);function o(e){let{children:s="Boom!",message:t="Boom!\nSomething bad happened, but you can try again!",cause:o}=e,[a,i]=(0,r.useState)(!1);if(a)throw Error(t,{cause:o?Error(o):void 0});return(0,n.jsx)("button",{className:"button button--danger",type:"button",onClick:()=>i(!0),children:s})}},80980:function(e,s,t){t.d(s,{Z:()=>i,a:()=>a});var n=t(67294);let r={},o=n.createContext(r);function a(e){let s=n.useContext(o);return n.useMemo(function(){return"function"==typeof e?e(s):{...s,...e}},[s,e])}function i(e){let s;return s=e.disableParentContext?"function"==typeof e.components?e.components(r):e.components||r:a(e.components),n.createElement(o.Provider,{value:s},e.children)}},70694:function(e){e.exports=JSON.parse('{"permalink":"/blog/releases/3.1","editUrl":"https://github.com/facebook/docusaurus/edit/main/website/blog/releases/3.1/index.mdx","source":"@site/blog/releases/3.1/index.mdx","title":"Docusaurus 3.1","description":"We are happy to announce Docusaurus 3.1.","date":"2024-01-05T00:00:00.000Z","tags":[{"inline":false,"label":"Release","permalink":"/blog/tags/release","description":"Blog posts about Docusaurus\' new releases"}],"readingTime":1.665,"hasTruncateMarker":true,"authors":[{"name":"S\xe9bastien Lorber","title":"Docusaurus maintainer, This Week In React editor","url":"https://thisweekinreact.com","page":{"permalink":"/blog/authors/slorber"},"description":"A freelance React and React-Native developer near Paris and Docusaurus maintainer. Also runs ThisWeekInReact.com, a newsletter to stay updated with the React ecosystem.","socials":{"bluesky":"https://bsky.app/profile/sebastienlorber.com","x":"https://x.com/sebastienlorber","linkedin":"https://www.linkedin.com/in/sebastienlorber/","github":"https://github.com/slorber","instagram":"https://www.instagram.com/thisweekinreact","newsletter":"https://thisweekinreact.com"},"imageURL":"https://github.com/slorber.png","key":"slorber"}],"frontMatter":{"title":"Docusaurus 3.1","authors":["slorber"],"tags":["release"],"image":"./img/social-card.png","date":"2024-01-05T00:00:00.000Z"},"unlisted":false,"lastUpdatedAt":1744155424000,"lastUpdatedBy":"Ben McCann","prevItem":{"title":"Docusaurus 3.2","permalink":"/blog/releases/3.2"},"nextItem":{"title":"Announcing Docusaurus 3.0","permalink":"/blog/releases/3.0"}}')}}]); \ No newline at end of file +"use strict";(self.webpackChunkwebsite=self.webpackChunkwebsite||[]).push([["23008"],{23491:function(e,s,t){t.d(s,{Z:()=>n});let n=t.p+"assets/images/social-card-e1b6e0c51be29d4ab2d4c966d220410c.png"},99203:function(e,s,t){t.d(s,{Z:()=>n});let n=t.p+"assets/images/broken-anchor-4191e5dd94aef9e8c5e3524880670f0f.jpg"},34873:function(e,s,t){t.d(s,{Z:()=>n});let n=t.p+"assets/images/social-card-e1b6e0c51be29d4ab2d4c966d220410c.png"},93e3:function(e,s,t){t.r(s),t.d(s,{assets:()=>c,contentTitle:()=>i,default:()=>u,frontMatter:()=>a,metadata:()=>n,toc:()=>l});var n=t(70694),r=t(85893),o=t(80980);t(14522),t(51118),t(39468);let a={title:"Docusaurus 3.1",authors:["slorber"],tags:["release"],image:"./img/social-card.png",date:new Date("2024-01-05T00:00:00.000Z")},i=void 0,c={image:t(23491).Z,authorsImageUrls:[void 0]},l=[{value:"Highlights",id:"highlights",level:2},{value:"Broken anchors checker",id:"broken-anchors-checker",level:3},{value:" parseFrontMatter
hook",id:"parsefrontmatter-hook",level:3},{value:"Other changes",id:"other-changes",level:2}];function d(e){let s={a:"a",admonition:"admonition",code:"code",h2:"h2",h3:"h3",img:"img",li:"li",p:"p",pre:"pre",strong:"strong",ul:"ul",...(0,o.a)(),...e.components};return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsxs)(s.p,{children:["We are happy to announce ",(0,r.jsx)(s.strong,{children:"Docusaurus 3.1"}),"."]}),"\n",(0,r.jsxs)(s.p,{children:["The upgrade should be easy: as explained in our ",(0,r.jsx)(s.a,{href:"/community/release-process",children:"release process documentation"}),", minor versions respect ",(0,r.jsx)(s.a,{href:"https://semver.org/",children:"Semantic Versioning"}),"."]}),"\n",(0,r.jsx)(s.p,{children:(0,r.jsx)(s.img,{alt:"Docusaurus blog post social card",src:t(34873).Z+"",width:"1200",height:"600"})}),"\n","\n",(0,r.jsx)(s.h2,{id:"highlights",children:"Highlights"}),"\n",(0,r.jsx)(s.h3,{id:"broken-anchors-checker",children:"Broken anchors checker"}),"\n",(0,r.jsxs)(s.p,{children:["In ",(0,r.jsx)(s.a,{href:"https://github.com/facebook/docusaurus/pull/9528",children:"#9528"}),", we improved the built-in broken links checker to also detect broken anchors."]}),"\n",(0,r.jsx)(s.p,{children:(0,r.jsx)(s.img,{alt:"Docusaurus blog post social card",src:t(99203).Z+"",width:"1920",height:"896"})}),"\n",(0,r.jsxs)(s.admonition,{title:"Make it fail fast",type:"tip",children:[(0,r.jsxs)(s.p,{children:["The new ",(0,r.jsx)(s.a,{href:"/docs/api/docusaurus-config#onBrokenAnchors",children:(0,r.jsx)(s.code,{children:"onBrokenAnchors"})})," option has value ",(0,r.jsx)(s.code,{children:"warn"})," by default, for retro-compatibility reasons."]}),(0,r.jsxs)(s.p,{children:["We recommend to turn it to ",(0,r.jsx)(s.code,{children:"throw"})," and fail your CI builds instead of deploying broken anchors to productions."]})]}),"\n",(0,r.jsxs)(s.admonition,{type:"note",children:[(0,r.jsxs)(s.p,{children:["For users and plugin authors implementing custom ",(0,r.jsx)(s.code,{children:""})," and ",(0,r.jsx)(s.code,{children:""})," components, we provide a new ",(0,r.jsx)(s.a,{href:"/docs/docusaurus-core#useBrokenLinks",children:(0,r.jsx)(s.code,{children:"useBrokenLinks"})})," React hook API."]}),(0,r.jsxs)(s.p,{children:[(0,r.jsx)(s.strong,{children:"Most Docusaurus users don't need to care about it"}),", built-in components (",(0,r.jsx)(s.code,{children:"docusaurus/Link"})," and ",(0,r.jsx)(s.code,{children:"@theme/Heading"}),") already use it internally."]})]}),"\n",(0,r.jsxs)(s.h3,{id:"parsefrontmatter-hook",children:[(0,r.jsx)(s.code,{children:"parseFrontMatter"})," hook"]}),"\n",(0,r.jsxs)(s.p,{children:["In ",(0,r.jsx)(s.a,{href:"https://github.com/facebook/docusaurus/pull/9624",children:"#9624"}),", we added a new ",(0,r.jsxs)(s.a,{href:"/docs/api/docusaurus-config#markdown",children:[(0,r.jsx)(s.code,{children:"siteConfig.markdown.parseFrontMatter"})," function hook"]}),"."]}),"\n",(0,r.jsx)(s.p,{children:"This makes it possible to implement convenient front matter transformations, shortcuts, or to integrate with external systems using front matter that Docusaurus plugins do not support."}),"\n",(0,r.jsx)(s.pre,{children:(0,r.jsx)(s.code,{className:"language-js",metastring:'title="docusaurus.config.js"',children:"export default {\n markdown: {\n // highlight-start\n parseFrontMatter: async (params) => {\n // Reuse the default parser\n const result = await params.defaultParseFrontMatter(params);\n\n // Process front matter description placeholders\n result.frontMatter.description =\n result.frontMatter.description?.replaceAll('{{MY_VAR}}', 'MY_VALUE');\n\n // Create your own front matter shortcut\n if (result.frontMatter.i_do_not_want_docs_pagination) {\n result.frontMatter.pagination_prev = null;\n result.frontMatter.pagination_next = null;\n }\n\n // Rename an unsupported front matter coming from another system\n if (result.frontMatter.cms_seo_summary) {\n result.frontMatter.description = result.frontMatter.cms_seo_summary;\n delete result.frontMatter.cms_seo_summary;\n }\n\n return result;\n },\n // highlight-end\n },\n};\n"})}),"\n",(0,r.jsxs)(s.p,{children:["Read the ",(0,r.jsx)(s.a,{href:"/docs/markdown-features#front-matter",children:"front matter guide"})," and the ",(0,r.jsxs)(s.a,{href:"/docs/api/docusaurus-config#markdown",children:[(0,r.jsx)(s.code,{children:"parseFrontMatter"})," API ref"]})," for details."]}),"\n",(0,r.jsx)(s.h2,{id:"other-changes",children:"Other changes"}),"\n",(0,r.jsx)(s.p,{children:"Other notable changes include:"}),"\n",(0,r.jsxs)(s.ul,{children:["\n",(0,r.jsxs)(s.li,{children:[(0,r.jsx)(s.a,{href:"https://github.com/facebook/docusaurus/pull/9674",children:"#9674"}),": add ",(0,r.jsx)(s.code,{children:"siteConfig.markdown.remarkRehypeOptions"})," to pass options to ",(0,r.jsx)(s.code,{children:"remark-rehype"}),", letting you customize things such as MDX footnote label"]}),"\n",(0,r.jsxs)(s.li,{children:[(0,r.jsx)(s.a,{href:"https://github.com/facebook/docusaurus/pull/9671",children:"#9671"}),": add code block MagicComments support for (Visual) Basic/Batch/Fortran/COBOL/ML"]}),"\n",(0,r.jsxs)(s.li,{children:[(0,r.jsx)(s.a,{href:"https://github.com/facebook/docusaurus/pull/9610",children:"#9610"}),": enable CLI port configuration via ",(0,r.jsx)(s.code,{children:"PORT"})," environment variable"]}),"\n",(0,r.jsxs)(s.li,{children:[(0,r.jsx)(s.a,{href:"https://github.com/facebook/docusaurus/pull/9477",children:"#9477"}),": complete Brazilian Portuguese (pt-BR) translations"]}),"\n"]}),"\n",(0,r.jsxs)(s.p,{children:["Check the ",(0,r.jsx)(s.strong,{children:(0,r.jsx)(s.a,{href:"/changelog/3.1.0",children:"3.1.0 changelog entry"})})," for an exhaustive list of changes."]})]})}function u(e={}){let{wrapper:s}={...(0,o.a)(),...e.components};return s?(0,r.jsx)(s,{...e,children:(0,r.jsx)(d,{...e})}):d(e)}},51118:function(e,s,t){t.d(s,{Z:()=>o});var n=t(85893);t(67294);var r=t(14522);function o(e){let{url:s}=e;return(0,n.jsx)("div",{style:{padding:10},children:(0,n.jsx)(r.Z,{url:s,style:{minWidth:"min(100%,45vw)",width:800,maxWidth:"100%",overflow:"hidden"},bodyStyle:{padding:0},children:(0,n.jsx)("iframe",{src:s,title:s,style:{display:"block",width:"100%",height:300}})})})}},14522:function(e,s,t){t.d(s,{Z:()=>i});var n=t(85893);t(67294);var r=t(90496);let o="dot_giz1",a="bar_rrRL";function i(e){let{children:s,minHeight:t,url:i="http://localhost:3000",style:c,bodyStyle:l}=e;return(0,n.jsxs)("div",{className:"browserWindow_my1Q",style:{...c,minHeight:t},children:[(0,n.jsxs)("div",{className:"browserWindowHeader_jXSR",children:[(0,n.jsxs)("div",{className:"buttons_uHc7",children:[(0,n.jsx)("span",{className:o,style:{background:"#f25f58"}}),(0,n.jsx)("span",{className:o,style:{background:"#fbbe3c"}}),(0,n.jsx)("span",{className:o,style:{background:"#58cb42"}})]}),(0,n.jsx)("div",{className:(0,r.Z)("browserWindowAddressBar_Pd8y","text--truncate"),children:i}),(0,n.jsx)("div",{className:"browserWindowMenuIcon_Vhuh",children:(0,n.jsxs)("div",{children:[(0,n.jsx)("span",{className:a}),(0,n.jsx)("span",{className:a}),(0,n.jsx)("span",{className:a})]})})]}),(0,n.jsx)("div",{className:"browserWindowBody_Idgs",style:l,children:s})]})}},39468:function(e,s,t){t.d(s,{Z:()=>o});var n=t(85893),r=t(67294);function o(e){let{children:s="Boom!",message:t="Boom!\nSomething bad happened, but you can try again!",cause:o}=e,[a,i]=(0,r.useState)(!1);if(a)throw Error(t,{cause:o?Error(o):void 0});return(0,n.jsx)("button",{className:"button button--danger",type:"button",onClick:()=>i(!0),children:s})}},80980:function(e,s,t){t.d(s,{Z:()=>i,a:()=>a});var n=t(67294);let r={},o=n.createContext(r);function a(e){let s=n.useContext(o);return n.useMemo(function(){return"function"==typeof e?e(s):{...s,...e}},[s,e])}function i(e){let s;return s=e.disableParentContext?"function"==typeof e.components?e.components(r):e.components||r:a(e.components),n.createElement(o.Provider,{value:s},e.children)}},70694:function(e){e.exports=JSON.parse('{"permalink":"/blog/releases/3.1","editUrl":"https://github.com/facebook/docusaurus/edit/main/website/blog/releases/3.1/index.mdx","source":"@site/blog/releases/3.1/index.mdx","title":"Docusaurus 3.1","description":"We are happy to announce Docusaurus 3.1.","date":"2024-01-05T00:00:00.000Z","tags":[{"inline":false,"label":"Release","permalink":"/blog/tags/release","description":"Blog posts about Docusaurus\' new releases"}],"readingTime":1.665,"hasTruncateMarker":true,"authors":[{"name":"S\xe9bastien Lorber","title":"Docusaurus maintainer, This Week In React editor","url":"https://thisweekinreact.com","page":{"permalink":"/blog/authors/slorber"},"description":"A freelance React and React-Native developer near Paris and Docusaurus maintainer. Also runs ThisWeekInReact.com, a newsletter to stay updated with the React ecosystem.","socials":{"bluesky":"https://bsky.app/profile/sebastienlorber.com","x":"https://x.com/sebastienlorber","linkedin":"https://www.linkedin.com/in/sebastienlorber/","github":"https://github.com/slorber","instagram":"https://www.instagram.com/thisweekinreact","newsletter":"https://thisweekinreact.com"},"imageURL":"https://github.com/slorber.png","key":"slorber"}],"frontMatter":{"title":"Docusaurus 3.1","authors":["slorber"],"tags":["release"],"image":"./img/social-card.png","date":"2024-01-05T00:00:00.000Z"},"unlisted":false,"lastUpdatedAt":1744293302000,"lastUpdatedBy":"S\xe9bastien Lorber","prevItem":{"title":"Docusaurus 3.2","permalink":"/blog/releases/3.2"},"nextItem":{"title":"Announcing Docusaurus 3.0","permalink":"/blog/releases/3.0"}}')}}]); \ No newline at end of file diff --git a/assets/js/03a06760.05a30b89.js b/assets/js/03a06760.05a30b89.js deleted file mode 100644 index d1fc0ddc5e..0000000000 --- a/assets/js/03a06760.05a30b89.js +++ /dev/null @@ -1,22 +0,0 @@ -"use strict";(self.webpackChunkwebsite=self.webpackChunkwebsite||[]).push([["37874"],{97199:function(e,t,n){n.r(t),n.d(t,{frontMatter:()=>u,default:()=>m,contentTitle:()=>d,assets:()=>h,toc:()=>p,metadata:()=>r});var r=JSON.parse('{"id":"api/plugins/plugin-google-analytics","title":"\uD83D\uDCE6 plugin-google-analytics","description":"The default Google Analytics plugin. It is a JavaScript library for measuring how users interact with your website in the production build. If you are using Google Analytics 4 you might need to consider using plugin-google-gtag instead.","source":"@site/docs/api/plugins/plugin-google-analytics.mdx","sourceDirName":"api/plugins","slug":"/api/plugins/@docusaurus/plugin-google-analytics","permalink":"/docs/api/plugins/@docusaurus/plugin-google-analytics","draft":false,"unlisted":false,"editUrl":"https://github.com/facebook/docusaurus/edit/main/website/docs/api/plugins/plugin-google-analytics.mdx","tags":[],"version":"current","lastUpdatedBy":"Ben McCann","lastUpdatedAt":1744155424000,"sidebarPosition":6,"frontMatter":{"sidebar_position":6,"slug":"/api/plugins/@docusaurus/plugin-google-analytics"},"sidebar":"api","previous":{"title":"\uD83D\uDCE6 plugin-debug","permalink":"/docs/api/plugins/@docusaurus/plugin-debug"},"next":{"title":"\uD83D\uDCE6 plugin-google-gtag","permalink":"/docs/api/plugins/@docusaurus/plugin-google-gtag"}}'),s=n(85893),l=n(80980),a=n(15398),i=n(58636),o=n(32240),c=n(66359);let u={sidebar_position:6,slug:"/api/plugins/@docusaurus/plugin-google-analytics"},d="\uD83D\uDCE6 plugin-google-analytics",h={},p=[{value:"Installation",id:"installation",level:2},{value:"Configuration",id:"configuration",level:2},{value:"Example configuration",id:"ex-config",level:3}];function g(e){let t={a:"a",admonition:"admonition",code:"code",h1:"h1",h2:"h2",h3:"h3",header:"header",p:"p",pre:"pre",strong:"strong",table:"table",tbody:"tbody",td:"td",th:"th",thead:"thead",tr:"tr",...(0,l.a)(),...e.components};return(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(t.header,{children:(0,s.jsx)(t.h1,{id:"-plugin-google-analytics",children:"\uD83D\uDCE6 plugin-google-analytics"})}),"\n","\n",(0,s.jsxs)(t.p,{children:["The default ",(0,s.jsx)(t.a,{href:"https://developers.google.com/analytics/devguides/collection/analyticsjs/",children:"Google Analytics"})," plugin. It is a JavaScript library for measuring how users interact with your website ",(0,s.jsx)(t.strong,{children:"in the production build"}),". If you are using Google Analytics 4 you might need to consider using ",(0,s.jsx)(t.a,{href:"/docs/api/plugins/@docusaurus/plugin-google-gtag",children:"plugin-google-gtag"})," instead."]}),"\n",(0,s.jsxs)(t.admonition,{title:"Deprecated",type:"danger",children:[(0,s.jsxs)(t.p,{children:["This plugin is ",(0,s.jsx)(t.strong,{children:"deprecated"})," and became useless on July 1, 2023."]}),(0,s.jsxs)(t.p,{children:["Google is ",(0,s.jsx)(t.a,{href:"https://blog.google/products/marketingplatform/analytics/prepare-for-future-with-google-analytics-4/",children:"moving away from Universal Analytics"}),"."]}),(0,s.jsxs)(t.p,{children:["If you are still using this plugin with a ",(0,s.jsx)(t.code,{children:"UA-*"})," tracking id, you should create a Google Analytics 4 account as soon as possible, and use ",(0,s.jsx)(t.a,{href:"/docs/api/plugins/@docusaurus/plugin-google-gtag",children:(0,s.jsx)(t.code,{children:"@docusaurus/plugin-google-gtag"})})," instead of this plugin. More details ",(0,s.jsx)(t.a,{href:"https://github.com/facebook/docusaurus/issues/7221",children:"here"}),"."]})]}),"\n",(0,s.jsx)(t.admonition,{title:"production only",type:"warning",children:(0,s.jsxs)(t.p,{children:["This plugin is always inactive in development and ",(0,s.jsx)(t.strong,{children:"only active in production"})," to avoid polluting the analytics statistics."]})}),"\n",(0,s.jsx)(t.h2,{id:"installation",children:"Installation"}),"\n",(0,s.jsxs)(a.Z,{groupId:"npm2yarn",children:[(0,s.jsx)(i.Z,{value:"npm",children:(0,s.jsx)(t.pre,{children:(0,s.jsx)(t.code,{className:"language-bash",children:"npm install --save @docusaurus/plugin-google-analytics\n"})})}),(0,s.jsx)(i.Z,{value:"yarn",label:"Yarn",children:(0,s.jsx)(t.pre,{children:(0,s.jsx)(t.code,{className:"language-bash",children:"yarn add @docusaurus/plugin-google-analytics\n"})})}),(0,s.jsx)(i.Z,{value:"pnpm",label:"pnpm",children:(0,s.jsx)(t.pre,{children:(0,s.jsx)(t.code,{className:"language-bash",children:"pnpm add @docusaurus/plugin-google-analytics\n"})})}),(0,s.jsx)(i.Z,{value:"bun",label:"Bun",children:(0,s.jsx)(t.pre,{children:(0,s.jsx)(t.code,{className:"language-bash",children:"bun add @docusaurus/plugin-google-analytics\n"})})})]}),"\n",(0,s.jsxs)(t.admonition,{type:"tip",children:[(0,s.jsxs)(t.p,{children:["If you use the preset ",(0,s.jsx)(t.code,{children:"@docusaurus/preset-classic"}),", you don't need to install this plugin as a dependency."]}),(0,s.jsxs)(t.p,{children:["You can configure this plugin through the ",(0,s.jsx)(t.a,{href:"/docs/using-plugins#docusauruspreset-classic",children:"preset options"}),"."]})]}),"\n",(0,s.jsx)(t.h2,{id:"configuration",children:"Configuration"}),"\n",(0,s.jsx)(t.p,{children:"Accepted fields:"}),"\n",(0,s.jsx)(o.Z,{children:(0,s.jsxs)(t.table,{children:[(0,s.jsx)(t.thead,{children:(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.th,{children:"Name"}),(0,s.jsx)(t.th,{children:"Type"}),(0,s.jsx)(t.th,{children:"Default"}),(0,s.jsx)(t.th,{children:"Description"})]})}),(0,s.jsxs)(t.tbody,{children:[(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.td,{children:(0,s.jsx)(t.code,{children:"trackingID"})}),(0,s.jsx)(t.td,{children:(0,s.jsx)(t.code,{children:"string"})}),(0,s.jsx)(t.td,{children:(0,s.jsx)(t.strong,{children:"Required"})}),(0,s.jsx)(t.td,{children:"The tracking ID of your analytics service."})]}),(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.td,{children:(0,s.jsx)(t.code,{children:"anonymizeIP"})}),(0,s.jsx)(t.td,{children:(0,s.jsx)(t.code,{children:"boolean"})}),(0,s.jsx)(t.td,{children:(0,s.jsx)(t.code,{children:"false"})}),(0,s.jsx)(t.td,{children:"Whether the IP should be anonymized when sending requests."})]})]})]})}),"\n",(0,s.jsx)(t.h3,{id:"ex-config",children:"Example configuration"}),"\n",(0,s.jsx)(t.p,{children:"You can configure this plugin through preset options or plugin options."}),"\n",(0,s.jsx)(t.admonition,{type:"tip",children:(0,s.jsx)(t.p,{children:"Most Docusaurus users configure this plugin through the preset options."})}),"\n","\n",(0,s.jsx)(c.Z,{pluginName:"@docusaurus/plugin-google-analytics",presetOptionName:"googleAnalytics",code:"{\n trackingID: 'UA-141789564-1',\n anonymizeIP: true,\n}"})]})}function m(e={}){let{wrapper:t}={...(0,l.a)(),...e.components};return t?(0,s.jsx)(t,{...e,children:(0,s.jsx)(g,{...e})}):g(e)}},58636:function(e,t,n){n.d(t,{Z:()=>l});var r=n(85893);n(67294);var s=n(90496);function l(e){let{children:t,hidden:n,className:l}=e;return(0,r.jsx)("div",{role:"tabpanel",className:(0,s.Z)("tabItem_pnkT",l),hidden:n,children:t})}},15398:function(e,t,n){n.d(t,{Z:()=>x});var r=n(85893),s=n(67294),l=n(90496),a=n(54947),i=n(3620),o=n(844),c=n(97486),u=n(32263),d=n(16971);function h(e){return s.Children.toArray(e).filter(e=>"\n"!==e).map(e=>{if(!e||(0,s.isValidElement)(e)&&function(e){let{props:t}=e;return!!t&&"object"==typeof t&&"value"in t}(e))return e;throw Error(`Docusaurus error: Bad child <${"string"==typeof e.type?e.type:e.type.name}>: all children of the component should be , and every should have a unique "value" prop.`)})?.filter(Boolean)??[]}function p(e){let{value:t,tabValues:n}=e;return n.some(e=>e.value===t)}var g=n(71607);function m(e){let{className:t,block:n,selectedValue:s,selectValue:i,tabValues:o}=e,c=[],{blockElementScrollPositionUntilNextRender:u}=(0,a.o5)(),d=e=>{let t=e.currentTarget,n=o[c.indexOf(t)].value;n!==s&&(u(t),i(n))},h=e=>{let t=null;switch(e.key){case"Enter":d(e);break;case"ArrowRight":{let n=c.indexOf(e.currentTarget)+1;t=c[n]??c[0];break}case"ArrowLeft":{let n=c.indexOf(e.currentTarget)-1;t=c[n]??c[c.length-1]}}t?.focus()};return(0,r.jsx)("ul",{role:"tablist","aria-orientation":"horizontal",className:(0,l.Z)("tabs",{"tabs--block":n},t),children:o.map(e=>{let{value:t,label:n,attributes:a}=e;return(0,r.jsx)("li",{role:"tab",tabIndex:s===t?0:-1,"aria-selected":s===t,ref:e=>{c.push(e)},onKeyDown:h,onClick:d,...a,className:(0,l.Z)("tabs__item","tabItem_AQgk",a?.className,{"tabs__item--active":s===t}),children:n??t},t)})})}function f(e){let{lazy:t,children:n,selectedValue:a}=e,i=(Array.isArray(n)?n:[n]).filter(Boolean);if(t){let e=i.find(e=>e.props.value===a);return e?(0,s.cloneElement)(e,{className:(0,l.Z)("margin-top--md",e.props.className)}):null}return(0,r.jsx)("div",{className:"margin-top--md",children:i.map((e,t)=>(0,s.cloneElement)(e,{key:t,hidden:e.props.value!==a}))})}function b(e){let t=function(e){let{defaultValue:t,queryString:n=!1,groupId:r}=e,l=function(e){let{values:t,children:n}=e;return(0,s.useMemo)(()=>{let e=t??h(n).map(e=>{let{props:{value:t,label:n,attributes:r,default:s}}=e;return{value:t,label:n,attributes:r,default:s}}),r=(0,u.lx)(e,(e,t)=>e.value===t.value);if(r.length>0)throw Error(`Docusaurus error: Duplicate values "${r.map(e=>e.value).join(", ")}" found in . Every value needs to be unique.`);return e},[t,n])}(e),[a,g]=(0,s.useState)(()=>(function(e){let{defaultValue:t,tabValues:n}=e;if(0===n.length)throw Error("Docusaurus error: the component requires at least one children component");if(t){if(!p({value:t,tabValues:n}))throw Error(`Docusaurus error: The has a defaultValue "${t}" but none of its children has the corresponding value. Available values are: ${n.map(e=>e.value).join(", ")}. If you intend to show no default tab, use defaultValue={null} instead.`);return t}let r=n.find(e=>e.default)??n[0];if(!r)throw Error("Unexpected error: 0 tabValues");return r.value})({defaultValue:t,tabValues:l})),[m,f]=function(e){let{queryString:t=!1,groupId:n}=e,r=(0,i.k6)(),l=function(e){let{queryString:t=!1,groupId:n}=e;if("string"==typeof t)return t;if(!1===t)return null;if(!0===t&&!n)throw Error('Docusaurus error: The component groupId prop is required if queryString=true, because this value is used as the search param name. You can also provide an explicit value such as queryString="my-search-param".');return n??null}({queryString:t,groupId:n});return[(0,c._X)(l),(0,s.useCallback)(e=>{if(!l)return;let t=new URLSearchParams(r.location.search);t.set(l,e),r.replace({...r.location,search:t.toString()})},[l,r])]}({queryString:n,groupId:r}),[b,x]=function(e){let{groupId:t}=e,n=t?`docusaurus.tab.${t}`:null,[r,l]=(0,d.Nk)(n);return[r,(0,s.useCallback)(e=>{n&&l.set(e)},[n,l])]}({groupId:r}),j=(()=>{let e=m??b;return p({value:e,tabValues:l})?e:null})();return(0,o.Z)(()=>{j&&g(j)},[j]),{selectedValue:a,selectValue:(0,s.useCallback)(e=>{if(!p({value:e,tabValues:l}))throw Error(`Can't select invalid tab value=${e}`);g(e),f(e),x(e)},[f,x,l]),tabValues:l}}(e);return(0,r.jsxs)("div",{className:(0,l.Z)("tabs-container","tabList_Qoir"),children:[(0,r.jsx)(m,{...t,...e}),(0,r.jsx)(f,{...t,...e})]})}function x(e){let t=(0,g.Z)();return(0,r.jsx)(b,{...e,children:h(e.children)},String(t))}},56497:function(e,t,n){n.d(t,{Z:()=>l});var r=n(85893);n(67294);var s=n(71607);function l(e){let{children:t,fallback:n}=e;return(0,s.Z)()?(0,r.jsx)(r.Fragment,{children:t?.()}):n??null}},32240:function(e,t,n){n.d(t,{Z:()=>o});var r=n(85893),s=n(67294),l=n(96700),a=n(3620);let i=s.forwardRef(function(e,t){let{name:n,children:i}=e,o=function(e){let t=e;for(;(0,s.isValidElement)(t);)[t]=s.Children.toArray(t.props.children);if("string"!=typeof t)throw Error(`Could not extract APITable row name from JSX tree: -${JSON.stringify(e,null,2)}`);return t}(i),c=n?`${n}-${o}`:o,u=`#${c}`,d=(0,a.k6)();return(0,l.Z)().collectAnchor(c),(0,r.jsx)("tr",{id:c,tabIndex:0,ref:d.location.hash===u?t:void 0,onClick:e=>{let t="TD"===e.target.tagName.toUpperCase(),n=!!window.getSelection()?.toString();t&&!n&&d.push(u)},onKeyDown:e=>{"Enter"===e.key&&d.push(u)},children:i.props.children})});function o(e){let{children:t,name:n}=e;if("table"!==t.type)throw Error("Bad usage of APITable component.\nIt is probably that your Markdown table is malformed.\nMake sure to double-check you have the appropriate number of columns for each table row.");let[l,a]=s.Children.toArray(t.props.children),o=(0,s.useRef)(null);(0,s.useEffect)(()=>{o.current?.focus()},[o]);let c=s.Children.map(a.props.children,e=>(0,r.jsx)(i,{name:n,ref:o,children:e}));return(0,r.jsxs)("table",{className:"apiTable_e8hp",children:[l,(0,r.jsx)("tbody",{children:c})]})}},66359:function(e,t,n){n.d(t,{Z:()=>d});var r=n(85893);n(67294);var s=n(35363),l=n(90158),a=n(77827),i=n(15398),o=n(58636),c=n(93278);let u=void 0;function d(e){let{code:t,pluginName:n,presetOptionName:d}=e,h=(0,l.zu)(u).path;return(0,r.jsxs)(i.Z,{groupId:"api-config-ex",children:[(0,r.jsxs)(o.Z,{value:"preset",label:(0,a.I)({message:"Preset options"}),children:[(0,r.jsx)("p",{children:(0,r.jsx)(a.Z,{id:"apiDocs.configTabs.presetOptions.description",values:{presetLink:(0,r.jsx)(s.Z,{to:`${h}/using-plugins#docusauruspreset-classic`,children:(0,r.jsx)(a.Z,{children:"preset options"})})},children:"If you use a preset, configure this plugin through the {presetLink}:"})}),(0,r.jsx)(c.Z,{language:"js",title:"docusaurus.config.js",children:`module.exports = { - presets: [ - [ - '@docusaurus/preset-classic', - { - // highlight-start - ${d}: ${t.replace(/\n/g,"\n ")}, - // highlight-end - }, - ], - ], -};`})]}),(0,r.jsxs)(o.Z,{value:"plugin",label:(0,a.I)({message:"Plugin options"}),children:[(0,r.jsx)("p",{children:(0,r.jsx)(a.Z,{children:"If you are using a standalone plugin, provide options directly to the plugin:"})}),(0,r.jsx)(c.Z,{language:"js",title:"docusaurus.config.js",children:`module.exports = { - plugins: [ - [ - '${n}', - // highlight-start - ${t.replace(/\n/g,"\n ")}, - // highlight-end - ], - ], -};`})]})]})}},93278:function(e,t,n){n.d(t,{Z:()=>ep});var r,s={};n.r(s),n.d(s,{ButtonExample:()=>C});var l=n(85893),a=n(67294),i=n(90496),o=n(71607),c=n(10075),u=n(77827),d=n(8156),h=n(56497),p=n(85108),g=n(45245),m=n(26378);function f(){let{prism:e}=(0,m.L)(),{colorMode:t}=(0,g.I)(),n=e.theme,r=e.darkTheme||n;return"dark"===t?r:n}var b=n(67490);function x(e){let{children:t}=e;return(0,l.jsx)("div",{className:(0,i.Z)("playgroundHeader_Tvsk"),children:t})}function j(){return(0,l.jsx)("div",{children:"Loading..."})}function y(){return(0,l.jsx)(h.Z,{fallback:(0,l.jsx)(j,{}),children:()=>(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)(b.Z,{fallback:e=>(0,l.jsx)(p.Ac,{...e}),children:(0,l.jsx)(c.i5,{})}),(0,l.jsx)(c.IF,{})]})})}function v(){return(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)(x,{children:(0,l.jsx)(u.Z,{id:"theme.Playground.result",description:"The result label of the live codeblocks",children:"Result"})}),(0,l.jsx)("div",{className:"playgroundPreview_mApW",children:(0,l.jsx)(y,{})})]})}function k(){let e=(0,o.Z)();return(0,l.jsx)(c.uz,{className:"playgroundEditor_TySg"},String(e))}function w(){return(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)(x,{children:(0,l.jsx)(u.Z,{id:"theme.Playground.liveEditor",description:"The live editor label of the live codeblocks",children:"Live Editor"})}),(0,l.jsx)(k,{})]})}let N=e=>`${e};`;function B(e){let{children:t,transformCode:n,...r}=e,{siteConfig:{themeConfig:s}}=(0,d.Z)(),{liveCodeBlock:{playgroundPosition:a}}=s,i=f(),o=r.metastring?.includes("noInline")??!1;return(0,l.jsx)("div",{className:"playgroundContainer_6Ior",children:(0,l.jsx)(c.nu,{code:t?.replace(/\n$/,""),noInline:o,transformCode:n??N,theme:i,...r,children:"top"===a?(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)(v,{}),(0,l.jsx)(w,{})]}):(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)(w,{}),(0,l.jsx)(v,{})]})})})}function C(e){return(0,l.jsx)("button",{type:"button",...e,style:{backgroundColor:"white",color:"black",border:"solid red",borderRadius:20,padding:10,cursor:"pointer",...e.style}})}let I={React:a,...a,...s};var Z=n(55951),L=n(6324),E=n.n(L),T=n(50923);let A=/title=(? ["'])(?.*?)\1/,_=/\{(? [\d,-]+)\}/,S={js:{start:"\\/\\/",end:""},jsBlock:{start:"\\/\\*",end:"\\*\\/"},jsx:{start:"\\{\\s*\\/\\*",end:"\\*\\/\\s*\\}"},bash:{start:"#",end:""},html:{start:"\x3c!--",end:"--\x3e"}},$={...S,lua:{start:"--",end:""},wasm:{start:"\\;\\;",end:""},tex:{start:"%",end:""},vb:{start:"['\u2018\u2019]",end:""},vbnet:{start:"(?:_\\s*)?['\u2018\u2019]",end:""},rem:{start:"[Rr][Ee][Mm]\\b",end:""},f90:{start:"!",end:""},ml:{start:"\\(\\*",end:"\\*\\)"},cobol:{start:"\\*>",end:""}},D=Object.keys(S);function M(e,t){let n=e.map(e=>{let{start:n,end:r}=$[e];return`(?:${n}\\s*(${t.flatMap(e=>[e.line,e.block?.start,e.block?.end].filter(Boolean)).join("|")})\\s*${r})`}).join("|");return RegExp(`^\\s*(?:${n})\\s*$`)}let R=(0,a.createContext)(null);function W(e){let{metadata:t,wordWrap:n,children:r}=e,s=(0,a.useMemo)(()=>({metadata:t,wordWrap:n}),[t,n]);return(0,l.jsx)(R.Provider,{value:s,children:r})}function O(){let e=(0,a.useContext)(R);if(null===e)throw new T.i6("CodeBlockContextProvider");return e}function P(e){let{as:t,...n}=e,r=function(e){let t={color:"--prism-color",backgroundColor:"--prism-background-color"},n={};return Object.entries(e.plain).forEach(e=>{let[r,s]=e,l=t[r];l&&"string"==typeof s&&(n[l]=s)}),n}(f());return(0,l.jsx)(t,{...n,style:r,className:(0,i.Z)(n.className,"codeBlockContainer_jDV4",Z.k.common.codeBlock)})}let V={codeBlock:"codeBlock_Gebt",codeBlockStandalone:"codeBlockStandalone_i_cY",codeBlockLines:"codeBlockLines_FJaf",codeBlockLinesWithNumbering:"codeBlockLinesWithNumbering_FU9Q"};function q(e){let{children:t,className:n}=e;return(0,l.jsx)(P,{as:"pre",tabIndex:0,className:(0,i.Z)(V.codeBlockStandalone,"thin-scrollbar",n),children:(0,l.jsx)("code",{className:V.codeBlockLines,children:t})})}let z={attributes:!0,characterData:!0,childList:!0,subtree:!0};function F(e){let{children:t}=e;return t}var H=n(7316);function U(e){let{line:t,token:n,...r}=e;return(0,l.jsx)("span",{...r})}let G={codeLine:"codeLine_qRmp",codeLineNumber:"codeLineNumber_dS_J",codeLineContent:"codeLineContent_XF5l"};function J(e){let{line:t,classNames:n,showLineNumbers:r,getLineProps:s,getTokenProps:a}=e,o=function(e){let t=1===e.length&&"\n"===e[0].content?e[0]:void 0;return t?[{...t,content:""}]:e}(t),c=s({line:o,className:(0,i.Z)(n,r&&G.codeLine)}),u=o.map((e,t)=>{let n=a({token:e});return(0,l.jsx)(U,{...n,line:o,token:e,children:n.children},t)});return(0,l.jsxs)("span",{...c,children:[r?(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)("span",{className:G.codeLineNumber}),(0,l.jsx)("span",{className:G.codeLineContent,children:u})]}):u,(0,l.jsx)("br",{})]})}let X=a.forwardRef((e,t)=>(0,l.jsx)("pre",{ref:t,tabIndex:0,...e,className:(0,i.Z)(e.className,V.codeBlock,"thin-scrollbar")}));function Q(e){let{metadata:t}=O();return(0,l.jsx)("code",{...e,className:(0,i.Z)(e.className,V.codeBlockLines,void 0!==t.lineNumbersStart&&V.codeBlockLinesWithNumbering),style:{...e.style,counterReset:void 0===t.lineNumbersStart?void 0:`line-count ${t.lineNumbersStart-1}`}})}function Y(e){let{className:t}=e,{metadata:n,wordWrap:r}=O(),s=f(),{code:a,language:o,lineNumbersStart:c,lineClassNames:u}=n;return(0,l.jsx)(H.y$,{theme:s,code:a,language:o,children:e=>{let{className:n,style:s,tokens:a,getLineProps:o,getTokenProps:d}=e;return(0,l.jsx)(X,{ref:r.codeBlockRef,className:(0,i.Z)(t,n),style:s,children:(0,l.jsx)(Q,{children:a.map((e,t)=>(0,l.jsx)(J,{line:e,getLineProps:o,getTokenProps:d,classNames:u[t],showLineNumbers:void 0!==c},t))})})}})}var K=n(44771);function ee(e){let{className:t,...n}=e;return(0,l.jsx)("button",{type:"button",...n,className:(0,i.Z)("clean-btn",t)})}function et(e){return(0,l.jsx)("svg",{viewBox:"0 0 24 24",...e,children:(0,l.jsx)("path",{fill:"currentColor",d:"M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"})})}function en(e){return(0,l.jsx)("svg",{viewBox:"0 0 24 24",...e,children:(0,l.jsx)("path",{fill:"currentColor",d:"M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"})})}let er={copyButtonCopied:"copyButtonCopied_wDuR",copyButtonIcons:"copyButtonIcons_gMWc",copyButtonIcon:"copyButtonIcon_GXfb",copyButtonSuccessIcon:"copyButtonSuccessIcon_ktUX"};function es(e){let{className:t}=e,{copyCode:n,isCopied:r}=function(){let{metadata:{code:e}}=O(),[t,n]=(0,a.useState)(!1),r=(0,a.useRef)(void 0),s=(0,a.useCallback)(()=>{(0,K.Z)(e),n(!0),r.current=window.setTimeout(()=>{n(!1)},1e3)},[e]);return(0,a.useEffect)(()=>()=>window.clearTimeout(r.current),[]),{copyCode:s,isCopied:t}}();return(0,l.jsx)(ee,{"aria-label":r?(0,u.I)({id:"theme.CodeBlock.copied",message:"Copied",description:"The copied button label on code blocks"}):(0,u.I)({id:"theme.CodeBlock.copyButtonAriaLabel",message:"Copy code to clipboard",description:"The ARIA label for copy code blocks button"}),title:(0,u.I)({id:"theme.CodeBlock.copy",message:"Copy",description:"The copy button label on code blocks"}),className:(0,i.Z)(t,er.copyButton,r&&er.copyButtonCopied),onClick:n,children:(0,l.jsxs)("span",{className:er.copyButtonIcons,"aria-hidden":"true",children:[(0,l.jsx)(et,{className:er.copyButtonIcon}),(0,l.jsx)(en,{className:er.copyButtonSuccessIcon})]})})}function el(e){return(0,l.jsx)("svg",{viewBox:"0 0 24 24",...e,children:(0,l.jsx)("path",{fill:"currentColor",d:"M4 19h6v-2H4v2zM20 5H4v2h16V5zm-3 6H4v2h13.25c1.1 0 2 .9 2 2s-.9 2-2 2H15v-2l-3 3l3 3v-2h2c2.21 0 4-1.79 4-4s-1.79-4-4-4z"})})}let ea={wordWrapButtonIcon:"wordWrapButtonIcon___5r",wordWrapButtonEnabled:"wordWrapButtonEnabled_nam_"};function ei(e){let{className:t}=e,{wordWrap:n}=O();if(!(n.isEnabled||n.isCodeScrollable))return!1;let r=(0,u.I)({id:"theme.CodeBlock.wordWrapToggle",message:"Toggle word wrap",description:"The title attribute for toggle word wrapping button of code block lines"});return(0,l.jsx)(ee,{onClick:()=>n.toggle(),className:(0,i.Z)(t,n.isEnabled&&ea.wordWrapButtonEnabled),"aria-label":r,title:r,children:(0,l.jsx)(el,{className:ea.wordWrapButtonIcon,"aria-hidden":"true"})})}function eo(e){let{className:t}=e;return(0,l.jsx)(h.Z,{children:()=>(0,l.jsxs)("div",{className:(0,i.Z)(t,"buttonGroup_KXnS"),children:[(0,l.jsx)(ei,{}),(0,l.jsx)(es,{})]})})}let ec={codeBlockContent:"codeBlockContent_cKMj",codeBlockTitle:"codeBlockTitle_U6Q0"};function eu(e){let{className:t}=e,{metadata:n}=O();return(0,l.jsxs)(P,{as:"div",className:(0,i.Z)(t,n.className),children:[n.title&&(0,l.jsx)("div",{className:ec.codeBlockTitle,children:(0,l.jsx)(F,{children:n.title})}),(0,l.jsxs)("div",{className:ec.codeBlockContent,children:[(0,l.jsx)(Y,{}),(0,l.jsx)(eo,{})]})]})}function ed(e){let t=function(e){let{prism:t}=(0,m.L)();return function(e){var t,n,r;let s=(n=(t={language:e.language,defaultLanguage:e.defaultLanguage,className:e.className}).language??function(e){if(!e)return;let t=e.split(" ").find(e=>e.startsWith("language-"));return t?.replace(/language-/,"")}(t.className)??t.defaultLanguage,n?.toLowerCase()??"text"),{lineClassNames:l,code:a}=function(e,t){let n=e.replace(/\r?\n$/,"");return function(e,t){let{metastring:n,magicComments:r}=t;if(n&&_.test(n)){let t=n.match(_).groups.range;if(0===r.length)throw Error(`A highlight range has been given in code block's metastring (\`\`\` ${n}), but no magic comment config is available. Docusaurus applies the first magic comment entry's className for metastring ranges.`);let s=r[0].className;return{lineClassNames:Object.fromEntries(E()(t).filter(e=>e>0).map(e=>[e-1,[s]])),code:e}}return null}(n,{...t})??function(e,t){let{language:n,magicComments:r}=t;if(void 0===n)return{lineClassNames:{},code:e};let s=function(e,t){switch(e){case"js":case"javascript":case"ts":case"typescript":return M(["js","jsBlock"],t);case"jsx":case"tsx":return M(["js","jsBlock","jsx"],t);case"html":return M(["js","jsBlock","html"],t);case"python":case"py":case"bash":return M(["bash"],t);case"markdown":case"md":return M(["html","jsx","bash"],t);case"tex":case"latex":case"matlab":return M(["tex"],t);case"lua":case"haskell":return M(["lua"],t);case"sql":return M(["lua","jsBlock"],t);case"wasm":return M(["wasm"],t);case"vb":case"vba":case"visual-basic":return M(["vb","rem"],t);case"vbnet":return M(["vbnet","rem"],t);case"batch":return M(["rem"],t);case"basic":return M(["rem","f90"],t);case"fsharp":return M(["js","ml"],t);case"ocaml":case"sml":return M(["ml"],t);case"fortran":return M(["f90"],t);case"cobol":return M(["cobol"],t);default:return M(D,t)}}(n,r),l=e.split(/\r?\n/),a=Object.fromEntries(r.map(e=>[e.className,{start:0,range:""}])),i=Object.fromEntries(r.filter(e=>e.line).map(e=>{let{className:t,line:n}=e;return[n,t]})),o=Object.fromEntries(r.filter(e=>e.block).map(e=>{let{className:t,block:n}=e;return[n.start,t]})),c=Object.fromEntries(r.filter(e=>e.block).map(e=>{let{className:t,block:n}=e;return[n.end,t]}));for(let e=0;e void 0!==e);i[n]?a[i[n]].range+=`${e},`:o[n]?a[o[n]].start=e:c[n]&&(a[c[n]].range+=`${a[c[n]].start}-${e-1},`),l.splice(e,1)}let u={};return Object.entries(a).forEach(e=>{let[t,{range:n}]=e;E()(n).forEach(e=>{u[e]??=[],u[e].push(t)})}),{code:l.join("\n"),lineClassNames:u}}(n,{...t})}(e.code,{metastring:e.metastring,magicComments:e.magicComments,language:s}),o=function(e){let{className:t,language:n}=e;return(0,i.Z)(t,n&&!t?.includes(`language-${n}`)&&`language-${n}`)}({className:e.className,language:s}),c=(r=e.metastring,(r?.match(A)?.groups.title??"")||e.title),u=function(e){let{showLineNumbers:t,metastring:n}=e;if("boolean"==typeof t)return t?1:void 0;if("number"==typeof t)return t;let r=n?.split(" ").find(e=>e.startsWith("showLineNumbers"));if(r)return r.startsWith("showLineNumbers=")?parseInt(r.replace("showLineNumbers=",""),10):1}({showLineNumbers:e.showLineNumbers,metastring:e.metastring});return{codeInput:e.code,code:a,className:o,language:s,title:c,lineNumbersStart:u,lineClassNames:l}}({code:e.children,className:e.className,metastring:e.metastring,magicComments:t.magicComments,defaultLanguage:t.defaultLanguage,language:e.language,title:e.title,showLineNumbers:e.showLineNumbers})}(e),n=function(){let[e,t]=(0,a.useState)(!1),[n,r]=(0,a.useState)(!1),s=(0,a.useRef)(null),l=(0,a.useCallback)(()=>{let n=s.current.querySelector("code");e?n.removeAttribute("style"):(n.style.whiteSpace="pre-wrap",n.style.overflowWrap="anywhere"),t(e=>!e)},[s,e]),i=(0,a.useCallback)(()=>{let{scrollWidth:e,clientWidth:t}=s.current;r(e>t||s.current.querySelector("code").hasAttribute("style"))},[s]),[o,c]=(0,a.useState)(),u=(0,a.useCallback)(()=>{c(s.current?.closest("[role=tabpanel][hidden]"))},[s,c]);return(0,a.useEffect)(()=>{u()},[u]),!function(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:z,r=(0,T.zX)(t),s=(0,T.Ql)(n);(0,a.useEffect)(()=>{let t=new MutationObserver(r);return e&&t.observe(e,s),()=>t.disconnect()},[e,r,s])}(o,e=>{e.forEach(e=>{"attributes"===e.type&&"hidden"===e.attributeName&&(i(),u())})},{attributes:!0,characterData:!1,childList:!1,subtree:!1}),(0,a.useEffect)(()=>{i()},[e,i]),(0,a.useEffect)(()=>(window.addEventListener("resize",i,{passive:!0}),()=>{window.removeEventListener("resize",i)}),[i]),{codeBlockRef:s,isEnabled:e,isCodeScrollable:n,toggle:l}}();return(0,l.jsx)(W,{metadata:t,wordWrap:n,children:(0,l.jsx)(eu,{})})}let eh=(r=function(e){let{children:t,...n}=e,r=(0,o.Z)(),s=a.Children.toArray(t).some(e=>(0,a.isValidElement)(e))?t:Array.isArray(t)?t.join(""):t;return(0,l.jsx)("string"==typeof s?ed:q,{...n,children:s},String(r))},function(e){return e.live?(0,l.jsx)(B,{scope:I,...e}):(0,l.jsx)(r,{...e})});function ep(e){return(0,l.jsx)(eh,{...e})}}}]); \ No newline at end of file diff --git a/assets/js/03a06760.141f54f0.js b/assets/js/03a06760.141f54f0.js new file mode 100644 index 0000000000..871ebc16f7 --- /dev/null +++ b/assets/js/03a06760.141f54f0.js @@ -0,0 +1,22 @@ +"use strict";(self.webpackChunkwebsite=self.webpackChunkwebsite||[]).push([["37874"],{97199:function(e,t,n){n.r(t),n.d(t,{frontMatter:()=>u,default:()=>m,contentTitle:()=>d,assets:()=>h,toc:()=>p,metadata:()=>r});var r=JSON.parse('{"id":"api/plugins/plugin-google-analytics","title":"\uD83D\uDCE6 plugin-google-analytics","description":"The default Google Analytics plugin. It is a JavaScript library for measuring how users interact with your website in the production build. If you are using Google Analytics 4 you might need to consider using plugin-google-gtag instead.","source":"@site/docs/api/plugins/plugin-google-analytics.mdx","sourceDirName":"api/plugins","slug":"/api/plugins/@docusaurus/plugin-google-analytics","permalink":"/docs/api/plugins/@docusaurus/plugin-google-analytics","draft":false,"unlisted":false,"editUrl":"https://github.com/facebook/docusaurus/edit/main/website/docs/api/plugins/plugin-google-analytics.mdx","tags":[],"version":"current","lastUpdatedBy":"S\xe9bastien Lorber","lastUpdatedAt":1744293302000,"sidebarPosition":6,"frontMatter":{"sidebar_position":6,"slug":"/api/plugins/@docusaurus/plugin-google-analytics"},"sidebar":"api","previous":{"title":"\uD83D\uDCE6 plugin-debug","permalink":"/docs/api/plugins/@docusaurus/plugin-debug"},"next":{"title":"\uD83D\uDCE6 plugin-google-gtag","permalink":"/docs/api/plugins/@docusaurus/plugin-google-gtag"}}'),s=n(85893),l=n(80980),a=n(15398),i=n(58636),o=n(32240),c=n(66359);let u={sidebar_position:6,slug:"/api/plugins/@docusaurus/plugin-google-analytics"},d="\uD83D\uDCE6 plugin-google-analytics",h={},p=[{value:"Installation",id:"installation",level:2},{value:"Configuration",id:"configuration",level:2},{value:"Example configuration",id:"ex-config",level:3}];function g(e){let t={a:"a",admonition:"admonition",code:"code",h1:"h1",h2:"h2",h3:"h3",header:"header",p:"p",pre:"pre",strong:"strong",table:"table",tbody:"tbody",td:"td",th:"th",thead:"thead",tr:"tr",...(0,l.a)(),...e.components};return(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(t.header,{children:(0,s.jsx)(t.h1,{id:"-plugin-google-analytics",children:"\uD83D\uDCE6 plugin-google-analytics"})}),"\n","\n",(0,s.jsxs)(t.p,{children:["The default ",(0,s.jsx)(t.a,{href:"https://developers.google.com/analytics/devguides/collection/analyticsjs/",children:"Google Analytics"})," plugin. It is a JavaScript library for measuring how users interact with your website ",(0,s.jsx)(t.strong,{children:"in the production build"}),". If you are using Google Analytics 4 you might need to consider using ",(0,s.jsx)(t.a,{href:"/docs/api/plugins/@docusaurus/plugin-google-gtag",children:"plugin-google-gtag"})," instead."]}),"\n",(0,s.jsxs)(t.admonition,{title:"Deprecated",type:"danger",children:[(0,s.jsxs)(t.p,{children:["This plugin is ",(0,s.jsx)(t.strong,{children:"deprecated"})," and became useless on July 1, 2023."]}),(0,s.jsxs)(t.p,{children:["Google is ",(0,s.jsx)(t.a,{href:"https://blog.google/products/marketingplatform/analytics/prepare-for-future-with-google-analytics-4/",children:"moving away from Universal Analytics"}),"."]}),(0,s.jsxs)(t.p,{children:["If you are still using this plugin with a ",(0,s.jsx)(t.code,{children:"UA-*"})," tracking id, you should create a Google Analytics 4 account as soon as possible, and use ",(0,s.jsx)(t.a,{href:"/docs/api/plugins/@docusaurus/plugin-google-gtag",children:(0,s.jsx)(t.code,{children:"@docusaurus/plugin-google-gtag"})})," instead of this plugin. More details ",(0,s.jsx)(t.a,{href:"https://github.com/facebook/docusaurus/issues/7221",children:"here"}),"."]})]}),"\n",(0,s.jsx)(t.admonition,{title:"production only",type:"warning",children:(0,s.jsxs)(t.p,{children:["This plugin is always inactive in development and ",(0,s.jsx)(t.strong,{children:"only active in production"})," to avoid polluting the analytics statistics."]})}),"\n",(0,s.jsx)(t.h2,{id:"installation",children:"Installation"}),"\n",(0,s.jsxs)(a.Z,{groupId:"npm2yarn",children:[(0,s.jsx)(i.Z,{value:"npm",children:(0,s.jsx)(t.pre,{children:(0,s.jsx)(t.code,{className:"language-bash",children:"npm install --save @docusaurus/plugin-google-analytics\n"})})}),(0,s.jsx)(i.Z,{value:"yarn",label:"Yarn",children:(0,s.jsx)(t.pre,{children:(0,s.jsx)(t.code,{className:"language-bash",children:"yarn add @docusaurus/plugin-google-analytics\n"})})}),(0,s.jsx)(i.Z,{value:"pnpm",label:"pnpm",children:(0,s.jsx)(t.pre,{children:(0,s.jsx)(t.code,{className:"language-bash",children:"pnpm add @docusaurus/plugin-google-analytics\n"})})}),(0,s.jsx)(i.Z,{value:"bun",label:"Bun",children:(0,s.jsx)(t.pre,{children:(0,s.jsx)(t.code,{className:"language-bash",children:"bun add @docusaurus/plugin-google-analytics\n"})})})]}),"\n",(0,s.jsxs)(t.admonition,{type:"tip",children:[(0,s.jsxs)(t.p,{children:["If you use the preset ",(0,s.jsx)(t.code,{children:"@docusaurus/preset-classic"}),", you don't need to install this plugin as a dependency."]}),(0,s.jsxs)(t.p,{children:["You can configure this plugin through the ",(0,s.jsx)(t.a,{href:"/docs/using-plugins#docusauruspreset-classic",children:"preset options"}),"."]})]}),"\n",(0,s.jsx)(t.h2,{id:"configuration",children:"Configuration"}),"\n",(0,s.jsx)(t.p,{children:"Accepted fields:"}),"\n",(0,s.jsx)(o.Z,{children:(0,s.jsxs)(t.table,{children:[(0,s.jsx)(t.thead,{children:(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.th,{children:"Name"}),(0,s.jsx)(t.th,{children:"Type"}),(0,s.jsx)(t.th,{children:"Default"}),(0,s.jsx)(t.th,{children:"Description"})]})}),(0,s.jsxs)(t.tbody,{children:[(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.td,{children:(0,s.jsx)(t.code,{children:"trackingID"})}),(0,s.jsx)(t.td,{children:(0,s.jsx)(t.code,{children:"string"})}),(0,s.jsx)(t.td,{children:(0,s.jsx)(t.strong,{children:"Required"})}),(0,s.jsx)(t.td,{children:"The tracking ID of your analytics service."})]}),(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.td,{children:(0,s.jsx)(t.code,{children:"anonymizeIP"})}),(0,s.jsx)(t.td,{children:(0,s.jsx)(t.code,{children:"boolean"})}),(0,s.jsx)(t.td,{children:(0,s.jsx)(t.code,{children:"false"})}),(0,s.jsx)(t.td,{children:"Whether the IP should be anonymized when sending requests."})]})]})]})}),"\n",(0,s.jsx)(t.h3,{id:"ex-config",children:"Example configuration"}),"\n",(0,s.jsx)(t.p,{children:"You can configure this plugin through preset options or plugin options."}),"\n",(0,s.jsx)(t.admonition,{type:"tip",children:(0,s.jsx)(t.p,{children:"Most Docusaurus users configure this plugin through the preset options."})}),"\n","\n",(0,s.jsx)(c.Z,{pluginName:"@docusaurus/plugin-google-analytics",presetOptionName:"googleAnalytics",code:"{\n trackingID: 'UA-141789564-1',\n anonymizeIP: true,\n}"})]})}function m(e={}){let{wrapper:t}={...(0,l.a)(),...e.components};return t?(0,s.jsx)(t,{...e,children:(0,s.jsx)(g,{...e})}):g(e)}},58636:function(e,t,n){n.d(t,{Z:()=>l});var r=n(85893);n(67294);var s=n(90496);function l(e){let{children:t,hidden:n,className:l}=e;return(0,r.jsx)("div",{role:"tabpanel",className:(0,s.Z)("tabItem_pnkT",l),hidden:n,children:t})}},15398:function(e,t,n){n.d(t,{Z:()=>j});var r=n(85893),s=n(67294),l=n(90496),a=n(54947),i=n(3620),o=n(844),c=n(97486),u=n(32263),d=n(16971);function h(e){return s.Children.toArray(e).filter(e=>"\n"!==e).map(e=>{if(!e||(0,s.isValidElement)(e)&&function(e){let{props:t}=e;return!!t&&"object"==typeof t&&"value"in t}(e))return e;throw Error(`Docusaurus error: Bad child <${"string"==typeof e.type?e.type:e.type.name}>: all children of the component should be , and every should have a unique "value" prop.`)})?.filter(Boolean)??[]}function p(e){let{value:t,tabValues:n}=e;return n.some(e=>e.value===t)}var g=n(71607);function m(e){let{className:t,block:n,selectedValue:s,selectValue:i,tabValues:o}=e,c=[],{blockElementScrollPositionUntilNextRender:u}=(0,a.o5)(),d=e=>{let t=e.currentTarget,n=o[c.indexOf(t)].value;n!==s&&(u(t),i(n))},h=e=>{let t=null;switch(e.key){case"Enter":d(e);break;case"ArrowRight":{let n=c.indexOf(e.currentTarget)+1;t=c[n]??c[0];break}case"ArrowLeft":{let n=c.indexOf(e.currentTarget)-1;t=c[n]??c[c.length-1]}}t?.focus()};return(0,r.jsx)("ul",{role:"tablist","aria-orientation":"horizontal",className:(0,l.Z)("tabs",{"tabs--block":n},t),children:o.map(e=>{let{value:t,label:n,attributes:a}=e;return(0,r.jsx)("li",{role:"tab",tabIndex:s===t?0:-1,"aria-selected":s===t,ref:e=>{c.push(e)},onKeyDown:h,onClick:d,...a,className:(0,l.Z)("tabs__item","tabItem_AQgk",a?.className,{"tabs__item--active":s===t}),children:n??t},t)})})}function f(e){let{lazy:t,children:n,selectedValue:a}=e,i=(Array.isArray(n)?n:[n]).filter(Boolean);if(t){let e=i.find(e=>e.props.value===a);return e?(0,s.cloneElement)(e,{className:(0,l.Z)("margin-top--md",e.props.className)}):null}return(0,r.jsx)("div",{className:"margin-top--md",children:i.map((e,t)=>(0,s.cloneElement)(e,{key:t,hidden:e.props.value!==a}))})}function x(e){let t=function(e){let{defaultValue:t,queryString:n=!1,groupId:r}=e,l=function(e){let{values:t,children:n}=e;return(0,s.useMemo)(()=>{let e=t??h(n).map(e=>{let{props:{value:t,label:n,attributes:r,default:s}}=e;return{value:t,label:n,attributes:r,default:s}}),r=(0,u.lx)(e,(e,t)=>e.value===t.value);if(r.length>0)throw Error(`Docusaurus error: Duplicate values "${r.map(e=>e.value).join(", ")}" found in . Every value needs to be unique.`);return e},[t,n])}(e),[a,g]=(0,s.useState)(()=>(function(e){let{defaultValue:t,tabValues:n}=e;if(0===n.length)throw Error("Docusaurus error: the component requires at least one children component");if(t){if(!p({value:t,tabValues:n}))throw Error(`Docusaurus error: The has a defaultValue "${t}" but none of its children has the corresponding value. Available values are: ${n.map(e=>e.value).join(", ")}. If you intend to show no default tab, use defaultValue={null} instead.`);return t}let r=n.find(e=>e.default)??n[0];if(!r)throw Error("Unexpected error: 0 tabValues");return r.value})({defaultValue:t,tabValues:l})),[m,f]=function(e){let{queryString:t=!1,groupId:n}=e,r=(0,i.k6)(),l=function(e){let{queryString:t=!1,groupId:n}=e;if("string"==typeof t)return t;if(!1===t)return null;if(!0===t&&!n)throw Error('Docusaurus error: The component groupId prop is required if queryString=true, because this value is used as the search param name. You can also provide an explicit value such as queryString="my-search-param".');return n??null}({queryString:t,groupId:n});return[(0,c._X)(l),(0,s.useCallback)(e=>{if(!l)return;let t=new URLSearchParams(r.location.search);t.set(l,e),r.replace({...r.location,search:t.toString()})},[l,r])]}({queryString:n,groupId:r}),[x,j]=function(e){let{groupId:t}=e,n=t?`docusaurus.tab.${t}`:null,[r,l]=(0,d.Nk)(n);return[r,(0,s.useCallback)(e=>{n&&l.set(e)},[n,l])]}({groupId:r}),b=(()=>{let e=m??x;return p({value:e,tabValues:l})?e:null})();return(0,o.Z)(()=>{b&&g(b)},[b]),{selectedValue:a,selectValue:(0,s.useCallback)(e=>{if(!p({value:e,tabValues:l}))throw Error(`Can't select invalid tab value=${e}`);g(e),f(e),j(e)},[f,j,l]),tabValues:l}}(e);return(0,r.jsxs)("div",{className:(0,l.Z)("tabs-container","tabList_Qoir"),children:[(0,r.jsx)(m,{...t,...e}),(0,r.jsx)(f,{...t,...e})]})}function j(e){let t=(0,g.Z)();return(0,r.jsx)(x,{...e,children:h(e.children)},String(t))}},56497:function(e,t,n){n.d(t,{Z:()=>l});var r=n(85893);n(67294);var s=n(71607);function l(e){let{children:t,fallback:n}=e;return(0,s.Z)()?(0,r.jsx)(r.Fragment,{children:t?.()}):n??null}},32240:function(e,t,n){n.d(t,{Z:()=>o});var r=n(85893),s=n(67294),l=n(96700),a=n(3620);let i=s.forwardRef(function(e,t){let{name:n,children:i}=e,o=function(e){let t=e;for(;(0,s.isValidElement)(t);)[t]=s.Children.toArray(t.props.children);if("string"!=typeof t)throw Error(`Could not extract APITable row name from JSX tree: +${JSON.stringify(e,null,2)}`);return t}(i),c=n?`${n}-${o}`:o,u=`#${c}`,d=(0,a.k6)();return(0,l.Z)().collectAnchor(c),(0,r.jsx)("tr",{id:c,tabIndex:0,ref:d.location.hash===u?t:void 0,onClick:e=>{let t="TD"===e.target.tagName.toUpperCase(),n=!!window.getSelection()?.toString();t&&!n&&d.push(u)},onKeyDown:e=>{"Enter"===e.key&&d.push(u)},children:i.props.children})});function o(e){let{children:t,name:n}=e;if("table"!==t.type)throw Error("Bad usage of APITable component.\nIt is probably that your Markdown table is malformed.\nMake sure to double-check you have the appropriate number of columns for each table row.");let[l,a]=s.Children.toArray(t.props.children),o=(0,s.useRef)(null);(0,s.useEffect)(()=>{o.current?.focus()},[o]);let c=s.Children.map(a.props.children,e=>(0,r.jsx)(i,{name:n,ref:o,children:e}));return(0,r.jsxs)("table",{className:"apiTable_e8hp",children:[l,(0,r.jsx)("tbody",{children:c})]})}},66359:function(e,t,n){n.d(t,{Z:()=>d});var r=n(85893);n(67294);var s=n(35363),l=n(90158),a=n(77827),i=n(15398),o=n(58636),c=n(27817);let u=void 0;function d(e){let{code:t,pluginName:n,presetOptionName:d}=e,h=(0,l.zu)(u).path;return(0,r.jsxs)(i.Z,{groupId:"api-config-ex",children:[(0,r.jsxs)(o.Z,{value:"preset",label:(0,a.I)({message:"Preset options"}),children:[(0,r.jsx)("p",{children:(0,r.jsx)(a.Z,{id:"apiDocs.configTabs.presetOptions.description",values:{presetLink:(0,r.jsx)(s.Z,{to:`${h}/using-plugins#docusauruspreset-classic`,children:(0,r.jsx)(a.Z,{children:"preset options"})})},children:"If you use a preset, configure this plugin through the {presetLink}:"})}),(0,r.jsx)(c.Z,{language:"js",title:"docusaurus.config.js",children:`module.exports = { + presets: [ + [ + '@docusaurus/preset-classic', + { + // highlight-start + ${d}: ${t.replace(/\n/g,"\n ")}, + // highlight-end + }, + ], + ], +};`})]}),(0,r.jsxs)(o.Z,{value:"plugin",label:(0,a.I)({message:"Plugin options"}),children:[(0,r.jsx)("p",{children:(0,r.jsx)(a.Z,{children:"If you are using a standalone plugin, provide options directly to the plugin:"})}),(0,r.jsx)(c.Z,{language:"js",title:"docusaurus.config.js",children:`module.exports = { + plugins: [ + [ + '${n}', + // highlight-start + ${t.replace(/\n/g,"\n ")}, + // highlight-end + ], + ], +};`})]})]})}},27817:function(e,t,n){n.d(t,{Z:()=>em});var r={};n.r(r),n.d(r,{ButtonExample:()=>ed});var s=n(85893),l=n(67294),a=n(71607),i=n(90496),o=n(45245),c=n(26378);function u(){let{prism:e}=(0,c.L)(),{colorMode:t}=(0,o.I)(),n=e.theme,r=e.darkTheme||n;return"dark"===t?r:n}var d=n(55951),h=n(6324),p=n.n(h),g=n(50923);let m=/title=(? ["'])(?.*?)\1/,f=/\{(? [\d,-]+)\}/,x={js:{start:"\\/\\/",end:""},jsBlock:{start:"\\/\\*",end:"\\*\\/"},jsx:{start:"\\{\\s*\\/\\*",end:"\\*\\/\\s*\\}"},bash:{start:"#",end:""},html:{start:"\x3c!--",end:"--\x3e"}},j={...x,lua:{start:"--",end:""},wasm:{start:"\\;\\;",end:""},tex:{start:"%",end:""},vb:{start:"['\u2018\u2019]",end:""},vbnet:{start:"(?:_\\s*)?['\u2018\u2019]",end:""},rem:{start:"[Rr][Ee][Mm]\\b",end:""},f90:{start:"!",end:""},ml:{start:"\\(\\*",end:"\\*\\)"},cobol:{start:"\\*>",end:""}},b=Object.keys(x);function y(e,t){let n=e.map(e=>{let{start:n,end:r}=j[e];return`(?:${n}\\s*(${t.flatMap(e=>[e.line,e.block?.start,e.block?.end].filter(Boolean)).join("|")})\\s*${r})`}).join("|");return RegExp(`^\\s*(?:${n})\\s*$`)}let v=(0,l.createContext)(null);function k(e){let{metadata:t,wordWrap:n,children:r}=e,a=(0,l.useMemo)(()=>({metadata:t,wordWrap:n}),[t,n]);return(0,s.jsx)(v.Provider,{value:a,children:r})}function w(){let e=(0,l.useContext)(v);if(null===e)throw new g.i6("CodeBlockContextProvider");return e}function N(e){let{as:t,...n}=e,r=function(e){let t={color:"--prism-color",backgroundColor:"--prism-background-color"},n={};return Object.entries(e.plain).forEach(e=>{let[r,s]=e,l=t[r];l&&"string"==typeof s&&(n[l]=s)}),n}(u());return(0,s.jsx)(t,{...n,style:r,className:(0,i.Z)(n.className,"codeBlockContainer_jDV4",d.k.common.codeBlock)})}let B={codeBlock:"codeBlock_Gebt",codeBlockStandalone:"codeBlockStandalone_i_cY",codeBlockLines:"codeBlockLines_FJaf",codeBlockLinesWithNumbering:"codeBlockLinesWithNumbering_FU9Q"};function C(e){let{children:t,className:n}=e;return(0,s.jsx)(N,{as:"pre",tabIndex:0,className:(0,i.Z)(B.codeBlockStandalone,"thin-scrollbar",n),children:(0,s.jsx)("code",{className:B.codeBlockLines,children:t})})}let I={attributes:!0,characterData:!0,childList:!0,subtree:!0};function Z(e){let{children:t}=e;return t}var L=n(7316);function E(e){let{line:t,token:n,...r}=e;return(0,s.jsx)("span",{...r})}let T={codeLine:"codeLine_qRmp",codeLineNumber:"codeLineNumber_dS_J",codeLineContent:"codeLineContent_XF5l"};function _(e){let{line:t,classNames:n,showLineNumbers:r,getLineProps:l,getTokenProps:a}=e,o=function(e){let t=1===e.length&&"\n"===e[0].content?e[0]:void 0;return t?[{...t,content:""}]:e}(t),c=l({line:o,className:(0,i.Z)(n,r&&T.codeLine)}),u=o.map((e,t)=>{let n=a({token:e});return(0,s.jsx)(E,{...n,line:o,token:e,children:n.children},t)});return(0,s.jsxs)("span",{...c,children:[r?(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)("span",{className:T.codeLineNumber}),(0,s.jsx)("span",{className:T.codeLineContent,children:u})]}):u,(0,s.jsx)("br",{})]})}let A=l.forwardRef((e,t)=>(0,s.jsx)("pre",{ref:t,tabIndex:0,...e,className:(0,i.Z)(e.className,B.codeBlock,"thin-scrollbar")}));function S(e){let{metadata:t}=w();return(0,s.jsx)("code",{...e,className:(0,i.Z)(e.className,B.codeBlockLines,void 0!==t.lineNumbersStart&&B.codeBlockLinesWithNumbering),style:{...e.style,counterReset:void 0===t.lineNumbersStart?void 0:`line-count ${t.lineNumbersStart-1}`}})}function $(e){let{className:t}=e,{metadata:n,wordWrap:r}=w(),l=u(),{code:a,language:o,lineNumbersStart:c,lineClassNames:d}=n;return(0,s.jsx)(L.y$,{theme:l,code:a,language:o,children:e=>{let{className:n,style:l,tokens:a,getLineProps:o,getTokenProps:u}=e;return(0,s.jsx)(A,{ref:r.codeBlockRef,className:(0,i.Z)(t,n),style:l,children:(0,s.jsx)(S,{children:a.map((e,t)=>(0,s.jsx)(_,{line:e,getLineProps:o,getTokenProps:u,classNames:d[t],showLineNumbers:void 0!==c},t))})})}})}var D=n(56497),M=n(44771),R=n(77827);function W(e){let{className:t,...n}=e;return(0,s.jsx)("button",{type:"button",...n,className:(0,i.Z)("clean-btn",t)})}function O(e){return(0,s.jsx)("svg",{viewBox:"0 0 24 24",...e,children:(0,s.jsx)("path",{fill:"currentColor",d:"M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"})})}function P(e){return(0,s.jsx)("svg",{viewBox:"0 0 24 24",...e,children:(0,s.jsx)("path",{fill:"currentColor",d:"M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"})})}let V={copyButtonCopied:"copyButtonCopied_wDuR",copyButtonIcons:"copyButtonIcons_gMWc",copyButtonIcon:"copyButtonIcon_GXfb",copyButtonSuccessIcon:"copyButtonSuccessIcon_ktUX"};function q(e){let{className:t}=e,{copyCode:n,isCopied:r}=function(){let{metadata:{code:e}}=w(),[t,n]=(0,l.useState)(!1),r=(0,l.useRef)(void 0),s=(0,l.useCallback)(()=>{(0,M.Z)(e),n(!0),r.current=window.setTimeout(()=>{n(!1)},1e3)},[e]);return(0,l.useEffect)(()=>()=>window.clearTimeout(r.current),[]),{copyCode:s,isCopied:t}}();return(0,s.jsx)(W,{"aria-label":r?(0,R.I)({id:"theme.CodeBlock.copied",message:"Copied",description:"The copied button label on code blocks"}):(0,R.I)({id:"theme.CodeBlock.copyButtonAriaLabel",message:"Copy code to clipboard",description:"The ARIA label for copy code blocks button"}),title:(0,R.I)({id:"theme.CodeBlock.copy",message:"Copy",description:"The copy button label on code blocks"}),className:(0,i.Z)(t,V.copyButton,r&&V.copyButtonCopied),onClick:n,children:(0,s.jsxs)("span",{className:V.copyButtonIcons,"aria-hidden":"true",children:[(0,s.jsx)(O,{className:V.copyButtonIcon}),(0,s.jsx)(P,{className:V.copyButtonSuccessIcon})]})})}function F(e){return(0,s.jsx)("svg",{viewBox:"0 0 24 24",...e,children:(0,s.jsx)("path",{fill:"currentColor",d:"M4 19h6v-2H4v2zM20 5H4v2h16V5zm-3 6H4v2h13.25c1.1 0 2 .9 2 2s-.9 2-2 2H15v-2l-3 3l3 3v-2h2c2.21 0 4-1.79 4-4s-1.79-4-4-4z"})})}let H={wordWrapButtonIcon:"wordWrapButtonIcon___5r",wordWrapButtonEnabled:"wordWrapButtonEnabled_nam_"};function z(e){let{className:t}=e,{wordWrap:n}=w();if(!(n.isEnabled||n.isCodeScrollable))return!1;let r=(0,R.I)({id:"theme.CodeBlock.wordWrapToggle",message:"Toggle word wrap",description:"The title attribute for toggle word wrapping button of code block lines"});return(0,s.jsx)(W,{onClick:()=>n.toggle(),className:(0,i.Z)(t,n.isEnabled&&H.wordWrapButtonEnabled),"aria-label":r,title:r,children:(0,s.jsx)(F,{className:H.wordWrapButtonIcon,"aria-hidden":"true"})})}function U(e){let{className:t}=e;return(0,s.jsx)(D.Z,{children:()=>(0,s.jsxs)("div",{className:(0,i.Z)(t,"buttonGroup_KXnS"),children:[(0,s.jsx)(z,{}),(0,s.jsx)(q,{})]})})}let G={codeBlockContent:"codeBlockContent_cKMj",codeBlockTitle:"codeBlockTitle_U6Q0"};function J(e){let{className:t}=e,{metadata:n}=w();return(0,s.jsxs)(N,{as:"div",className:(0,i.Z)(t,n.className),children:[n.title&&(0,s.jsx)("div",{className:G.codeBlockTitle,children:(0,s.jsx)(Z,{children:n.title})}),(0,s.jsxs)("div",{className:G.codeBlockContent,children:[(0,s.jsx)($,{}),(0,s.jsx)(U,{})]})]})}function X(e){let t=function(e){let{prism:t}=(0,c.L)();return function(e){var t,n,r;let s=(n=(t={language:e.language,defaultLanguage:e.defaultLanguage,className:e.className}).language??function(e){if(!e)return;let t=e.split(" ").find(e=>e.startsWith("language-"));return t?.replace(/language-/,"")}(t.className)??t.defaultLanguage,n?.toLowerCase()??"text"),{lineClassNames:l,code:a}=function(e,t){let n=e.replace(/\r?\n$/,"");return function(e,t){let{metastring:n,magicComments:r}=t;if(n&&f.test(n)){let t=n.match(f).groups.range;if(0===r.length)throw Error(`A highlight range has been given in code block's metastring (\`\`\` ${n}), but no magic comment config is available. Docusaurus applies the first magic comment entry's className for metastring ranges.`);let s=r[0].className;return{lineClassNames:Object.fromEntries(p()(t).filter(e=>e>0).map(e=>[e-1,[s]])),code:e}}return null}(n,{...t})??function(e,t){let{language:n,magicComments:r}=t;if(void 0===n)return{lineClassNames:{},code:e};let s=function(e,t){switch(e){case"js":case"javascript":case"ts":case"typescript":return y(["js","jsBlock"],t);case"jsx":case"tsx":return y(["js","jsBlock","jsx"],t);case"html":return y(["js","jsBlock","html"],t);case"python":case"py":case"bash":return y(["bash"],t);case"markdown":case"md":return y(["html","jsx","bash"],t);case"tex":case"latex":case"matlab":return y(["tex"],t);case"lua":case"haskell":return y(["lua"],t);case"sql":return y(["lua","jsBlock"],t);case"wasm":return y(["wasm"],t);case"vb":case"vba":case"visual-basic":return y(["vb","rem"],t);case"vbnet":return y(["vbnet","rem"],t);case"batch":return y(["rem"],t);case"basic":return y(["rem","f90"],t);case"fsharp":return y(["js","ml"],t);case"ocaml":case"sml":return y(["ml"],t);case"fortran":return y(["f90"],t);case"cobol":return y(["cobol"],t);default:return y(b,t)}}(n,r),l=e.split(/\r?\n/),a=Object.fromEntries(r.map(e=>[e.className,{start:0,range:""}])),i=Object.fromEntries(r.filter(e=>e.line).map(e=>{let{className:t,line:n}=e;return[n,t]})),o=Object.fromEntries(r.filter(e=>e.block).map(e=>{let{className:t,block:n}=e;return[n.start,t]})),c=Object.fromEntries(r.filter(e=>e.block).map(e=>{let{className:t,block:n}=e;return[n.end,t]}));for(let e=0;e void 0!==e);i[n]?a[i[n]].range+=`${e},`:o[n]?a[o[n]].start=e:c[n]&&(a[c[n]].range+=`${a[c[n]].start}-${e-1},`),l.splice(e,1)}let u={};return Object.entries(a).forEach(e=>{let[t,{range:n}]=e;p()(n).forEach(e=>{u[e]??=[],u[e].push(t)})}),{code:l.join("\n"),lineClassNames:u}}(n,{...t})}(e.code,{metastring:e.metastring,magicComments:e.magicComments,language:s}),o=function(e){let{className:t,language:n}=e;return(0,i.Z)(t,n&&!t?.includes(`language-${n}`)&&`language-${n}`)}({className:e.className,language:s}),c=(r=e.metastring,(r?.match(m)?.groups.title??"")||e.title),u=function(e){let{showLineNumbers:t,metastring:n}=e;if("boolean"==typeof t)return t?1:void 0;if("number"==typeof t)return t;let r=n?.split(" ").find(e=>e.startsWith("showLineNumbers"));if(r)return r.startsWith("showLineNumbers=")?parseInt(r.replace("showLineNumbers=",""),10):1}({showLineNumbers:e.showLineNumbers,metastring:e.metastring});return{codeInput:e.code,code:a,className:o,language:s,title:c,lineNumbersStart:u,lineClassNames:l}}({code:e.children,className:e.className,metastring:e.metastring,magicComments:t.magicComments,defaultLanguage:t.defaultLanguage,language:e.language,title:e.title,showLineNumbers:e.showLineNumbers})}(e),n=function(){let[e,t]=(0,l.useState)(!1),[n,r]=(0,l.useState)(!1),s=(0,l.useRef)(null),a=(0,l.useCallback)(()=>{let n=s.current.querySelector("code");e?n.removeAttribute("style"):(n.style.whiteSpace="pre-wrap",n.style.overflowWrap="anywhere"),t(e=>!e)},[s,e]),i=(0,l.useCallback)(()=>{let{scrollWidth:e,clientWidth:t}=s.current;r(e>t||s.current.querySelector("code").hasAttribute("style"))},[s]),[o,c]=(0,l.useState)(),u=(0,l.useCallback)(()=>{c(s.current?.closest("[role=tabpanel][hidden]"))},[s,c]);return(0,l.useEffect)(()=>{u()},[u]),!function(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:I,r=(0,g.zX)(t),s=(0,g.Ql)(n);(0,l.useEffect)(()=>{let t=new MutationObserver(r);return e&&t.observe(e,s),()=>t.disconnect()},[e,r,s])}(o,e=>{e.forEach(e=>{"attributes"===e.type&&"hidden"===e.attributeName&&(i(),u())})},{attributes:!0,characterData:!1,childList:!1,subtree:!1}),(0,l.useEffect)(()=>{i()},[e,i]),(0,l.useEffect)(()=>(window.addEventListener("resize",i,{passive:!0}),()=>{window.removeEventListener("resize",i)}),[i]),{codeBlockRef:s,isEnabled:e,isCodeScrollable:n,toggle:a}}();return(0,s.jsx)(k,{metadata:t,wordWrap:n,children:(0,s.jsx)(J,{})})}function Q(e){let{children:t,...n}=e,r=(0,a.Z)(),i=l.Children.toArray(t).some(e=>(0,l.isValidElement)(e))?t:Array.isArray(t)?t.join(""):t;return(0,s.jsx)("string"==typeof i?X:C,{...n,children:i},String(r))}var Y=n(10075);let K=e=>`${e};`;function ee(e){let{code:t,children:n,...r}=e,l=u(),a=r.metastring?.includes("noInline")??!1;return(0,s.jsx)(Y.nu,{noInline:a,theme:l,...r,code:t?.replace(/\n$/,""),transformCode:r.transformCode??K,children:n})}function et(e){let{children:t}=e;return(0,s.jsx)("div",{className:"playgroundContainer_TDLX",children:t})}var en=n(85108),er=n(67490);function es(e){let{children:t}=e;return(0,s.jsx)("div",{className:(0,i.Z)("playgroundHeader_h_Hu"),children:t})}function el(){return(0,s.jsx)("div",{children:"Loading..."})}function ea(){return(0,s.jsx)(D.Z,{fallback:(0,s.jsx)(el,{}),children:()=>(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(er.Z,{fallback:e=>(0,s.jsx)(en.Ac,{...e}),children:(0,s.jsx)(Y.i5,{})}),(0,s.jsx)(Y.IF,{})]})})}function ei(){return(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(es,{children:(0,s.jsx)(R.Z,{id:"theme.Playground.result",description:"The result label of the live codeblocks",children:"Result"})}),(0,s.jsx)("div",{className:"playgroundPreview_u2xE",children:(0,s.jsx)(ea,{})})]})}function eo(){let e=(0,a.Z)();return(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(es,{children:(0,s.jsx)(R.Z,{id:"theme.Playground.liveEditor",description:"The live editor label of the live codeblocks",children:"Live Editor"})}),(0,s.jsx)(Y.uz,{className:"playgroundEditor_uqZ4"},String(e))]})}function ec(){let{playgroundPosition:e}=(0,c.L)().liveCodeBlock;return(0,s.jsx)(s.Fragment,{children:"top"===e?(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(ei,{}),(0,s.jsx)(eo,{})]}):(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(eo,{}),(0,s.jsx)(ei,{})]})})}function eu(e){let{children:t,transformCode:n,...r}=e;return(0,s.jsx)(et,{children:(0,s.jsx)(ee,{code:t,...r,children:(0,s.jsx)(ec,{})})})}function ed(e){return(0,s.jsx)("button",{type:"button",...e,style:{backgroundColor:"white",color:"black",border:"solid red",borderRadius:20,padding:10,cursor:"pointer",...e.style}})}let eh={React:l,...l,...r};function ep(e){return(0,s.jsx)(eu,{scope:eh,...e})}function eg(e){return e.live?(0,s.jsx)(ep,{...e}):(0,s.jsx)(Q,{...e})}function em(e){return(0,s.jsx)(eg,{...e})}}}]); \ No newline at end of file diff --git a/assets/js/03f86864.294d31b0.js b/assets/js/03f86864.294d31b0.js new file mode 100644 index 0000000000..9b87f6302c --- /dev/null +++ b/assets/js/03f86864.294d31b0.js @@ -0,0 +1,2 @@ +"use strict";(self.webpackChunkwebsite=self.webpackChunkwebsite||[]).push([["99131"],{63029:function(e,n,d){d.r(n),d.d(n,{frontMatter:()=>l,default:()=>x,contentTitle:()=>c,assets:()=>o,toc:()=>h,metadata:()=>i});var i=JSON.parse('{"id":"api/themes/theme-configuration","title":"Theme configuration","description":"This configuration applies to all main themes.","source":"@site/docs/api/themes/theme-configuration.mdx","sourceDirName":"api/themes","slug":"/api/themes/configuration","permalink":"/docs/api/themes/configuration","draft":false,"unlisted":false,"editUrl":"https://github.com/facebook/docusaurus/edit/main/website/docs/api/themes/theme-configuration.mdx","tags":[],"version":"current","lastUpdatedBy":"S\xe9bastien Lorber","lastUpdatedAt":1744293302000,"sidebarPosition":1,"frontMatter":{"sidebar_position":1,"sidebar_label":"Configuration","slug":"/api/themes/configuration","toc_max_heading_level":4},"sidebar":"api","previous":{"title":"Themes overview","permalink":"/docs/api/themes"},"next":{"title":"\uD83D\uDCE6 theme-classic","permalink":"/docs/api/themes/@docusaurus/theme-classic"}}'),s=d(85893),t=d(80980),r=d(32240);let l={sidebar_position:1,sidebar_label:"Configuration",slug:"/api/themes/configuration",toc_max_heading_level:4},c="Theme configuration",o={},h=[{value:"Common",id:"common",level:2},{value:"Color mode",id:"color-mode---dark-mode",level:3},{value:"Meta image",id:"meta-image",level:3},{value:"Metadata",id:"metadata",level:3},{value:"Announcement bar",id:"announcement-bar",level:3},{value:"Plugins",id:"plugins",level:2},{value:"Docs",id:"docs",level:3},{value:"Blog",id:"blog",level:3},{value:"Navbar",id:"navbar",level:2},{value:"Navbar logo",id:"navbar-logo",level:3},{value:"Navbar items",id:"navbar-items",level:3},{value:"Navbar link",id:"navbar-link",level:4},{value:"Navbar dropdown",id:"navbar-dropdown",level:4},{value:"Navbar doc link",id:"navbar-doc-link",level:4},{value:"Navbar linked to a sidebar",id:"navbar-doc-sidebar",level:4},{value:"Navbar docs version dropdown",id:"navbar-docs-version-dropdown",level:4},{value:"Navbar docs version",id:"navbar-docs-version",level:4},{value:"Navbar locale dropdown",id:"navbar-locale-dropdown",level:4},{value:"Navbar search",id:"navbar-search",level:4},{value:"Navbar with custom HTML",id:"navbar-with-custom-html",level:4},{value:"Auto-hide sticky navbar",id:"auto-hide-sticky-navbar",level:3},{value:"Navbar style",id:"navbar-style",level:3},{value:"CodeBlock",id:"codeblock",level:2},{value:"Theme",id:"theme",level:3},{value:"Default language",id:"default-language",level:3},{value:"Footer",id:"footer-1",level:2},{value:"Footer Links",id:"footer-links",level:3},{value:"Table of Contents",id:"table-of-contents",level:2},{value:"Hooks",id:"hooks",level:2},{value:" useColorMode
",id:"use-color-mode",level:3},{value:"i18n",id:"i18n",level:2},{value:"Translation files location",id:"translation-files-location",level:3},{value:"Example file-system structure",id:"example-file-system-structure",level:3}];function a(e){let n={a:"a",admonition:"admonition",code:"code",em:"em",h1:"h1",h2:"h2",h3:"h3",h4:"h4",header:"header",li:"li",p:"p",pre:"pre",strong:"strong",table:"table",tbody:"tbody",td:"td",th:"th",thead:"thead",tr:"tr",ul:"ul",...(0,t.a)(),...e.components},{Details:d}=n;return d||function(e,n){throw Error("Expected "+(n?"component":"object")+" `"+e+"` to be defined: you likely forgot to import, pass, or provide it.")}("Details",!0),(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(n.header,{children:(0,s.jsx)(n.h1,{id:"theme-configuration",children:"Theme configuration"})}),"\n","\n",(0,s.jsxs)(n.p,{children:["This configuration applies to all ",(0,s.jsx)(n.a,{href:"/docs/api/themes",children:"main themes"}),"."]}),"\n",(0,s.jsx)(n.h2,{id:"common",children:"Common"}),"\n",(0,s.jsx)(n.h3,{id:"color-mode---dark-mode",children:"Color mode"}),"\n",(0,s.jsx)(n.p,{children:"The classic theme provides by default light and dark mode support, with a navbar switch for the user."}),"\n",(0,s.jsxs)(n.p,{children:["It is possible to customize the color mode support within the ",(0,s.jsx)(n.code,{children:"colorMode"})," object."]}),"\n",(0,s.jsx)(n.p,{children:"Accepted fields:"}),"\n",(0,s.jsx)(r.Z,{children:(0,s.jsxs)(n.table,{children:[(0,s.jsx)(n.thead,{children:(0,s.jsxs)(n.tr,{children:[(0,s.jsx)(n.th,{children:"Name"}),(0,s.jsx)(n.th,{children:"Type"}),(0,s.jsx)(n.th,{children:"Default"}),(0,s.jsx)(n.th,{children:"Description"})]})}),(0,s.jsxs)(n.tbody,{children:[(0,s.jsxs)(n.tr,{children:[(0,s.jsx)(n.td,{children:(0,s.jsx)(n.code,{children:"defaultMode"})}),(0,s.jsx)(n.td,{children:(0,s.jsx)("code",{children:"'light' | 'dark'"})}),(0,s.jsx)(n.td,{children:(0,s.jsx)(n.code,{children:"'light'"})}),(0,s.jsx)(n.td,{children:"The color mode when user first visits the site."})]}),(0,s.jsxs)(n.tr,{children:[(0,s.jsx)(n.td,{children:(0,s.jsx)(n.code,{children:"disableSwitch"})}),(0,s.jsx)(n.td,{children:(0,s.jsx)(n.code,{children:"boolean"})}),(0,s.jsx)(n.td,{children:(0,s.jsx)(n.code,{children:"false"})}),(0,s.jsx)(n.td,{children:"Hides the switch in the navbar. Useful if you want to support a single color mode."})]}),(0,s.jsxs)(n.tr,{children:[(0,s.jsx)(n.td,{children:(0,s.jsx)(n.code,{children:"respectPrefersColorScheme"})}),(0,s.jsx)(n.td,{children:(0,s.jsx)(n.code,{children:"boolean"})}),(0,s.jsx)(n.td,{children:(0,s.jsx)(n.code,{children:"false"})}),(0,s.jsxs)(n.td,{children:["Whether to use the ",(0,s.jsx)(n.code,{children:"prefers-color-scheme"})," media-query, using user system preferences, instead of the hardcoded ",(0,s.jsx)(n.code,{children:"defaultMode"}),"."]})]})]})]})}),"\n",(0,s.jsx)(n.p,{children:"Example configuration:"}),"\n",(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-js",metastring:'title="docusaurus.config.js"',children:"export default {\n themeConfig: {\n // highlight-start\n colorMode: {\n defaultMode: 'light',\n disableSwitch: false,\n respectPrefersColorScheme: false,\n },\n // highlight-end\n },\n};\n"})}),"\n",(0,s.jsxs)(n.admonition,{type:"warning",children:[(0,s.jsxs)(n.p,{children:["With ",(0,s.jsx)(n.code,{children:"respectPrefersColorScheme: true"}),", the ",(0,s.jsx)(n.code,{children:"defaultMode"})," is overridden by user system preferences."]}),(0,s.jsx)(n.p,{children:"If you only want to support one color mode, you likely want to ignore user system preferences."})]}),"\n",(0,s.jsx)(n.h3,{id:"meta-image",children:"Meta image"}),"\n",(0,s.jsxs)(n.p,{children:["You can configure a default image that will be used for your meta tag, in particular ",(0,s.jsx)(n.code,{children:"og:image"})," and ",(0,s.jsx)(n.code,{children:"twitter:image"}),"."]}),"\n",(0,s.jsx)(n.p,{children:"Accepted fields:"}),"\n",(0,s.jsx)(r.Z,{children:(0,s.jsxs)(n.table,{children:[(0,s.jsx)(n.thead,{children:(0,s.jsxs)(n.tr,{children:[(0,s.jsx)(n.th,{children:"Name"}),(0,s.jsx)(n.th,{children:"Type"}),(0,s.jsx)(n.th,{children:"Default"}),(0,s.jsx)(n.th,{children:"Description"})]})}),(0,s.jsx)(n.tbody,{children:(0,s.jsxs)(n.tr,{children:[(0,s.jsx)(n.td,{children:(0,s.jsx)(n.code,{children:"image"})}),(0,s.jsx)(n.td,{children:(0,s.jsx)(n.code,{children:"string"})}),(0,s.jsx)(n.td,{children:(0,s.jsx)(n.code,{children:"undefined"})}),(0,s.jsx)(n.td,{children:'The meta image URL for the site. Relative to your site\'s "static" directory. Cannot be SVGs. Can be external URLs too.'})]})})]})}),"\n",(0,s.jsx)(n.p,{children:"Example configuration:"}),"\n",(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-js",metastring:'title="docusaurus.config.js"',children:"export default {\n themeConfig: {\n // highlight-next-line\n image: 'img/docusaurus.png',\n },\n};\n"})}),"\n",(0,s.jsx)(n.h3,{id:"metadata",children:"Metadata"}),"\n",(0,s.jsx)(n.p,{children:"You can configure additional HTML metadata (and override existing ones)."}),"\n",(0,s.jsx)(n.p,{children:"Accepted fields:"}),"\n",(0,s.jsx)(r.Z,{children:(0,s.jsxs)(n.table,{children:[(0,s.jsx)(n.thead,{children:(0,s.jsxs)(n.tr,{children:[(0,s.jsx)(n.th,{children:"Name"}),(0,s.jsx)(n.th,{children:"Type"}),(0,s.jsx)(n.th,{children:"Default"}),(0,s.jsx)(n.th,{children:"Description"})]})}),(0,s.jsx)(n.tbody,{children:(0,s.jsxs)(n.tr,{children:[(0,s.jsx)(n.td,{children:(0,s.jsx)(n.code,{children:"metadata"})}),(0,s.jsx)(n.td,{children:(0,s.jsx)(n.code,{children:"Metadata[]"})}),(0,s.jsx)(n.td,{children:(0,s.jsx)(n.code,{children:"[]"})}),(0,s.jsxs)(n.td,{children:["Any field will be directly passed to the ",(0,s.jsx)(n.code,{children:""})," tag. Possible fields include ",(0,s.jsx)(n.code,{children:"id"}),", ",(0,s.jsx)(n.code,{children:"name"}),", ",(0,s.jsx)(n.code,{children:"property"}),", ",(0,s.jsx)(n.code,{children:"content"}),", ",(0,s.jsx)(n.code,{children:"itemprop"}),", etc."]})]})})]})}),"\n",(0,s.jsx)(n.p,{children:"Example configuration:"}),"\n",(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-js",metastring:'title="docusaurus.config.js"',children:"export default {\n themeConfig: {\n // highlight-next-line\n metadata: [{name: 'twitter:card', content: 'summary'}],\n },\n};\n"})}),"\n",(0,s.jsx)(n.h3,{id:"announcement-bar",children:"Announcement bar"}),"\n",(0,s.jsxs)(n.p,{children:["Sometimes you want to announce something in your website. Just for such a case, you can add an announcement bar. This is a non-fixed and optionally dismissible panel above the navbar. All configuration are in the ",(0,s.jsx)(n.code,{children:"announcementBar"})," object."]}),"\n",(0,s.jsx)(n.p,{children:"Accepted fields:"}),"\n",(0,s.jsx)(r.Z,{name:"announcement-bar",children:(0,s.jsxs)(n.table,{children:[(0,s.jsx)(n.thead,{children:(0,s.jsxs)(n.tr,{children:[(0,s.jsx)(n.th,{children:"Name"}),(0,s.jsx)(n.th,{children:"Type"}),(0,s.jsx)(n.th,{children:"Default"}),(0,s.jsx)(n.th,{children:"Description"})]})}),(0,s.jsxs)(n.tbody,{children:[(0,s.jsxs)(n.tr,{children:[(0,s.jsx)(n.td,{children:(0,s.jsx)(n.code,{children:"id"})}),(0,s.jsx)(n.td,{children:(0,s.jsx)(n.code,{children:"string"})}),(0,s.jsx)(n.td,{children:(0,s.jsx)(n.code,{children:"'announcement-bar'"})}),(0,s.jsx)(n.td,{children:"Any value that will identify this message."})]}),(0,s.jsxs)(n.tr,{children:[(0,s.jsx)(n.td,{children:(0,s.jsx)(n.code,{children:"content"})}),(0,s.jsx)(n.td,{children:(0,s.jsx)(n.code,{children:"string"})}),(0,s.jsx)(n.td,{children:(0,s.jsx)(n.code,{children:"''"})}),(0,s.jsx)(n.td,{children:"The text content of the announcement. HTML will be interpolated."})]}),(0,s.jsxs)(n.tr,{children:[(0,s.jsx)(n.td,{children:(0,s.jsx)(n.code,{children:"backgroundColor"})}),(0,s.jsx)(n.td,{children:(0,s.jsx)(n.code,{children:"string"})}),(0,s.jsx)(n.td,{children:(0,s.jsx)(n.code,{children:"'#fff'"})}),(0,s.jsx)(n.td,{children:"Background color of the entire bar."})]}),(0,s.jsxs)(n.tr,{children:[(0,s.jsx)(n.td,{children:(0,s.jsx)(n.code,{children:"textColor"})}),(0,s.jsx)(n.td,{children:(0,s.jsx)(n.code,{children:"string"})}),(0,s.jsx)(n.td,{children:(0,s.jsx)(n.code,{children:"'#000'"})}),(0,s.jsx)(n.td,{children:"Announcement text color."})]}),(0,s.jsxs)(n.tr,{children:[(0,s.jsx)(n.td,{children:(0,s.jsx)(n.code,{children:"isCloseable"})}),(0,s.jsx)(n.td,{children:(0,s.jsx)(n.code,{children:"boolean"})}),(0,s.jsx)(n.td,{children:(0,s.jsx)(n.code,{children:"true"})}),(0,s.jsx)(n.td,{children:"Whether this announcement can be dismissed with a '\xd7' button."})]})]})]})}),"\n",(0,s.jsx)(n.p,{children:"Example configuration:"}),"\n",(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-js",metastring:'title="docusaurus.config.js"',children:"export default {\n themeConfig: {\n // highlight-start\n announcementBar: {\n id: 'support_us',\n content:\n 'We are looking to revamp our docs, please fill this survey',\n backgroundColor: '#fafbfc',\n textColor: '#091E42',\n isCloseable: false,\n },\n // highlight-end\n },\n};\n"})}),"\n",(0,s.jsx)(n.h2,{id:"plugins",children:"Plugins"}),"\n",(0,s.jsxs)(n.p,{children:["Our ",(0,s.jsx)(n.a,{href:"/docs/api/themes",children:"main themes"})," offer additional theme configuration options for Docusaurus core content plugins."]}),"\n",(0,s.jsx)(n.h3,{id:"docs",children:"Docs"}),"\n",(0,s.jsx)(r.Z,{name:"navbar-overview",children:(0,s.jsxs)(n.table,{children:[(0,s.jsx)(n.thead,{children:(0,s.jsxs)(n.tr,{children:[(0,s.jsx)(n.th,{children:"Name"}),(0,s.jsx)(n.th,{children:"Type"}),(0,s.jsx)(n.th,{children:"Default"}),(0,s.jsx)(n.th,{children:"Description"})]})}),(0,s.jsxs)(n.tbody,{children:[(0,s.jsxs)(n.tr,{children:[(0,s.jsx)(n.td,{children:(0,s.jsx)(n.code,{children:"versionPersistence"})}),(0,s.jsx)(n.td,{children:(0,s.jsx)(n.code,{children:"'localStorage' | 'none'"})}),(0,s.jsx)(n.td,{children:(0,s.jsx)(n.code,{children:"undefined"})}),(0,s.jsx)(n.td,{children:"Defines the browser persistence of the preferred docs version."})]}),(0,s.jsxs)(n.tr,{children:[(0,s.jsx)(n.td,{children:(0,s.jsx)(n.code,{children:"sidebar.hideable"})}),(0,s.jsx)(n.td,{children:(0,s.jsx)(n.code,{children:"boolean"})}),(0,s.jsx)(n.td,{children:(0,s.jsx)(n.code,{children:"false"})}),(0,s.jsx)(n.td,{children:"Show a hide button at the bottom of the sidebar."})]}),(0,s.jsxs)(n.tr,{children:[(0,s.jsx)(n.td,{children:(0,s.jsx)(n.code,{children:"sidebar.autoCollapseCategories"})}),(0,s.jsx)(n.td,{children:(0,s.jsx)(n.code,{children:"boolean"})}),(0,s.jsx)(n.td,{children:(0,s.jsx)(n.code,{children:"false"})}),(0,s.jsx)(n.td,{children:"Automatically collapse all sibling categories of the one you navigate to."})]})]})]})}),"\n",(0,s.jsx)(n.p,{children:"Example configuration:"}),"\n",(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-js",metastring:'title="docusaurus.config.js"',children:"export default {\n themeConfig: {\n docs: {\n // highlight-start\n versionPersistence: 'localStorage',\n sidebar: {\n hideable: false,\n autoCollapseCategories: false,\n },\n // highlight-end\n },\n },\n};\n"})}),"\n",(0,s.jsx)(n.h3,{id:"blog",children:"Blog"}),"\n",(0,s.jsx)(r.Z,{name:"navbar-overview",children:(0,s.jsxs)(n.table,{children:[(0,s.jsx)(n.thead,{children:(0,s.jsxs)(n.tr,{children:[(0,s.jsx)(n.th,{children:"Name"}),(0,s.jsx)(n.th,{children:"Type"}),(0,s.jsx)(n.th,{children:"Default"}),(0,s.jsx)(n.th,{children:"Description"})]})}),(0,s.jsx)(n.tbody,{children:(0,s.jsxs)(n.tr,{children:[(0,s.jsx)(n.td,{children:(0,s.jsx)(n.code,{children:"sidebar.groupByYear"})}),(0,s.jsx)(n.td,{children:(0,s.jsx)(n.code,{children:"boolean"})}),(0,s.jsx)(n.td,{children:(0,s.jsx)(n.code,{children:"true"})}),(0,s.jsx)(n.td,{children:"Group sidebar blog posts by years."})]})})]})}),"\n",(0,s.jsx)(n.p,{children:"Example configuration:"}),"\n",(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-js",metastring:'title="docusaurus.config.js"',children:"export default {\n themeConfig: {\n blog: {\n // highlight-start\n sidebar: {\n groupByYear: true,\n },\n // highlight-end\n },\n },\n};\n"})}),"\n",(0,s.jsx)(n.h2,{id:"navbar",children:"Navbar"}),"\n",(0,s.jsx)(n.p,{children:"Accepted fields:"}),"\n",(0,s.jsx)(r.Z,{name:"navbar-overview",children:(0,s.jsxs)(n.table,{children:[(0,s.jsx)(n.thead,{children:(0,s.jsxs)(n.tr,{children:[(0,s.jsx)(n.th,{children:"Name"}),(0,s.jsx)(n.th,{children:"Type"}),(0,s.jsx)(n.th,{children:"Default"}),(0,s.jsx)(n.th,{children:"Description"})]})}),(0,s.jsxs)(n.tbody,{children:[(0,s.jsxs)(n.tr,{children:[(0,s.jsx)(n.td,{children:(0,s.jsx)(n.code,{children:"title"})}),(0,s.jsx)(n.td,{children:(0,s.jsx)(n.code,{children:"string"})}),(0,s.jsx)(n.td,{children:(0,s.jsx)(n.code,{children:"undefined"})}),(0,s.jsx)(n.td,{children:"Title for the navbar."})]}),(0,s.jsxs)(n.tr,{children:[(0,s.jsx)(n.td,{children:(0,s.jsx)(n.code,{children:"logo"})}),(0,s.jsx)(n.td,{children:(0,s.jsx)(n.em,{children:"See below"})}),(0,s.jsx)(n.td,{children:(0,s.jsx)(n.code,{children:"undefined"})}),(0,s.jsx)(n.td,{children:"Customization of the logo object."})]}),(0,s.jsxs)(n.tr,{children:[(0,s.jsx)(n.td,{children:(0,s.jsx)(n.code,{children:"items"})}),(0,s.jsx)(n.td,{children:(0,s.jsx)(n.code,{children:"NavbarItem[]"})}),(0,s.jsx)(n.td,{children:(0,s.jsx)(n.code,{children:"[]"})}),(0,s.jsx)(n.td,{children:"A list of navbar items. See specification below."})]}),(0,s.jsxs)(n.tr,{children:[(0,s.jsx)(n.td,{children:(0,s.jsx)(n.code,{children:"hideOnScroll"})}),(0,s.jsx)(n.td,{children:(0,s.jsx)(n.code,{children:"boolean"})}),(0,s.jsx)(n.td,{children:(0,s.jsx)(n.code,{children:"false"})}),(0,s.jsx)(n.td,{children:"Whether the navbar is hidden when the user scrolls down."})]}),(0,s.jsxs)(n.tr,{children:[(0,s.jsx)(n.td,{children:(0,s.jsx)(n.code,{children:"style"})}),(0,s.jsx)(n.td,{children:(0,s.jsx)("code",{children:"'primary' | 'dark'"})}),(0,s.jsx)(n.td,{children:"Same as theme"}),(0,s.jsx)(n.td,{children:"Sets the navbar style, ignoring the dark/light theme."})]})]})]})}),"\n",(0,s.jsx)(n.h3,{id:"navbar-logo",children:"Navbar logo"}),"\n",(0,s.jsxs)(n.p,{children:["The logo can be placed in ",(0,s.jsx)(n.a,{href:"/docs/static-assets",children:"static folder"}),". Logo URL is set to base URL of your site by default. Although you can specify your own URL for the logo, if it is an external link, it will open in a new tab. In addition, you can override a value for the target attribute of logo link, it can come in handy if you are hosting docs website in a subdirectory of your main website, and in which case you probably do not need a link in the logo to the main website will open in a new tab."]}),"\n",(0,s.jsx)(n.p,{children:"To improve dark mode support, you can also set a different logo for this mode."}),"\n",(0,s.jsx)(n.p,{children:"Accepted fields:"}),"\n",(0,s.jsx)(r.Z,{name:"navbar-logo",children:(0,s.jsxs)(n.table,{children:[(0,s.jsx)(n.thead,{children:(0,s.jsxs)(n.tr,{children:[(0,s.jsx)(n.th,{children:"Name"}),(0,s.jsx)(n.th,{children:"Type"}),(0,s.jsx)(n.th,{children:"Default"}),(0,s.jsx)(n.th,{children:"Description"})]})}),(0,s.jsxs)(n.tbody,{children:[(0,s.jsxs)(n.tr,{children:[(0,s.jsx)(n.td,{children:(0,s.jsx)(n.code,{children:"alt"})}),(0,s.jsx)(n.td,{children:(0,s.jsx)(n.code,{children:"string"})}),(0,s.jsx)(n.td,{children:(0,s.jsx)(n.code,{children:"undefined"})}),(0,s.jsx)(n.td,{children:"Alt tag for the logo image."})]}),(0,s.jsxs)(n.tr,{children:[(0,s.jsx)(n.td,{children:(0,s.jsx)(n.code,{children:"src"})}),(0,s.jsx)(n.td,{children:(0,s.jsx)(n.code,{children:"string"})}),(0,s.jsx)(n.td,{children:(0,s.jsx)(n.strong,{children:"Required"})}),(0,s.jsx)(n.td,{children:"URL to the logo image. Base URL is appended by default."})]}),(0,s.jsxs)(n.tr,{children:[(0,s.jsx)(n.td,{children:(0,s.jsx)(n.code,{children:"srcDark"})}),(0,s.jsx)(n.td,{children:(0,s.jsx)(n.code,{children:"string"})}),(0,s.jsx)(n.td,{children:(0,s.jsx)(n.code,{children:"logo.src"})}),(0,s.jsx)(n.td,{children:"An alternative image URL to use in dark mode."})]}),(0,s.jsxs)(n.tr,{children:[(0,s.jsx)(n.td,{children:(0,s.jsx)(n.code,{children:"href"})}),(0,s.jsx)(n.td,{children:(0,s.jsx)(n.code,{children:"string"})}),(0,s.jsx)(n.td,{children:(0,s.jsx)(n.code,{children:"siteConfig.baseUrl"})}),(0,s.jsx)(n.td,{children:"Link to navigate to when the logo is clicked."})]}),(0,s.jsxs)(n.tr,{children:[(0,s.jsx)(n.td,{children:(0,s.jsx)(n.code,{children:"width"})}),(0,s.jsx)(n.td,{children:(0,s.jsx)("code",{children:"string | number"})}),(0,s.jsx)(n.td,{children:(0,s.jsx)(n.code,{children:"undefined"})}),(0,s.jsxs)(n.td,{children:["Specifies the ",(0,s.jsx)(n.code,{children:"width"})," attribute."]})]}),(0,s.jsxs)(n.tr,{children:[(0,s.jsx)(n.td,{children:(0,s.jsx)(n.code,{children:"height"})}),(0,s.jsx)(n.td,{children:(0,s.jsx)("code",{children:"string | number"})}),(0,s.jsx)(n.td,{children:(0,s.jsx)(n.code,{children:"undefined"})}),(0,s.jsxs)(n.td,{children:["Specifies the ",(0,s.jsx)(n.code,{children:"height"})," attribute."]})]}),(0,s.jsxs)(n.tr,{children:[(0,s.jsx)(n.td,{children:(0,s.jsx)(n.code,{children:"target"})}),(0,s.jsx)(n.td,{children:(0,s.jsx)(n.code,{children:"string"})}),(0,s.jsxs)(n.td,{children:["Calculated based on ",(0,s.jsx)(n.code,{children:"href"})," (external links will open in a new tab, all others in the current one)."]}),(0,s.jsxs)(n.td,{children:["The ",(0,s.jsx)(n.code,{children:"target"})," attribute of the link; controls whether the link is opened in a new tab, the current one, or otherwise."]})]}),(0,s.jsxs)(n.tr,{children:[(0,s.jsx)(n.td,{children:(0,s.jsx)(n.code,{children:"className"})}),(0,s.jsx)(n.td,{children:(0,s.jsx)(n.code,{children:"string"})}),(0,s.jsx)(n.td,{children:(0,s.jsx)(n.code,{children:"undefined"})}),(0,s.jsx)(n.td,{children:"CSS class applied to the image."})]}),(0,s.jsxs)(n.tr,{children:[(0,s.jsx)(n.td,{children:(0,s.jsx)(n.code,{children:"style"})}),(0,s.jsx)(n.td,{children:(0,s.jsx)(n.code,{children:"object"})}),(0,s.jsx)(n.td,{children:(0,s.jsx)(n.code,{children:"undefined"})}),(0,s.jsx)(n.td,{children:"CSS inline style object. React/JSX flavor, using camelCase properties."})]})]})]})}),"\n",(0,s.jsx)(n.p,{children:"Example configuration:"}),"\n",(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-js",metastring:'title="docusaurus.config.js"',children:"export default {\n themeConfig: {\n navbar: {\n title: 'Site Title',\n // highlight-start\n logo: {\n alt: 'Site Logo',\n src: 'img/logo.svg',\n srcDark: 'img/logo_dark.svg',\n href: 'https://docusaurus.io/',\n target: '_self',\n width: 32,\n height: 32,\n className: 'custom-navbar-logo-class',\n style: {border: 'solid red'},\n },\n // highlight-end\n },\n },\n};\n"})}),"\n",(0,s.jsx)(n.h3,{id:"navbar-items",children:"Navbar items"}),"\n",(0,s.jsxs)(n.p,{children:["You can add items to the navbar via ",(0,s.jsx)(n.code,{children:"themeConfig.navbar.items"}),"."]}),"\n",(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-js",metastring:'title="docusaurus.config.js"',children:"export default {\n themeConfig: {\n navbar: {\n // highlight-start\n items: [\n {\n type: 'doc',\n position: 'left',\n docId: 'introduction',\n label: 'Docs',\n },\n {to: 'blog', label: 'Blog', position: 'left'},\n {\n type: 'docsVersionDropdown',\n position: 'right',\n },\n {\n type: 'localeDropdown',\n position: 'right',\n },\n {\n href: 'https://github.com/facebook/docusaurus',\n position: 'right',\n className: 'header-github-link',\n 'aria-label': 'GitHub repository',\n },\n ],\n // highlight-end\n },\n },\n};\n"})}),"\n",(0,s.jsxs)(n.p,{children:["The items can have different behaviors based on the ",(0,s.jsx)(n.code,{children:"type"})," field. The sections below will introduce you to all the types of navbar items available."]}),"\n",(0,s.jsx)(n.h4,{id:"navbar-link",children:"Navbar link"}),"\n",(0,s.jsx)(n.p,{children:"By default, Navbar items are regular links (internal or external)."}),"\n",(0,s.jsxs)(n.p,{children:["React Router should automatically apply active link styling to links, but you can use ",(0,s.jsx)(n.code,{children:"activeBasePath"})," in edge cases. For cases in which a link should be active on several different paths (such as when you have multiple doc folders under the same sidebar), you can use ",(0,s.jsx)(n.code,{children:"activeBaseRegex"}),". ",(0,s.jsx)(n.code,{children:"activeBaseRegex"})," is a more flexible alternative to ",(0,s.jsx)(n.code,{children:"activeBasePath"})," and takes precedence over it -- Docusaurus parses it into a regular expression that is tested against the current URL."]}),"\n",(0,s.jsxs)(n.p,{children:["Outbound (external) links automatically get ",(0,s.jsx)(n.code,{children:'target="_blank" rel="noopener noreferrer"'})," attributes."]}),"\n",(0,s.jsx)(n.p,{children:"Accepted fields:"}),"\n",(0,s.jsx)(r.Z,{name:"navbar-link",children:(0,s.jsxs)(n.table,{children:[(0,s.jsx)(n.thead,{children:(0,s.jsxs)(n.tr,{children:[(0,s.jsx)(n.th,{children:"Name"}),(0,s.jsx)(n.th,{children:"Type"}),(0,s.jsx)(n.th,{children:"Default"}),(0,s.jsx)(n.th,{children:"Description"})]})}),(0,s.jsxs)(n.tbody,{children:[(0,s.jsxs)(n.tr,{children:[(0,s.jsx)(n.td,{children:(0,s.jsx)(n.code,{children:"type"})}),(0,s.jsx)(n.td,{children:(0,s.jsx)(n.code,{children:"'default'"})}),(0,s.jsx)(n.td,{children:"Optional"}),(0,s.jsx)(n.td,{children:"Sets the type of this item to a link."})]}),(0,s.jsxs)(n.tr,{children:[(0,s.jsx)(n.td,{children:(0,s.jsx)(n.code,{children:"label"})}),(0,s.jsx)(n.td,{children:(0,s.jsx)(n.code,{children:"string"})}),(0,s.jsx)(n.td,{children:(0,s.jsx)(n.strong,{children:"Required"})}),(0,s.jsx)(n.td,{children:"The name to be shown for this item."})]}),(0,s.jsxs)(n.tr,{children:[(0,s.jsx)(n.td,{children:(0,s.jsx)(n.code,{children:"html"})}),(0,s.jsx)(n.td,{children:(0,s.jsx)(n.code,{children:"string"})}),(0,s.jsx)(n.td,{children:"Optional"}),(0,s.jsxs)(n.td,{children:["Same as ",(0,s.jsx)(n.code,{children:"label"}),", but renders pure HTML instead of text content."]})]}),(0,s.jsxs)(n.tr,{children:[(0,s.jsx)(n.td,{children:(0,s.jsx)(n.code,{children:"to"})}),(0,s.jsx)(n.td,{children:(0,s.jsx)(n.code,{children:"string"})}),(0,s.jsx)(n.td,{children:(0,s.jsx)(n.strong,{children:"Required"})}),(0,s.jsx)(n.td,{children:"Client-side routing, used for navigating within the website. The baseUrl will be automatically prepended to this value."})]}),(0,s.jsxs)(n.tr,{children:[(0,s.jsx)(n.td,{children:(0,s.jsx)(n.code,{children:"href"})}),(0,s.jsx)(n.td,{children:(0,s.jsx)(n.code,{children:"string"})}),(0,s.jsx)(n.td,{children:(0,s.jsx)(n.strong,{children:"Required"})}),(0,s.jsxs)(n.td,{children:["A full-page navigation, used for navigating outside of the website. ",(0,s.jsxs)(n.strong,{children:["Only one of ",(0,s.jsx)(n.code,{children:"to"})," or ",(0,s.jsx)(n.code,{children:"href"})," should be used."]})]})]}),(0,s.jsxs)(n.tr,{children:[(0,s.jsx)(n.td,{children:(0,s.jsx)(n.code,{children:"prependBaseUrlToHref"})}),(0,s.jsx)(n.td,{children:(0,s.jsx)(n.code,{children:"boolean"})}),(0,s.jsx)(n.td,{children:(0,s.jsx)(n.code,{children:"false"})}),(0,s.jsxs)(n.td,{children:["Prepends the baseUrl to ",(0,s.jsx)(n.code,{children:"href"})," values."]})]}),(0,s.jsxs)(n.tr,{children:[(0,s.jsx)(n.td,{children:(0,s.jsx)(n.code,{children:"position"})}),(0,s.jsx)(n.td,{children:(0,s.jsx)("code",{children:"'left' | 'right'"})}),(0,s.jsx)(n.td,{children:(0,s.jsx)(n.code,{children:"'left'"})}),(0,s.jsx)(n.td,{children:"The side of the navbar this item should appear on."})]}),(0,s.jsxs)(n.tr,{children:[(0,s.jsx)(n.td,{children:(0,s.jsx)(n.code,{children:"activeBasePath"})}),(0,s.jsx)(n.td,{children:(0,s.jsx)(n.code,{children:"string"})}),(0,s.jsxs)(n.td,{children:[(0,s.jsx)(n.code,{children:"to"})," / ",(0,s.jsx)(n.code,{children:"href"})]}),(0,s.jsx)(n.td,{children:"To apply the active class styling on all routes starting with this path. This usually isn't necessary."})]}),(0,s.jsxs)(n.tr,{children:[(0,s.jsx)(n.td,{children:(0,s.jsx)(n.code,{children:"activeBaseRegex"})}),(0,s.jsx)(n.td,{children:(0,s.jsx)(n.code,{children:"string"})}),(0,s.jsx)(n.td,{children:(0,s.jsx)(n.code,{children:"undefined"})}),(0,s.jsxs)(n.td,{children:["Alternative to ",(0,s.jsx)(n.code,{children:"activeBasePath"})," if required."]})]}),(0,s.jsxs)(n.tr,{children:[(0,s.jsx)(n.td,{children:(0,s.jsx)(n.code,{children:"className"})}),(0,s.jsx)(n.td,{children:(0,s.jsx)(n.code,{children:"string"})}),(0,s.jsx)(n.td,{children:(0,s.jsx)(n.code,{children:"''"})}),(0,s.jsx)(n.td,{children:"Custom CSS class (for styling any item)."})]})]})]})}),"\n",(0,s.jsx)(n.admonition,{type:"note",children:(0,s.jsx)(n.p,{children:"In addition to the fields above, you can specify other arbitrary attributes that can be applied to a HTML link."})}),"\n",(0,s.jsx)(n.p,{children:"Example configuration:"}),"\n",(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-js",metastring:'title="docusaurus.config.js"',children:"export default {\n themeConfig: {\n navbar: {\n items: [\n // highlight-start\n {\n to: 'docs/introduction',\n // Only one of \"to\" or \"href\" should be used\n // href: 'https://www.facebook.com',\n label: 'Introduction',\n // Only one of \"label\" or \"html\" should be used\n // html: 'Introduction'\n position: 'left',\n activeBaseRegex: 'docs/(next|v8)',\n target: '_blank',\n },\n // highlight-end\n ],\n },\n },\n};\n"})}),"\n",(0,s.jsx)(n.h4,{id:"navbar-dropdown",children:"Navbar dropdown"}),"\n",(0,s.jsxs)(n.p,{children:["Navbar items of the type ",(0,s.jsx)(n.code,{children:"dropdown"})," has the additional ",(0,s.jsx)(n.code,{children:"items"})," field, an inner array of navbar items."]}),"\n",(0,s.jsxs)(n.p,{children:["Navbar dropdown items only accept the following ",(0,s.jsx)(n.strong,{children:'"link-like" item types'}),":"]}),"\n",(0,s.jsxs)(n.ul,{children:["\n",(0,s.jsx)(n.li,{children:(0,s.jsx)(n.a,{href:"#navbar-link",children:"Navbar link"})}),"\n",(0,s.jsx)(n.li,{children:(0,s.jsx)(n.a,{href:"#navbar-doc-link",children:"Navbar doc link"})}),"\n",(0,s.jsx)(n.li,{children:(0,s.jsx)(n.a,{href:"#navbar-docs-version",children:"Navbar docs version"})}),"\n",(0,s.jsx)(n.li,{children:(0,s.jsx)(n.a,{href:"#navbar-doc-sidebar",children:"Navbar doc sidebar"})}),"\n",(0,s.jsx)(n.li,{children:(0,s.jsx)(n.a,{href:"#navbar-with-custom-html",children:"Navbar with custom HTML"})}),"\n"]}),"\n",(0,s.jsxs)(n.p,{children:["Note that the dropdown base item is a clickable link as well, so this item can receive any of the props of a ",(0,s.jsx)(n.a,{href:"#navbar-link",children:"plain navbar link"}),"."]}),"\n",(0,s.jsx)(n.p,{children:"Accepted fields:"}),"\n",(0,s.jsx)(r.Z,{name:"navbar-dropdown",children:(0,s.jsxs)(n.table,{children:[(0,s.jsx)(n.thead,{children:(0,s.jsxs)(n.tr,{children:[(0,s.jsx)(n.th,{children:"Name"}),(0,s.jsx)(n.th,{children:"Type"}),(0,s.jsx)(n.th,{children:"Default"}),(0,s.jsx)(n.th,{children:"Description"})]})}),(0,s.jsxs)(n.tbody,{children:[(0,s.jsxs)(n.tr,{children:[(0,s.jsx)(n.td,{children:(0,s.jsx)(n.code,{children:"type"})}),(0,s.jsx)(n.td,{children:(0,s.jsx)(n.code,{children:"'dropdown'"})}),(0,s.jsx)(n.td,{children:"Optional"}),(0,s.jsx)(n.td,{children:"Sets the type of this item to a dropdown."})]}),(0,s.jsxs)(n.tr,{children:[(0,s.jsx)(n.td,{children:(0,s.jsx)(n.code,{children:"label"})}),(0,s.jsx)(n.td,{children:(0,s.jsx)(n.code,{children:"string"})}),(0,s.jsx)(n.td,{children:(0,s.jsx)(n.strong,{children:"Required"})}),(0,s.jsx)(n.td,{children:"The name to be shown for this item."})]}),(0,s.jsxs)(n.tr,{children:[(0,s.jsx)(n.td,{children:(0,s.jsx)(n.code,{children:"items"})}),(0,s.jsx)(n.td,{children:(0,s.jsxs)("code",{children:[(0,s.jsx)(n.a,{href:"#navbar-dropdown",children:"LinkLikeItem"}),"[]"]})}),(0,s.jsx)(n.td,{children:(0,s.jsx)(n.strong,{children:"Required"})}),(0,s.jsx)(n.td,{children:"The items to be contained in the dropdown."})]}),(0,s.jsxs)(n.tr,{children:[(0,s.jsx)(n.td,{children:(0,s.jsx)(n.code,{children:"position"})}),(0,s.jsx)(n.td,{children:(0,s.jsx)("code",{children:"'left' | 'right'"})}),(0,s.jsx)(n.td,{children:(0,s.jsx)(n.code,{children:"'left'"})}),(0,s.jsx)(n.td,{children:"The side of the navbar this item should appear on."})]})]})]})}),"\n",(0,s.jsx)(n.p,{children:"Example configuration:"}),"\n",(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-js",metastring:'title="docusaurus.config.js"',children:"export default {\n themeConfig: {\n navbar: {\n items: [\n // highlight-start\n {\n type: 'dropdown',\n label: 'Community',\n position: 'left',\n items: [\n {\n label: 'Facebook',\n href: 'https://www.facebook.com',\n },\n {\n type: 'doc',\n label: 'Social',\n docId: 'social',\n },\n // ... more items\n ],\n },\n // highlight-end\n ],\n },\n },\n};\n"})}),"\n",(0,s.jsx)(n.h4,{id:"navbar-doc-link",children:"Navbar doc link"}),"\n",(0,s.jsxs)(n.p,{children:["If you want to link to a specific doc, this special navbar item type will render the link to the doc of the provided ",(0,s.jsx)(n.code,{children:"docId"}),". It will get the class ",(0,s.jsx)(n.code,{children:"navbar__link--active"})," as long as you browse a doc of the same sidebar."]}),"\n",(0,s.jsx)(n.p,{children:"Accepted fields:"}),"\n",(0,s.jsx)(r.Z,{name:"navbar-doc-link",children:(0,s.jsxs)(n.table,{children:[(0,s.jsx)(n.thead,{children:(0,s.jsxs)(n.tr,{children:[(0,s.jsx)(n.th,{children:"Name"}),(0,s.jsx)(n.th,{children:"Type"}),(0,s.jsx)(n.th,{children:"Default"}),(0,s.jsx)(n.th,{children:"Description"})]})}),(0,s.jsxs)(n.tbody,{children:[(0,s.jsxs)(n.tr,{children:[(0,s.jsx)(n.td,{children:(0,s.jsx)(n.code,{children:"type"})}),(0,s.jsx)(n.td,{children:(0,s.jsx)(n.code,{children:"'doc'"})}),(0,s.jsx)(n.td,{children:(0,s.jsx)(n.strong,{children:"Required"})}),(0,s.jsx)(n.td,{children:"Sets the type of this item to a doc link."})]}),(0,s.jsxs)(n.tr,{children:[(0,s.jsx)(n.td,{children:(0,s.jsx)(n.code,{children:"docId"})}),(0,s.jsx)(n.td,{children:(0,s.jsx)(n.code,{children:"string"})}),(0,s.jsx)(n.td,{children:(0,s.jsx)(n.strong,{children:"Required"})}),(0,s.jsx)(n.td,{children:"The ID of the doc that this item links to."})]}),(0,s.jsxs)(n.tr,{children:[(0,s.jsx)(n.td,{children:(0,s.jsx)(n.code,{children:"label"})}),(0,s.jsx)(n.td,{children:(0,s.jsx)(n.code,{children:"string"})}),(0,s.jsx)(n.td,{children:(0,s.jsx)(n.code,{children:"docId"})}),(0,s.jsx)(n.td,{children:"The name to be shown for this item."})]}),(0,s.jsxs)(n.tr,{children:[(0,s.jsx)(n.td,{children:(0,s.jsx)(n.code,{children:"position"})}),(0,s.jsx)(n.td,{children:(0,s.jsx)("code",{children:"'left' | 'right'"})}),(0,s.jsx)(n.td,{children:(0,s.jsx)(n.code,{children:"'left'"})}),(0,s.jsx)(n.td,{children:"The side of the navbar this item should appear on."})]}),(0,s.jsxs)(n.tr,{children:[(0,s.jsx)(n.td,{children:(0,s.jsx)(n.code,{children:"docsPluginId"})}),(0,s.jsx)(n.td,{children:(0,s.jsx)(n.code,{children:"string"})}),(0,s.jsx)(n.td,{children:(0,s.jsx)(n.code,{children:"'default'"})}),(0,s.jsx)(n.td,{children:"The ID of the docs plugin that the doc belongs to."})]})]})]})}),"\n",(0,s.jsx)(n.p,{children:"Example configuration:"}),"\n",(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-js",metastring:'title="docusaurus.config.js"',children:"export default {\n themeConfig: {\n navbar: {\n items: [\n // highlight-start\n {\n type: 'doc',\n position: 'left',\n docId: 'introduction',\n label: 'Docs',\n },\n // highlight-end\n ],\n },\n },\n};\n"})}),"\n",(0,s.jsx)(n.h4,{id:"navbar-doc-sidebar",children:"Navbar linked to a sidebar"}),"\n",(0,s.jsx)(n.p,{children:"You can link a navbar item to the first document link (which can be a doc link or a generated category index) of a given sidebar without having to hardcode a doc ID."}),"\n",(0,s.jsx)(n.p,{children:"Accepted fields:"}),"\n",(0,s.jsx)(r.Z,{name:"navbar-doc-sidebar",children:(0,s.jsxs)(n.table,{children:[(0,s.jsx)(n.thead,{children:(0,s.jsxs)(n.tr,{children:[(0,s.jsx)(n.th,{children:"Name"}),(0,s.jsx)(n.th,{children:"Type"}),(0,s.jsx)(n.th,{children:"Default"}),(0,s.jsx)(n.th,{children:"Description"})]})}),(0,s.jsxs)(n.tbody,{children:[(0,s.jsxs)(n.tr,{children:[(0,s.jsx)(n.td,{children:(0,s.jsx)(n.code,{children:"type"})}),(0,s.jsx)(n.td,{children:(0,s.jsx)(n.code,{children:"'docSidebar'"})}),(0,s.jsx)(n.td,{children:(0,s.jsx)(n.strong,{children:"Required"})}),(0,s.jsx)(n.td,{children:"Sets the type of this navbar item to a sidebar's first document."})]}),(0,s.jsxs)(n.tr,{children:[(0,s.jsx)(n.td,{children:(0,s.jsx)(n.code,{children:"sidebarId"})}),(0,s.jsx)(n.td,{children:(0,s.jsx)(n.code,{children:"string"})}),(0,s.jsx)(n.td,{children:(0,s.jsx)(n.strong,{children:"Required"})}),(0,s.jsx)(n.td,{children:"The ID of the sidebar that this item is linked to."})]}),(0,s.jsxs)(n.tr,{children:[(0,s.jsx)(n.td,{children:(0,s.jsx)(n.code,{children:"label"})}),(0,s.jsx)(n.td,{children:(0,s.jsx)(n.code,{children:"string"})}),(0,s.jsx)(n.td,{children:"First document link's sidebar label"}),(0,s.jsx)(n.td,{children:"The name to be shown for this item."})]}),(0,s.jsxs)(n.tr,{children:[(0,s.jsx)(n.td,{children:(0,s.jsx)(n.code,{children:"position"})}),(0,s.jsx)(n.td,{children:(0,s.jsx)("code",{children:"'left' | 'right'"})}),(0,s.jsx)(n.td,{children:(0,s.jsx)(n.code,{children:"'left'"})}),(0,s.jsx)(n.td,{children:"The side of the navbar this item should appear on."})]}),(0,s.jsxs)(n.tr,{children:[(0,s.jsx)(n.td,{children:(0,s.jsx)(n.code,{children:"docsPluginId"})}),(0,s.jsx)(n.td,{children:(0,s.jsx)(n.code,{children:"string"})}),(0,s.jsx)(n.td,{children:(0,s.jsx)(n.code,{children:"'default'"})}),(0,s.jsx)(n.td,{children:"The ID of the docs plugin that the sidebar belongs to."})]})]})]})}),"\n",(0,s.jsx)(n.admonition,{type:"tip",children:(0,s.jsx)(n.p,{children:"Use this navbar item type if your sidebar is updated often and the order is not stable."})}),"\n",(0,s.jsx)(n.p,{children:"Example configuration:"}),"\n",(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-js",metastring:'title="docusaurus.config.js"',children:"export default {\n themeConfig: {\n navbar: {\n items: [\n // highlight-start\n {\n type: 'docSidebar',\n position: 'left',\n sidebarId: 'api',\n label: 'API',\n },\n // highlight-end\n ],\n },\n },\n};\n"})}),"\n",(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-js",metastring:'title="sidebars.js"',children:"export default {\n tutorial: [\n {\n type: 'autogenerated',\n dirName: 'guides',\n },\n ],\n api: [\n // highlight-next-line\n 'cli', // The navbar item will be linking to this doc\n 'docusaurus-core',\n {\n type: 'autogenerated',\n dirName: 'api',\n },\n ],\n};\n"})}),"\n",(0,s.jsx)(n.h4,{id:"navbar-docs-version-dropdown",children:"Navbar docs version dropdown"}),"\n",(0,s.jsx)(n.p,{children:"If you use docs with versioning, this special navbar item type that will render a dropdown with all your site's available versions."}),"\n",(0,s.jsx)(n.p,{children:"The user will be able to switch from one version to another, while staying on the same doc (as long as the doc ID is constant across versions)."}),"\n",(0,s.jsx)(n.p,{children:"Accepted fields:"}),"\n",(0,s.jsx)(r.Z,{name:"navbar-docs-version-dropdown",children:(0,s.jsxs)(n.table,{children:[(0,s.jsx)(n.thead,{children:(0,s.jsxs)(n.tr,{children:[(0,s.jsx)(n.th,{children:"Name"}),(0,s.jsx)(n.th,{children:"Type"}),(0,s.jsx)(n.th,{children:"Default"}),(0,s.jsx)(n.th,{children:"Description"})]})}),(0,s.jsxs)(n.tbody,{children:[(0,s.jsxs)(n.tr,{children:[(0,s.jsx)(n.td,{children:(0,s.jsx)(n.code,{children:"type"})}),(0,s.jsx)(n.td,{children:(0,s.jsx)(n.code,{children:"'docsVersionDropdown'"})}),(0,s.jsx)(n.td,{children:(0,s.jsx)(n.strong,{children:"Required"})}),(0,s.jsx)(n.td,{children:"Sets the type of this item to a docs version dropdown."})]}),(0,s.jsxs)(n.tr,{children:[(0,s.jsx)(n.td,{children:(0,s.jsx)(n.code,{children:"position"})}),(0,s.jsx)(n.td,{children:(0,s.jsx)("code",{children:"'left' | 'right'"})}),(0,s.jsx)(n.td,{children:(0,s.jsx)(n.code,{children:"'left'"})}),(0,s.jsx)(n.td,{children:"The side of the navbar this item should appear on."})]}),(0,s.jsxs)(n.tr,{children:[(0,s.jsx)(n.td,{children:(0,s.jsx)(n.code,{children:"dropdownItemsBefore"})}),(0,s.jsx)(n.td,{children:(0,s.jsxs)("code",{children:[(0,s.jsx)(n.a,{href:"#navbar-dropdown",children:"LinkLikeItem"}),"[]"]})}),(0,s.jsx)(n.td,{children:(0,s.jsx)(n.code,{children:"[]"})}),(0,s.jsx)(n.td,{children:"Add additional dropdown items at the beginning of the dropdown."})]}),(0,s.jsxs)(n.tr,{children:[(0,s.jsx)(n.td,{children:(0,s.jsx)(n.code,{children:"dropdownItemsAfter"})}),(0,s.jsx)(n.td,{children:(0,s.jsxs)("code",{children:[(0,s.jsx)(n.a,{href:"#navbar-dropdown",children:"LinkLikeItem"}),"[]"]})}),(0,s.jsx)(n.td,{children:(0,s.jsx)(n.code,{children:"[]"})}),(0,s.jsx)(n.td,{children:"Add additional dropdown items at the end of the dropdown."})]}),(0,s.jsxs)(n.tr,{children:[(0,s.jsx)(n.td,{children:(0,s.jsx)(n.code,{children:"docsPluginId"})}),(0,s.jsx)(n.td,{children:(0,s.jsx)(n.code,{children:"string"})}),(0,s.jsx)(n.td,{children:(0,s.jsx)(n.code,{children:"'default'"})}),(0,s.jsx)(n.td,{children:"The ID of the docs plugin that the doc versioning belongs to."})]}),(0,s.jsxs)(n.tr,{children:[(0,s.jsx)(n.td,{children:(0,s.jsx)(n.code,{children:"dropdownActiveClassDisabled"})}),(0,s.jsx)(n.td,{children:(0,s.jsx)(n.code,{children:"boolean"})}),(0,s.jsx)(n.td,{children:(0,s.jsx)(n.code,{children:"false"})}),(0,s.jsx)(n.td,{children:"Do not add the link active class when browsing docs."})]}),(0,s.jsxs)(n.tr,{children:[(0,s.jsx)(n.td,{children:(0,s.jsx)(n.code,{children:"versions"})}),(0,s.jsx)(n.td,{children:(0,s.jsx)(n.code,{children:"DropdownVersions"})}),(0,s.jsx)(n.td,{children:(0,s.jsx)(n.code,{children:"undefined"})}),(0,s.jsxs)(n.td,{children:["Specify a custom list of versions to include in the dropdown. See ",(0,s.jsx)(n.a,{href:"/docs/versioning#docsVersionDropdown",children:"the versioning guide"})," for details."]})]})]})]})}),"\n",(0,s.jsx)(n.p,{children:"Types:"}),"\n",(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-ts",children:"type DropdownVersion = {\n /** Allows you to provide a custom display label for each version. */\n label?: string;\n};\n\ntype DropdownVersions = string[] | {[versionName: string]: DropdownVersion};\n"})}),"\n",(0,s.jsx)(n.p,{children:"Example configuration:"}),"\n",(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-js",metastring:'title="docusaurus.config.js"',children:"export default {\n themeConfig: {\n navbar: {\n items: [\n // highlight-start\n {\n type: 'docsVersionDropdown',\n position: 'left',\n dropdownItemsAfter: [{to: '/versions', label: 'All versions'}],\n dropdownActiveClassDisabled: true,\n },\n // highlight-end\n ],\n },\n },\n};\n"})}),"\n",(0,s.jsx)(n.h4,{id:"navbar-docs-version",children:"Navbar docs version"}),"\n",(0,s.jsx)(n.p,{children:"If you use docs with versioning, this special navbar item type will link to the active/browsed version of your doc (depends on the current URL), and fallback to the latest version."}),"\n",(0,s.jsx)(n.p,{children:"Accepted fields:"}),"\n",(0,s.jsx)(r.Z,{name:"navbar-docs-version",children:(0,s.jsxs)(n.table,{children:[(0,s.jsx)(n.thead,{children:(0,s.jsxs)(n.tr,{children:[(0,s.jsx)(n.th,{children:"Name"}),(0,s.jsx)(n.th,{children:"Type"}),(0,s.jsx)(n.th,{children:"Default"}),(0,s.jsx)(n.th,{children:"Description"})]})}),(0,s.jsxs)(n.tbody,{children:[(0,s.jsxs)(n.tr,{children:[(0,s.jsx)(n.td,{children:(0,s.jsx)(n.code,{children:"type"})}),(0,s.jsx)(n.td,{children:(0,s.jsx)(n.code,{children:"'docsVersion'"})}),(0,s.jsx)(n.td,{children:(0,s.jsx)(n.strong,{children:"Required"})}),(0,s.jsx)(n.td,{children:"Sets the type of this item to a doc version link."})]}),(0,s.jsxs)(n.tr,{children:[(0,s.jsx)(n.td,{children:(0,s.jsx)(n.code,{children:"label"})}),(0,s.jsx)(n.td,{children:(0,s.jsx)(n.code,{children:"string"})}),(0,s.jsx)(n.td,{children:"The active/latest version label."}),(0,s.jsx)(n.td,{children:"The name to be shown for this item."})]}),(0,s.jsxs)(n.tr,{children:[(0,s.jsx)(n.td,{children:(0,s.jsx)(n.code,{children:"to"})}),(0,s.jsx)(n.td,{children:(0,s.jsx)(n.code,{children:"string"})}),(0,s.jsx)(n.td,{children:"The active/latest version."}),(0,s.jsx)(n.td,{children:"The internal link that this item points to."})]}),(0,s.jsxs)(n.tr,{children:[(0,s.jsx)(n.td,{children:(0,s.jsx)(n.code,{children:"position"})}),(0,s.jsx)(n.td,{children:(0,s.jsx)("code",{children:"'left' | 'right'"})}),(0,s.jsx)(n.td,{children:(0,s.jsx)(n.code,{children:"'left'"})}),(0,s.jsx)(n.td,{children:"The side of the navbar this item should appear on."})]}),(0,s.jsxs)(n.tr,{children:[(0,s.jsx)(n.td,{children:(0,s.jsx)(n.code,{children:"docsPluginId"})}),(0,s.jsx)(n.td,{children:(0,s.jsx)(n.code,{children:"string"})}),(0,s.jsx)(n.td,{children:(0,s.jsx)(n.code,{children:"'default'"})}),(0,s.jsx)(n.td,{children:"The ID of the docs plugin that the doc versioning belongs to."})]})]})]})}),"\n",(0,s.jsx)(n.p,{children:"Example configuration:"}),"\n",(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-js",metastring:'title="docusaurus.config.js"',children:"export default {\n themeConfig: {\n navbar: {\n items: [\n // highlight-start\n {\n type: 'docsVersion',\n position: 'left',\n to: '/path',\n label: 'label',\n },\n // highlight-end\n ],\n },\n },\n};\n"})}),"\n",(0,s.jsx)(n.h4,{id:"navbar-locale-dropdown",children:"Navbar locale dropdown"}),"\n",(0,s.jsxs)(n.p,{children:["If you use the ",(0,s.jsx)(n.a,{href:"/docs/i18n/introduction",children:"i18n feature"}),", this special navbar item type will render a dropdown with all your site's available locales."]}),"\n",(0,s.jsx)(n.p,{children:"The user will be able to switch from one locale to another, while staying on the same page."}),"\n",(0,s.jsx)(n.p,{children:"Accepted fields:"}),"\n",(0,s.jsx)(r.Z,{name:"navbar-locale-dropdown",children:(0,s.jsxs)(n.table,{children:[(0,s.jsx)(n.thead,{children:(0,s.jsxs)(n.tr,{children:[(0,s.jsx)(n.th,{children:"Name"}),(0,s.jsx)(n.th,{children:"Type"}),(0,s.jsx)(n.th,{children:"Default"}),(0,s.jsx)(n.th,{children:"Description"})]})}),(0,s.jsxs)(n.tbody,{children:[(0,s.jsxs)(n.tr,{children:[(0,s.jsx)(n.td,{children:(0,s.jsx)(n.code,{children:"type"})}),(0,s.jsx)(n.td,{children:(0,s.jsx)(n.code,{children:"'localeDropdown'"})}),(0,s.jsx)(n.td,{children:(0,s.jsx)(n.strong,{children:"Required"})}),(0,s.jsx)(n.td,{children:"Sets the type of this item to a locale dropdown."})]}),(0,s.jsxs)(n.tr,{children:[(0,s.jsx)(n.td,{children:(0,s.jsx)(n.code,{children:"position"})}),(0,s.jsx)(n.td,{children:(0,s.jsx)("code",{children:"'left' | 'right'"})}),(0,s.jsx)(n.td,{children:(0,s.jsx)(n.code,{children:"'left'"})}),(0,s.jsx)(n.td,{children:"The side of the navbar this item should appear on."})]}),(0,s.jsxs)(n.tr,{children:[(0,s.jsx)(n.td,{children:(0,s.jsx)(n.code,{children:"dropdownItemsBefore"})}),(0,s.jsx)(n.td,{children:(0,s.jsxs)("code",{children:[(0,s.jsx)(n.a,{href:"#navbar-dropdown",children:"LinkLikeItem"}),"[]"]})}),(0,s.jsx)(n.td,{children:(0,s.jsx)(n.code,{children:"[]"})}),(0,s.jsx)(n.td,{children:"Add additional dropdown items at the beginning of the dropdown."})]}),(0,s.jsxs)(n.tr,{children:[(0,s.jsx)(n.td,{children:(0,s.jsx)(n.code,{children:"dropdownItemsAfter"})}),(0,s.jsx)(n.td,{children:(0,s.jsxs)("code",{children:[(0,s.jsx)(n.a,{href:"#navbar-dropdown",children:"LinkLikeItem"}),"[]"]})}),(0,s.jsx)(n.td,{children:(0,s.jsx)(n.code,{children:"[]"})}),(0,s.jsx)(n.td,{children:"Add additional dropdown items at the end of the dropdown."})]}),(0,s.jsxs)(n.tr,{children:[(0,s.jsx)(n.td,{children:(0,s.jsx)(n.code,{children:"queryString"})}),(0,s.jsx)(n.td,{children:(0,s.jsx)(n.code,{children:"string"})}),(0,s.jsx)(n.td,{children:(0,s.jsx)(n.code,{children:"undefined"})}),(0,s.jsx)(n.td,{children:"The query string to be appended to the URL."})]})]})]})}),"\n",(0,s.jsx)(n.p,{children:"Example configuration:"}),"\n",(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-js",metastring:'title="docusaurus.config.js"',children:"export default {\n themeConfig: {\n navbar: {\n items: [\n // highlight-start\n {\n type: 'localeDropdown',\n position: 'left',\n dropdownItemsAfter: [\n {\n to: 'https://my-site.com/help-us-translate',\n label: 'Help us translate',\n },\n ],\n },\n // highlight-end\n ],\n },\n },\n};\n"})}),"\n",(0,s.jsx)(n.h4,{id:"navbar-search",children:"Navbar search"}),"\n",(0,s.jsxs)(n.p,{children:["If you use the ",(0,s.jsx)(n.a,{href:"/docs/search",children:"search"}),", the search bar will be the rightmost element in the navbar."]}),"\n",(0,s.jsx)(n.p,{children:"However, with this special navbar item type, you can change the default location."}),"\n",(0,s.jsx)(r.Z,{name:"navbar-search",children:(0,s.jsxs)(n.table,{children:[(0,s.jsx)(n.thead,{children:(0,s.jsxs)(n.tr,{children:[(0,s.jsx)(n.th,{children:"Name"}),(0,s.jsx)(n.th,{children:"Type"}),(0,s.jsx)(n.th,{children:"Default"}),(0,s.jsx)(n.th,{children:"Description"})]})}),(0,s.jsxs)(n.tbody,{children:[(0,s.jsxs)(n.tr,{children:[(0,s.jsx)(n.td,{children:(0,s.jsx)(n.code,{children:"type"})}),(0,s.jsx)(n.td,{children:(0,s.jsx)(n.code,{children:"'search'"})}),(0,s.jsx)(n.td,{children:(0,s.jsx)(n.strong,{children:"Required"})}),(0,s.jsx)(n.td,{children:"Sets the type of this item to a search bar."})]}),(0,s.jsxs)(n.tr,{children:[(0,s.jsx)(n.td,{children:(0,s.jsx)(n.code,{children:"position"})}),(0,s.jsx)(n.td,{children:(0,s.jsx)("code",{children:"'left' | 'right'"})}),(0,s.jsx)(n.td,{children:(0,s.jsx)(n.code,{children:"'left'"})}),(0,s.jsx)(n.td,{children:"The side of the navbar this item should appear on."})]}),(0,s.jsxs)(n.tr,{children:[(0,s.jsx)(n.td,{children:(0,s.jsx)(n.code,{children:"className"})}),(0,s.jsx)(n.td,{children:(0,s.jsx)(n.code,{children:"string"})}),(0,s.jsx)(n.td,{children:"/"}),(0,s.jsx)(n.td,{children:"Custom CSS class for this navbar item."})]})]})]})}),"\n",(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-js",metastring:'title="docusaurus.config.js"',children:"export default {\n themeConfig: {\n navbar: {\n items: [\n // highlight-start\n {\n type: 'search',\n position: 'right',\n },\n // highlight-end\n ],\n },\n },\n};\n"})}),"\n",(0,s.jsx)(n.h4,{id:"navbar-with-custom-html",children:"Navbar with custom HTML"}),"\n",(0,s.jsx)(n.p,{children:"You can also render your own HTML markup inside a navbar item using this navbar item type."}),"\n",(0,s.jsx)(r.Z,{name:"navbar-html",children:(0,s.jsxs)(n.table,{children:[(0,s.jsx)(n.thead,{children:(0,s.jsxs)(n.tr,{children:[(0,s.jsx)(n.th,{children:"Name"}),(0,s.jsx)(n.th,{children:"Type"}),(0,s.jsx)(n.th,{children:"Default"}),(0,s.jsx)(n.th,{children:"Description"})]})}),(0,s.jsxs)(n.tbody,{children:[(0,s.jsxs)(n.tr,{children:[(0,s.jsx)(n.td,{children:(0,s.jsx)(n.code,{children:"type"})}),(0,s.jsx)(n.td,{children:(0,s.jsx)(n.code,{children:"'html'"})}),(0,s.jsx)(n.td,{children:(0,s.jsx)(n.strong,{children:"Required"})}),(0,s.jsx)(n.td,{children:"Sets the type of this item to a HTML element."})]}),(0,s.jsxs)(n.tr,{children:[(0,s.jsx)(n.td,{children:(0,s.jsx)(n.code,{children:"position"})}),(0,s.jsx)(n.td,{children:(0,s.jsx)("code",{children:"'left' | 'right'"})}),(0,s.jsx)(n.td,{children:(0,s.jsx)(n.code,{children:"'left'"})}),(0,s.jsx)(n.td,{children:"The side of the navbar this item should appear on."})]}),(0,s.jsxs)(n.tr,{children:[(0,s.jsx)(n.td,{children:(0,s.jsx)(n.code,{children:"className"})}),(0,s.jsx)(n.td,{children:(0,s.jsx)(n.code,{children:"string"})}),(0,s.jsx)(n.td,{children:(0,s.jsx)(n.code,{children:"''"})}),(0,s.jsx)(n.td,{children:"Custom CSS class for this navbar item."})]}),(0,s.jsxs)(n.tr,{children:[(0,s.jsx)(n.td,{children:(0,s.jsx)(n.code,{children:"value"})}),(0,s.jsx)(n.td,{children:(0,s.jsx)(n.code,{children:"string"})}),(0,s.jsx)(n.td,{children:(0,s.jsx)(n.code,{children:"''"})}),(0,s.jsx)(n.td,{children:"Custom HTML to be rendered inside this navbar item."})]})]})]})}),"\n",(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-js",metastring:'title="docusaurus.config.js"',children:"export default {\n themeConfig: {\n navbar: {\n items: [\n // highlight-start\n {\n type: 'html',\n position: 'right',\n value: '',\n },\n // highlight-end\n ],\n },\n },\n};\n"})}),"\n",(0,s.jsx)(n.h3,{id:"auto-hide-sticky-navbar",children:"Auto-hide sticky navbar"}),"\n",(0,s.jsx)(n.p,{children:"You can enable this cool UI feature that automatically hides the navbar when a user starts scrolling down the page, and show it again when the user scrolls up."}),"\n",(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-js",metastring:'title="docusaurus.config.js"',children:"export default {\n themeConfig: {\n navbar: {\n // highlight-next-line\n hideOnScroll: true,\n },\n },\n};\n"})}),"\n",(0,s.jsx)(n.h3,{id:"navbar-style",children:"Navbar style"}),"\n",(0,s.jsx)(n.p,{children:"You can set the static Navbar style without disabling the theme switching ability. The selected style will always apply no matter which theme user have selected."}),"\n",(0,s.jsxs)(n.p,{children:["Currently, there are two possible style options: ",(0,s.jsx)(n.code,{children:"dark"})," and ",(0,s.jsx)(n.code,{children:"primary"})," (based on the ",(0,s.jsx)(n.code,{children:"--ifm-color-primary"})," color). You can see the styles preview in the ",(0,s.jsx)(n.a,{href:"https://infima.dev/docs/components/navbar/",children:"Infima documentation"}),"."]}),"\n",(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-js",metastring:'title="docusaurus.config.js"',children:"export default {\n themeConfig: {\n navbar: {\n // highlight-next-line\n style: 'primary',\n },\n },\n};\n"})}),"\n",(0,s.jsx)(n.h2,{id:"codeblock",children:"CodeBlock"}),"\n",(0,s.jsxs)(n.p,{children:["Docusaurus uses ",(0,s.jsx)(n.a,{href:"https://github.com/FormidableLabs/prism-react-renderer",children:"Prism React Renderer"})," to highlight code blocks. All configuration are in the ",(0,s.jsx)(n.code,{children:"prism"})," object."]}),"\n",(0,s.jsx)(n.p,{children:"Accepted fields:"}),"\n",(0,s.jsx)(r.Z,{name:"codeblock",children:(0,s.jsxs)(n.table,{children:[(0,s.jsx)(n.thead,{children:(0,s.jsxs)(n.tr,{children:[(0,s.jsx)(n.th,{children:"Name"}),(0,s.jsx)(n.th,{children:"Type"}),(0,s.jsx)(n.th,{children:"Default"}),(0,s.jsx)(n.th,{children:"Description"})]})}),(0,s.jsxs)(n.tbody,{children:[(0,s.jsxs)(n.tr,{children:[(0,s.jsx)(n.td,{children:(0,s.jsx)(n.code,{children:"theme"})}),(0,s.jsx)(n.td,{children:(0,s.jsx)(n.code,{children:"PrismTheme"})}),(0,s.jsx)(n.td,{children:(0,s.jsx)(n.code,{children:"palenight"})}),(0,s.jsx)(n.td,{children:"The Prism theme to use for light-theme code blocks."})]}),(0,s.jsxs)(n.tr,{children:[(0,s.jsx)(n.td,{children:(0,s.jsx)(n.code,{children:"darkTheme"})}),(0,s.jsx)(n.td,{children:(0,s.jsx)(n.code,{children:"PrismTheme"})}),(0,s.jsx)(n.td,{children:(0,s.jsx)(n.code,{children:"palenight"})}),(0,s.jsx)(n.td,{children:"The Prism theme to use for dark-theme code blocks."})]}),(0,s.jsxs)(n.tr,{children:[(0,s.jsx)(n.td,{children:(0,s.jsx)(n.code,{children:"defaultLanguage"})}),(0,s.jsx)(n.td,{children:(0,s.jsx)(n.code,{children:"string"})}),(0,s.jsx)(n.td,{children:(0,s.jsx)(n.code,{children:"undefined"})}),(0,s.jsx)(n.td,{children:"The default language to use for code blocks not declaring any explicit language."})]}),(0,s.jsxs)(n.tr,{children:[(0,s.jsx)(n.td,{children:(0,s.jsx)(n.code,{children:"magicComments"})}),(0,s.jsx)(n.td,{children:(0,s.jsx)(n.code,{children:"MagicCommentConfig[]"})}),(0,s.jsx)(n.td,{children:(0,s.jsx)(n.em,{children:"see below"})}),(0,s.jsxs)(n.td,{children:["The list of ",(0,s.jsx)(n.a,{href:"/docs/markdown-features/code-blocks#custom-magic-comments",children:"magic comments"}),"."]})]})]})]})}),"\n",(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-ts",children:"type MagicCommentConfig = {\n className: string;\n line?: string;\n block?: {start: string; end: string};\n};\n"})}),"\n",(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-js",children:"const defaultMagicComments = [\n {\n className: 'theme-code-block-highlighted-line',\n line: 'highlight-next-line',\n block: {start: 'highlight-start', end: 'highlight-end'},\n },\n];\n"})}),"\n",(0,s.jsx)(n.h3,{id:"theme",children:"Theme"}),"\n",(0,s.jsxs)(n.p,{children:["By default, we use ",(0,s.jsx)(n.a,{href:"https://github.com/FormidableLabs/prism-react-renderer/blob/master/packages/prism-react-renderer/src/themes/palenight.ts",children:"Palenight"})," as syntax highlighting theme. You can specify a custom theme from the ",(0,s.jsx)(n.a,{href:"https://github.com/FormidableLabs/prism-react-renderer/tree/master/packages/prism-react-renderer/src/themes",children:"list of available themes"}),". You may also use a different syntax highlighting theme when the site is in dark mode."]}),"\n",(0,s.jsx)(n.p,{children:"Example configuration:"}),"\n",(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-js",metastring:'title="docusaurus.config.js"',children:"import {themes as prismThemes} from 'prism-react-renderer';\n\nexport default {\n themeConfig: {\n prism: {\n // highlight-start\n theme: prismThemes.github,\n darkTheme: prismThemes.dracula,\n // highlight-end\n },\n },\n};\n"})}),"\n",(0,s.jsx)(n.admonition,{type:"note",children:(0,s.jsxs)(n.p,{children:["If you use the line highlighting Markdown syntax, you might need to specify a different highlight background color for the dark mode syntax highlighting theme. Refer to the ",(0,s.jsx)(n.a,{href:"/docs/markdown-features/code-blocks#line-highlighting",children:"docs for guidance"}),"."]})}),"\n",(0,s.jsx)(n.h3,{id:"default-language",children:"Default language"}),"\n",(0,s.jsxs)(n.p,{children:["You can set a default language for code blocks if no language is added after the opening triple backticks (i.e. ```). Note that a valid ",(0,s.jsx)(n.a,{href:"https://prismjs.com/#supported-languages",children:"language name"})," must be passed."]}),"\n",(0,s.jsx)(n.p,{children:"Example configuration:"}),"\n",(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-js",metastring:'title="docusaurus.config.js"',children:"export default {\n themeConfig: {\n prism: {\n // highlight-next-line\n defaultLanguage: 'javascript',\n },\n },\n};\n"})}),"\n",(0,s.jsx)(n.h2,{id:"footer-1",children:"Footer"}),"\n",(0,s.jsxs)(n.p,{children:["You can add logo and a copyright to the footer via ",(0,s.jsx)(n.code,{children:"themeConfig.footer"}),". Logo can be placed in ",(0,s.jsx)(n.a,{href:"/docs/static-assets",children:"static folder"}),". Logo URL works in the same way of the navbar logo."]}),"\n",(0,s.jsx)(n.p,{children:"Accepted fields:"}),"\n",(0,s.jsx)(r.Z,{name:"footer",children:(0,s.jsxs)(n.table,{children:[(0,s.jsx)(n.thead,{children:(0,s.jsxs)(n.tr,{children:[(0,s.jsx)(n.th,{children:"Name"}),(0,s.jsx)(n.th,{children:"Type"}),(0,s.jsx)(n.th,{children:"Default"}),(0,s.jsx)(n.th,{children:"Description"})]})}),(0,s.jsxs)(n.tbody,{children:[(0,s.jsxs)(n.tr,{children:[(0,s.jsx)(n.td,{children:(0,s.jsx)(n.code,{children:"logo"})}),(0,s.jsx)(n.td,{children:(0,s.jsx)(n.code,{children:"Logo"})}),(0,s.jsx)(n.td,{children:(0,s.jsx)(n.code,{children:"undefined"})}),(0,s.jsxs)(n.td,{children:["Customization of the logo object. See ",(0,s.jsx)(n.a,{href:"#navbar-logo",children:"Navbar logo"})," for details."]})]}),(0,s.jsxs)(n.tr,{children:[(0,s.jsx)(n.td,{children:(0,s.jsx)(n.code,{children:"copyright"})}),(0,s.jsx)(n.td,{children:(0,s.jsx)(n.code,{children:"string"})}),(0,s.jsx)(n.td,{children:(0,s.jsx)(n.code,{children:"undefined"})}),(0,s.jsx)(n.td,{children:"The copyright message to be displayed at the bottom, also supports custom HTML."})]}),(0,s.jsxs)(n.tr,{children:[(0,s.jsx)(n.td,{children:(0,s.jsx)(n.code,{children:"style"})}),(0,s.jsx)(n.td,{children:(0,s.jsx)("code",{children:"'dark' | 'light'"})}),(0,s.jsx)(n.td,{children:(0,s.jsx)(n.code,{children:"'light'"})}),(0,s.jsx)(n.td,{children:"The color theme of the footer component."})]}),(0,s.jsxs)(n.tr,{children:[(0,s.jsx)(n.td,{children:(0,s.jsx)(n.code,{children:"links"})}),(0,s.jsx)(n.td,{children:(0,s.jsx)("code",{children:"(Column | FooterLink)[]"})}),(0,s.jsx)(n.td,{children:(0,s.jsx)(n.code,{children:"[]"})}),(0,s.jsx)(n.td,{children:"The link groups to be present."})]})]})]})}),"\n",(0,s.jsx)(n.p,{children:"Example configuration:"}),"\n",(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-js",metastring:'title="docusaurus.config.js"',children:"export default {\n themeConfig: {\n // highlight-start\n footer: {\n logo: {\n alt: 'Meta Open Source Logo',\n src: 'img/meta_oss_logo.png',\n href: 'https://opensource.fb.com',\n width: 160,\n height: 51,\n },\n copyright: `Copyright \xa9 ${new Date().getFullYear()} My Project, Inc. Built with Docusaurus.`,\n },\n // highlight-end\n },\n};\n"})}),"\n",(0,s.jsx)(n.h3,{id:"footer-links",children:"Footer Links"}),"\n",(0,s.jsxs)(n.p,{children:["You can add links to the footer via ",(0,s.jsx)(n.code,{children:"themeConfig.footer.links"}),". There are two types of footer configurations: ",(0,s.jsx)(n.strong,{children:"multi-column footers"})," and ",(0,s.jsx)(n.strong,{children:"simple footers"}),"."]}),"\n",(0,s.jsxs)(n.p,{children:["Multi-column footer links have a ",(0,s.jsx)(n.code,{children:"title"})," and a list of ",(0,s.jsx)(n.code,{children:"FooterItem"}),"s for each column."]}),"\n",(0,s.jsx)(r.Z,{name:"footer-links",children:(0,s.jsxs)(n.table,{children:[(0,s.jsx)(n.thead,{children:(0,s.jsxs)(n.tr,{children:[(0,s.jsx)(n.th,{children:"Name"}),(0,s.jsx)(n.th,{children:"Type"}),(0,s.jsx)(n.th,{children:"Default"}),(0,s.jsx)(n.th,{children:"Description"})]})}),(0,s.jsxs)(n.tbody,{children:[(0,s.jsxs)(n.tr,{children:[(0,s.jsx)(n.td,{children:(0,s.jsx)(n.code,{children:"title"})}),(0,s.jsx)(n.td,{children:(0,s.jsx)(n.code,{children:"string"})}),(0,s.jsx)(n.td,{children:(0,s.jsx)(n.code,{children:"undefined"})}),(0,s.jsx)(n.td,{children:"Label of the section of these links."})]}),(0,s.jsxs)(n.tr,{children:[(0,s.jsx)(n.td,{children:(0,s.jsx)(n.code,{children:"items"})}),(0,s.jsx)(n.td,{children:(0,s.jsx)(n.code,{children:"FooterItem[]"})}),(0,s.jsx)(n.td,{children:(0,s.jsx)(n.code,{children:"[]"})}),(0,s.jsx)(n.td,{children:"Links in this section."})]})]})]})}),"\n",(0,s.jsxs)(n.p,{children:["Accepted fields of each ",(0,s.jsx)(n.code,{children:"FooterItem"}),":"]}),"\n",(0,s.jsx)(r.Z,{name:"footer-items",children:(0,s.jsxs)(n.table,{children:[(0,s.jsx)(n.thead,{children:(0,s.jsxs)(n.tr,{children:[(0,s.jsx)(n.th,{children:"Name"}),(0,s.jsx)(n.th,{children:"Type"}),(0,s.jsx)(n.th,{children:"Default"}),(0,s.jsx)(n.th,{children:"Description"})]})}),(0,s.jsxs)(n.tbody,{children:[(0,s.jsxs)(n.tr,{children:[(0,s.jsx)(n.td,{children:(0,s.jsx)(n.code,{children:"label"})}),(0,s.jsx)(n.td,{children:(0,s.jsx)(n.code,{children:"string"})}),(0,s.jsx)(n.td,{children:(0,s.jsx)(n.strong,{children:"Required"})}),(0,s.jsx)(n.td,{children:"Text to be displayed for this link."})]}),(0,s.jsxs)(n.tr,{children:[(0,s.jsx)(n.td,{children:(0,s.jsx)(n.code,{children:"to"})}),(0,s.jsx)(n.td,{children:(0,s.jsx)(n.code,{children:"string"})}),(0,s.jsx)(n.td,{children:(0,s.jsx)(n.strong,{children:"Required"})}),(0,s.jsx)(n.td,{children:"Client-side routing, used for navigating within the website. The baseUrl will be automatically prepended to this value."})]}),(0,s.jsxs)(n.tr,{children:[(0,s.jsx)(n.td,{children:(0,s.jsx)(n.code,{children:"href"})}),(0,s.jsx)(n.td,{children:(0,s.jsx)(n.code,{children:"string"})}),(0,s.jsx)(n.td,{children:(0,s.jsx)(n.strong,{children:"Required"})}),(0,s.jsxs)(n.td,{children:["A full-page navigation, used for navigating outside of the website. ",(0,s.jsxs)(n.strong,{children:["Only one of ",(0,s.jsx)(n.code,{children:"to"})," or ",(0,s.jsx)(n.code,{children:"href"})," should be used."]})]})]}),(0,s.jsxs)(n.tr,{children:[(0,s.jsx)(n.td,{children:(0,s.jsx)(n.code,{children:"html"})}),(0,s.jsx)(n.td,{children:(0,s.jsx)(n.code,{children:"string"})}),(0,s.jsx)(n.td,{children:(0,s.jsx)(n.code,{children:"undefined"})}),(0,s.jsxs)(n.td,{children:["Renders the HTML pass-through instead of a simple link. In case ",(0,s.jsx)(n.code,{children:"html"})," is used, no other options should be provided."]})]})]})]})}),"\n",(0,s.jsx)(n.p,{children:"Example multi-column configuration:"}),"\n",(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-js",metastring:'title="docusaurus.config.js"',children:"export default {\n footer: {\n // highlight-start\n links: [\n {\n title: 'Docs',\n items: [\n {\n label: 'Style Guide',\n to: 'docs/',\n },\n {\n label: 'Second Doc',\n to: 'docs/doc2/',\n },\n ],\n },\n {\n title: 'Community',\n items: [\n {\n label: 'Stack Overflow',\n href: 'https://stackoverflow.com/questions/tagged/docusaurus',\n },\n {\n label: 'Discord',\n href: 'https://discordapp.com/invite/docusaurus',\n },\n {\n label: 'X',\n href: 'https://x.com/docusaurus',\n },\n {\n html: `\n \n\n \n `,\n },\n ],\n },\n ],\n // highlight-end\n },\n};\n"})}),"\n",(0,s.jsxs)(n.p,{children:["A simple footer just has a list of ",(0,s.jsx)(n.code,{children:"FooterItem"}),"s displayed in a row."]}),"\n",(0,s.jsx)(n.p,{children:"Example simple configuration:"}),"\n",(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-js",metastring:'title="docusaurus.config.js"',children:'export default {\n footer: {\n // highlight-start\n links: [\n {\n label: \'Stack Overflow\',\n href: \'https://stackoverflow.com/questions/tagged/docusaurus\',\n },\n {\n label: \'Discord\',\n href: \'https://discordapp.com/invite/docusaurus\',\n },\n {\n label: \'X\',\n href: \'https://x.com/docusaurus\',\n },\n {\n html: `\n \n
\n \n `,\n },\n ],\n // highlight-end\n },\n};\n'})}),"\n",(0,s.jsx)(n.h2,{id:"table-of-contents",children:"Table of Contents"}),"\n",(0,s.jsxs)(n.p,{children:["You can adjust the default table of contents via ",(0,s.jsx)(n.code,{children:"themeConfig.tableOfContents"}),"."]}),"\n",(0,s.jsx)(r.Z,{children:(0,s.jsxs)(n.table,{children:[(0,s.jsx)(n.thead,{children:(0,s.jsxs)(n.tr,{children:[(0,s.jsx)(n.th,{children:"Name"}),(0,s.jsx)(n.th,{children:"Type"}),(0,s.jsx)(n.th,{children:"Default"}),(0,s.jsx)(n.th,{children:"Description"})]})}),(0,s.jsxs)(n.tbody,{children:[(0,s.jsxs)(n.tr,{children:[(0,s.jsx)(n.td,{children:(0,s.jsx)(n.code,{children:"minHeadingLevel"})}),(0,s.jsx)(n.td,{children:(0,s.jsx)(n.code,{children:"number"})}),(0,s.jsx)(n.td,{children:(0,s.jsx)(n.code,{children:"2"})}),(0,s.jsx)(n.td,{children:"The minimum heading level shown in the table of contents. Must be between 2 and 6 and lower or equal to the max value."})]}),(0,s.jsxs)(n.tr,{children:[(0,s.jsx)(n.td,{children:(0,s.jsx)(n.code,{children:"maxHeadingLevel"})}),(0,s.jsx)(n.td,{children:(0,s.jsx)(n.code,{children:"number"})}),(0,s.jsx)(n.td,{children:(0,s.jsx)(n.code,{children:"3"})}),(0,s.jsx)(n.td,{children:"Max heading level displayed in the TOC. Should be an integer between 2 and 6."})]})]})]})}),"\n",(0,s.jsx)(n.p,{children:"Example configuration:"}),"\n",(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-js",metastring:'title="docusaurus.config.js"',children:"export default {\n themeConfig: {\n // highlight-start\n tableOfContents: {\n minHeadingLevel: 2,\n maxHeadingLevel: 5,\n },\n // highlight-end\n },\n};\n"})}),"\n",(0,s.jsx)(n.h2,{id:"hooks",children:"Hooks"}),"\n",(0,s.jsx)(n.h3,{id:"use-color-mode",children:(0,s.jsx)(n.code,{children:"useColorMode"})}),"\n",(0,s.jsxs)(n.p,{children:["A React hook to access the color context. This context contains functions for selecting light/dark/system mode and exposes the current color mode and the choice from the user. The color mode values ",(0,s.jsx)(n.strong,{children:"should not be used for dynamic content rendering"})," (see below)."]}),"\n",(0,s.jsx)(n.p,{children:"Usage example:"}),"\n",(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-jsx",children:"// highlight-next-line\nimport {useColorMode} from '@docusaurus/theme-common';\n\nconst MyColorModeButton = () => {\n // highlight-start\n const {\n colorMode, // the \"effective\" color mode, never null\n colorModeChoice, // the color mode chosen by the user, can be null\n setColorMode, // set the color mode chosen by the user\n } = useColorMode();\n // highlight-end\n\n return (\n \n );\n};\n"})}),"\n",(0,s.jsx)(n.p,{children:"Attributes:"}),"\n",(0,s.jsxs)(n.ul,{children:["\n",(0,s.jsxs)(n.li,{children:[(0,s.jsx)(n.code,{children:"colorMode: 'light' | 'dark'"}),": The effective color mode currently applied to the UI. It cannot be ",(0,s.jsx)(n.code,{children:"null"}),"."]}),"\n",(0,s.jsxs)(n.li,{children:[(0,s.jsx)(n.code,{children:"colorModeChoice: 'light' | 'dark' | null"}),": The color mode explicitly chosen by the user. It can be ",(0,s.jsx)(n.code,{children:"null"})," if user has not made any choice yet, or if they reset their choice to the system/default value."]}),"\n",(0,s.jsxs)(n.li,{children:[(0,s.jsx)(n.code,{children:"setColorMode(colorModeChoice: 'light' | 'dark' | null, options: {persist: boolean}): void"}),": A function to call when the user explicitly chose a color mode. ",(0,s.jsx)(n.code,{children:"null"})," permits to reset the choice to the system/default value. By default, the choice is persisted in ",(0,s.jsx)(n.code,{children:"localStorage"})," and restored on page reload, but you can opt out with ",(0,s.jsx)(n.code,{children:"{persist: false}"}),"."]}),"\n"]}),"\n",(0,s.jsxs)(n.admonition,{type:"warning",children:[(0,s.jsxs)(n.p,{children:["Don't use ",(0,s.jsx)(n.code,{children:"colorMode"})," and ",(0,s.jsx)(n.code,{children:"colorModeChoice"})," while rendering React components. Doing so is likely to produce ",(0,s.jsx)(n.a,{href:"https://en.wikipedia.org/wiki/Flash_of_unstyled_content",children:"FOUC"}),", layout shifts and ",(0,s.jsx)(n.a,{href:"https://18.react.dev/reference/react-dom/client/hydrateRoot",children:"React hydration"})," mismatches if you use them to render JSX content dynamically."]}),(0,s.jsxs)(n.p,{children:["However, these values are safe to use ",(0,s.jsx)(n.strong,{children:"after React hydration"}),", in ",(0,s.jsx)(n.code,{children:"useEffect"})," and event listeners, like in the ",(0,s.jsx)(n.code,{children:"MyColorModeButton"})," example above."]}),(0,s.jsxs)(n.p,{children:["If you need to render content dynamically depending on the current theme, the only way to avoid FOUC, layout shifts and hydration mismatch is to rely on CSS selectors to render content dynamically, based on the ",(0,s.jsx)(n.code,{children:"html"})," data attributes that we set before the page displays anything:"]}),(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-html",children:'\n \x3c!-- content --\x3e\n\n'})}),(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-css",children:"[data-theme='light']\n[data-theme='dark']\n\n[data-theme-choice='light']\n[data-theme-choice='dark']\n[data-theme-choice='system']\n"})}),(0,s.jsxs)(d,{children:[(0,s.jsxs)("summary",{children:["Why are ",(0,s.jsx)(n.code,{children:"colorMode"})," and ",(0,s.jsx)(n.code,{children:"colorModeChoice"})," unsafe when rendering?"]}),(0,s.jsxs)(n.p,{children:["To understand the problem, you need to understand how ",(0,s.jsx)(n.a,{href:"https://18.react.dev/reference/react-dom/client/hydrateRoot",children:"React hydration"})," works."]}),(0,s.jsxs)(n.p,{children:["During the static site generation phase, Docusaurus doesn't know what the user color mode choice is, and ",(0,s.jsx)(n.code,{children:"useColorMode()"})," returns the following static values:"]}),(0,s.jsxs)(n.ul,{children:["\n",(0,s.jsx)(n.li,{children:(0,s.jsx)(n.code,{children:"colorMode = themeConfig.colorMode.defaultMode"})}),"\n",(0,s.jsx)(n.li,{children:(0,s.jsx)(n.code,{children:"colorModeChoice = null"})}),"\n"]}),(0,s.jsx)(n.p,{children:"During the very first React client-side render (the hydration), React must produce the exact same HTML markup, and will also use these static values."}),(0,s.jsxs)(n.p,{children:["The correct ",(0,s.jsx)(n.code,{children:"colorMode"})," and ",(0,s.jsx)(n.code,{children:"colorModeChoice"})," values will only be provided in the second React render."]}),(0,s.jsxs)(n.p,{children:["Typically, the following component will lead to ",(0,s.jsx)(n.strong,{children:"React hydration mismatches"}),". The label may switch from ",(0,s.jsx)(n.code,{children:"light"})," to ",(0,s.jsx)(n.code,{children:"dark"})," while React hydrates, leading to a confusing user experience."]}),(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-jsx",children:"import {useColorMode} from '@docusaurus/theme-common';\n\nconst DisplayCurrentColorMode = () => {\n const {colorMode} = useColorMode();\n return {colorMode};\n};\n"})})]})]}),"\n",(0,s.jsxs)(n.admonition,{type:"note",children:[(0,s.jsxs)(n.p,{children:["The component calling ",(0,s.jsx)(n.code,{children:"useColorMode"})," must be a child of the ",(0,s.jsx)(n.code,{children:"Layout"})," component."]}),(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-jsx",children:"function ExamplePage() {\n return (\n
\n \n );\n}\n"})})]}),"\n",(0,s.jsx)(n.h2,{id:"i18n",children:"i18n"}),"\n",(0,s.jsxs)(n.p,{children:["Read the ",(0,s.jsx)(n.a,{href:"/docs/i18n/introduction",children:"i18n introduction"})," first."]}),"\n",(0,s.jsx)(n.h3,{id:"translation-files-location",children:"Translation files location"}),"\n",(0,s.jsxs)(n.ul,{children:["\n",(0,s.jsxs)(n.li,{children:[(0,s.jsx)(n.strong,{children:"Base path"}),": ",(0,s.jsx)(n.code,{children:"website/i18n/[locale]/docusaurus-theme-[themeName]"})]}),"\n",(0,s.jsxs)(n.li,{children:[(0,s.jsx)(n.strong,{children:"Multi-instance path"}),": N/A"]}),"\n",(0,s.jsxs)(n.li,{children:[(0,s.jsx)(n.strong,{children:"JSON files"}),": extracted with ",(0,s.jsx)(n.a,{href:"/docs/cli#docusaurus-write-translations-sitedir",children:(0,s.jsx)(n.code,{children:"docusaurus write-translations"})})]}),"\n",(0,s.jsxs)(n.li,{children:[(0,s.jsx)(n.strong,{children:"Markdown files"}),": N/A"]}),"\n"]}),"\n",(0,s.jsx)(n.h3,{id:"example-file-system-structure",children:"Example file-system structure"}),"\n",(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-bash",children:"website/i18n/[locale]/docusaurus-theme-classic\n\u2502\n\u2502 # translations for the theme\n\u251C\u2500\u2500 navbar.json\n\u2514\u2500\u2500 footer.json\n"})})]})}function x(e={}){let{wrapper:n}={...(0,t.a)(),...e.components};return n?(0,s.jsx)(n,{...e,children:(0,s.jsx)(a,{...e})}):a(e)}},32240:function(e,n,d){d.d(n,{Z:()=>c});var i=d(85893),s=d(67294),t=d(96700),r=d(3620);let l=s.forwardRef(function(e,n){let{name:d,children:l}=e,c=function(e){let n=e;for(;(0,s.isValidElement)(n);)[n]=s.Children.toArray(n.props.children);if("string"!=typeof n)throw Error(`Could not extract APITable row name from JSX tree: +${JSON.stringify(e,null,2)}`);return n}(l),o=d?`${d}-${c}`:c,h=`#${o}`,a=(0,r.k6)();return(0,t.Z)().collectAnchor(o),(0,i.jsx)("tr",{id:o,tabIndex:0,ref:a.location.hash===h?n:void 0,onClick:e=>{let n="TD"===e.target.tagName.toUpperCase(),d=!!window.getSelection()?.toString();n&&!d&&a.push(h)},onKeyDown:e=>{"Enter"===e.key&&a.push(h)},children:l.props.children})});function c(e){let{children:n,name:d}=e;if("table"!==n.type)throw Error("Bad usage of APITable component.\nIt is probably that your Markdown table is malformed.\nMake sure to double-check you have the appropriate number of columns for each table row.");let[t,r]=s.Children.toArray(n.props.children),c=(0,s.useRef)(null);(0,s.useEffect)(()=>{c.current?.focus()},[c]);let o=s.Children.map(r.props.children,e=>(0,i.jsx)(l,{name:d,ref:c,children:e}));return(0,i.jsxs)("table",{className:"apiTable_e8hp",children:[t,(0,i.jsx)("tbody",{children:o})]})}},80980:function(e,n,d){d.d(n,{Z:()=>l,a:()=>r});var i=d(67294);let s={},t=i.createContext(s);function r(e){let n=i.useContext(t);return i.useMemo(function(){return"function"==typeof e?e(n):{...n,...e}},[n,e])}function l(e){let n;return n=e.disableParentContext?"function"==typeof e.components?e.components(s):e.components||s:r(e.components),i.createElement(t.Provider,{value:n},e.children)}}}]); \ No newline at end of file diff --git a/assets/js/03f86864.9ebadbf2.js b/assets/js/03f86864.9ebadbf2.js deleted file mode 100644 index 0c2d4803af..0000000000 --- a/assets/js/03f86864.9ebadbf2.js +++ /dev/null @@ -1,2 +0,0 @@ -"use strict";(self.webpackChunkwebsite=self.webpackChunkwebsite||[]).push([["99131"],{63029:function(e,n,d){d.r(n),d.d(n,{frontMatter:()=>l,default:()=>x,contentTitle:()=>c,assets:()=>o,toc:()=>h,metadata:()=>i});var i=JSON.parse('{"id":"api/themes/theme-configuration","title":"Theme configuration","description":"This configuration applies to all main themes.","source":"@site/docs/api/themes/theme-configuration.mdx","sourceDirName":"api/themes","slug":"/api/themes/configuration","permalink":"/docs/api/themes/configuration","draft":false,"unlisted":false,"editUrl":"https://github.com/facebook/docusaurus/edit/main/website/docs/api/themes/theme-configuration.mdx","tags":[],"version":"current","lastUpdatedBy":"Ben McCann","lastUpdatedAt":1744155424000,"sidebarPosition":1,"frontMatter":{"sidebar_position":1,"sidebar_label":"Configuration","slug":"/api/themes/configuration","toc_max_heading_level":4},"sidebar":"api","previous":{"title":"Themes overview","permalink":"/docs/api/themes"},"next":{"title":"\uD83D\uDCE6 theme-classic","permalink":"/docs/api/themes/@docusaurus/theme-classic"}}'),s=d(85893),t=d(80980),r=d(32240);let l={sidebar_position:1,sidebar_label:"Configuration",slug:"/api/themes/configuration",toc_max_heading_level:4},c="Theme configuration",o={},h=[{value:"Common",id:"common",level:2},{value:"Color mode",id:"color-mode---dark-mode",level:3},{value:"Meta image",id:"meta-image",level:3},{value:"Metadata",id:"metadata",level:3},{value:"Announcement bar",id:"announcement-bar",level:3},{value:"Plugins",id:"plugins",level:2},{value:"Docs",id:"docs",level:3},{value:"Blog",id:"blog",level:3},{value:"Navbar",id:"navbar",level:2},{value:"Navbar logo",id:"navbar-logo",level:3},{value:"Navbar items",id:"navbar-items",level:3},{value:"Navbar link",id:"navbar-link",level:4},{value:"Navbar dropdown",id:"navbar-dropdown",level:4},{value:"Navbar doc link",id:"navbar-doc-link",level:4},{value:"Navbar linked to a sidebar",id:"navbar-doc-sidebar",level:4},{value:"Navbar docs version dropdown",id:"navbar-docs-version-dropdown",level:4},{value:"Navbar docs version",id:"navbar-docs-version",level:4},{value:"Navbar locale dropdown",id:"navbar-locale-dropdown",level:4},{value:"Navbar search",id:"navbar-search",level:4},{value:"Navbar with custom HTML",id:"navbar-with-custom-html",level:4},{value:"Auto-hide sticky navbar",id:"auto-hide-sticky-navbar",level:3},{value:"Navbar style",id:"navbar-style",level:3},{value:"CodeBlock",id:"codeblock",level:2},{value:"Theme",id:"theme",level:3},{value:"Default language",id:"default-language",level:3},{value:"Footer",id:"footer-1",level:2},{value:"Footer Links",id:"footer-links",level:3},{value:"Table of Contents",id:"table-of-contents",level:2},{value:"Hooks",id:"hooks",level:2},{value:"\n useColorMode
",id:"use-color-mode",level:3},{value:"i18n",id:"i18n",level:2},{value:"Translation files location",id:"translation-files-location",level:3},{value:"Example file-system structure",id:"example-file-system-structure",level:3}];function a(e){let n={a:"a",admonition:"admonition",code:"code",em:"em",h1:"h1",h2:"h2",h3:"h3",h4:"h4",header:"header",li:"li",p:"p",pre:"pre",strong:"strong",table:"table",tbody:"tbody",td:"td",th:"th",thead:"thead",tr:"tr",ul:"ul",...(0,t.a)(),...e.components},{Details:d}=n;return d||function(e,n){throw Error("Expected "+(n?"component":"object")+" `"+e+"` to be defined: you likely forgot to import, pass, or provide it.")}("Details",!0),(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(n.header,{children:(0,s.jsx)(n.h1,{id:"theme-configuration",children:"Theme configuration"})}),"\n","\n",(0,s.jsxs)(n.p,{children:["This configuration applies to all ",(0,s.jsx)(n.a,{href:"/docs/api/themes",children:"main themes"}),"."]}),"\n",(0,s.jsx)(n.h2,{id:"common",children:"Common"}),"\n",(0,s.jsx)(n.h3,{id:"color-mode---dark-mode",children:"Color mode"}),"\n",(0,s.jsx)(n.p,{children:"The classic theme provides by default light and dark mode support, with a navbar switch for the user."}),"\n",(0,s.jsxs)(n.p,{children:["It is possible to customize the color mode support within the ",(0,s.jsx)(n.code,{children:"colorMode"})," object."]}),"\n",(0,s.jsx)(n.p,{children:"Accepted fields:"}),"\n",(0,s.jsx)(r.Z,{children:(0,s.jsxs)(n.table,{children:[(0,s.jsx)(n.thead,{children:(0,s.jsxs)(n.tr,{children:[(0,s.jsx)(n.th,{children:"Name"}),(0,s.jsx)(n.th,{children:"Type"}),(0,s.jsx)(n.th,{children:"Default"}),(0,s.jsx)(n.th,{children:"Description"})]})}),(0,s.jsxs)(n.tbody,{children:[(0,s.jsxs)(n.tr,{children:[(0,s.jsx)(n.td,{children:(0,s.jsx)(n.code,{children:"defaultMode"})}),(0,s.jsx)(n.td,{children:(0,s.jsx)("code",{children:"'light' | 'dark'"})}),(0,s.jsx)(n.td,{children:(0,s.jsx)(n.code,{children:"'light'"})}),(0,s.jsx)(n.td,{children:"The color mode when user first visits the site."})]}),(0,s.jsxs)(n.tr,{children:[(0,s.jsx)(n.td,{children:(0,s.jsx)(n.code,{children:"disableSwitch"})}),(0,s.jsx)(n.td,{children:(0,s.jsx)(n.code,{children:"boolean"})}),(0,s.jsx)(n.td,{children:(0,s.jsx)(n.code,{children:"false"})}),(0,s.jsx)(n.td,{children:"Hides the switch in the navbar. Useful if you want to support a single color mode."})]}),(0,s.jsxs)(n.tr,{children:[(0,s.jsx)(n.td,{children:(0,s.jsx)(n.code,{children:"respectPrefersColorScheme"})}),(0,s.jsx)(n.td,{children:(0,s.jsx)(n.code,{children:"boolean"})}),(0,s.jsx)(n.td,{children:(0,s.jsx)(n.code,{children:"false"})}),(0,s.jsxs)(n.td,{children:["Whether to use the ",(0,s.jsx)(n.code,{children:"prefers-color-scheme"})," media-query, using user system preferences, instead of the hardcoded ",(0,s.jsx)(n.code,{children:"defaultMode"}),"."]})]})]})]})}),"\n",(0,s.jsx)(n.p,{children:"Example configuration:"}),"\n",(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-js",metastring:'title="docusaurus.config.js"',children:"export default {\n themeConfig: {\n // highlight-start\n colorMode: {\n defaultMode: 'light',\n disableSwitch: false,\n respectPrefersColorScheme: false,\n },\n // highlight-end\n },\n};\n"})}),"\n",(0,s.jsxs)(n.admonition,{type:"warning",children:[(0,s.jsxs)(n.p,{children:["With ",(0,s.jsx)(n.code,{children:"respectPrefersColorScheme: true"}),", the ",(0,s.jsx)(n.code,{children:"defaultMode"})," is overridden by user system preferences."]}),(0,s.jsx)(n.p,{children:"If you only want to support one color mode, you likely want to ignore user system preferences."})]}),"\n",(0,s.jsx)(n.h3,{id:"meta-image",children:"Meta image"}),"\n",(0,s.jsxs)(n.p,{children:["You can configure a default image that will be used for your meta tag, in particular ",(0,s.jsx)(n.code,{children:"og:image"})," and ",(0,s.jsx)(n.code,{children:"twitter:image"}),"."]}),"\n",(0,s.jsx)(n.p,{children:"Accepted fields:"}),"\n",(0,s.jsx)(r.Z,{children:(0,s.jsxs)(n.table,{children:[(0,s.jsx)(n.thead,{children:(0,s.jsxs)(n.tr,{children:[(0,s.jsx)(n.th,{children:"Name"}),(0,s.jsx)(n.th,{children:"Type"}),(0,s.jsx)(n.th,{children:"Default"}),(0,s.jsx)(n.th,{children:"Description"})]})}),(0,s.jsx)(n.tbody,{children:(0,s.jsxs)(n.tr,{children:[(0,s.jsx)(n.td,{children:(0,s.jsx)(n.code,{children:"image"})}),(0,s.jsx)(n.td,{children:(0,s.jsx)(n.code,{children:"string"})}),(0,s.jsx)(n.td,{children:(0,s.jsx)(n.code,{children:"undefined"})}),(0,s.jsx)(n.td,{children:'The meta image URL for the site. Relative to your site\'s "static" directory. Cannot be SVGs. Can be external URLs too.'})]})})]})}),"\n",(0,s.jsx)(n.p,{children:"Example configuration:"}),"\n",(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-js",metastring:'title="docusaurus.config.js"',children:"export default {\n themeConfig: {\n // highlight-next-line\n image: 'img/docusaurus.png',\n },\n};\n"})}),"\n",(0,s.jsx)(n.h3,{id:"metadata",children:"Metadata"}),"\n",(0,s.jsx)(n.p,{children:"You can configure additional HTML metadata (and override existing ones)."}),"\n",(0,s.jsx)(n.p,{children:"Accepted fields:"}),"\n",(0,s.jsx)(r.Z,{children:(0,s.jsxs)(n.table,{children:[(0,s.jsx)(n.thead,{children:(0,s.jsxs)(n.tr,{children:[(0,s.jsx)(n.th,{children:"Name"}),(0,s.jsx)(n.th,{children:"Type"}),(0,s.jsx)(n.th,{children:"Default"}),(0,s.jsx)(n.th,{children:"Description"})]})}),(0,s.jsx)(n.tbody,{children:(0,s.jsxs)(n.tr,{children:[(0,s.jsx)(n.td,{children:(0,s.jsx)(n.code,{children:"metadata"})}),(0,s.jsx)(n.td,{children:(0,s.jsx)(n.code,{children:"Metadata[]"})}),(0,s.jsx)(n.td,{children:(0,s.jsx)(n.code,{children:"[]"})}),(0,s.jsxs)(n.td,{children:["Any field will be directly passed to the ",(0,s.jsx)(n.code,{children:""})," tag. Possible fields include ",(0,s.jsx)(n.code,{children:"id"}),", ",(0,s.jsx)(n.code,{children:"name"}),", ",(0,s.jsx)(n.code,{children:"property"}),", ",(0,s.jsx)(n.code,{children:"content"}),", ",(0,s.jsx)(n.code,{children:"itemprop"}),", etc."]})]})})]})}),"\n",(0,s.jsx)(n.p,{children:"Example configuration:"}),"\n",(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-js",metastring:'title="docusaurus.config.js"',children:"export default {\n themeConfig: {\n // highlight-next-line\n metadata: [{name: 'twitter:card', content: 'summary'}],\n },\n};\n"})}),"\n",(0,s.jsx)(n.h3,{id:"announcement-bar",children:"Announcement bar"}),"\n",(0,s.jsxs)(n.p,{children:["Sometimes you want to announce something in your website. Just for such a case, you can add an announcement bar. This is a non-fixed and optionally dismissible panel above the navbar. All configuration are in the ",(0,s.jsx)(n.code,{children:"announcementBar"})," object."]}),"\n",(0,s.jsx)(n.p,{children:"Accepted fields:"}),"\n",(0,s.jsx)(r.Z,{name:"announcement-bar",children:(0,s.jsxs)(n.table,{children:[(0,s.jsx)(n.thead,{children:(0,s.jsxs)(n.tr,{children:[(0,s.jsx)(n.th,{children:"Name"}),(0,s.jsx)(n.th,{children:"Type"}),(0,s.jsx)(n.th,{children:"Default"}),(0,s.jsx)(n.th,{children:"Description"})]})}),(0,s.jsxs)(n.tbody,{children:[(0,s.jsxs)(n.tr,{children:[(0,s.jsx)(n.td,{children:(0,s.jsx)(n.code,{children:"id"})}),(0,s.jsx)(n.td,{children:(0,s.jsx)(n.code,{children:"string"})}),(0,s.jsx)(n.td,{children:(0,s.jsx)(n.code,{children:"'announcement-bar'"})}),(0,s.jsx)(n.td,{children:"Any value that will identify this message."})]}),(0,s.jsxs)(n.tr,{children:[(0,s.jsx)(n.td,{children:(0,s.jsx)(n.code,{children:"content"})}),(0,s.jsx)(n.td,{children:(0,s.jsx)(n.code,{children:"string"})}),(0,s.jsx)(n.td,{children:(0,s.jsx)(n.code,{children:"''"})}),(0,s.jsx)(n.td,{children:"The text content of the announcement. HTML will be interpolated."})]}),(0,s.jsxs)(n.tr,{children:[(0,s.jsx)(n.td,{children:(0,s.jsx)(n.code,{children:"backgroundColor"})}),(0,s.jsx)(n.td,{children:(0,s.jsx)(n.code,{children:"string"})}),(0,s.jsx)(n.td,{children:(0,s.jsx)(n.code,{children:"'#fff'"})}),(0,s.jsx)(n.td,{children:"Background color of the entire bar."})]}),(0,s.jsxs)(n.tr,{children:[(0,s.jsx)(n.td,{children:(0,s.jsx)(n.code,{children:"textColor"})}),(0,s.jsx)(n.td,{children:(0,s.jsx)(n.code,{children:"string"})}),(0,s.jsx)(n.td,{children:(0,s.jsx)(n.code,{children:"'#000'"})}),(0,s.jsx)(n.td,{children:"Announcement text color."})]}),(0,s.jsxs)(n.tr,{children:[(0,s.jsx)(n.td,{children:(0,s.jsx)(n.code,{children:"isCloseable"})}),(0,s.jsx)(n.td,{children:(0,s.jsx)(n.code,{children:"boolean"})}),(0,s.jsx)(n.td,{children:(0,s.jsx)(n.code,{children:"true"})}),(0,s.jsx)(n.td,{children:"Whether this announcement can be dismissed with a '\xd7' button."})]})]})]})}),"\n",(0,s.jsx)(n.p,{children:"Example configuration:"}),"\n",(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-js",metastring:'title="docusaurus.config.js"',children:"export default {\n themeConfig: {\n // highlight-start\n announcementBar: {\n id: 'support_us',\n content:\n 'We are looking to revamp our docs, please fill this survey',\n backgroundColor: '#fafbfc',\n textColor: '#091E42',\n isCloseable: false,\n },\n // highlight-end\n },\n};\n"})}),"\n",(0,s.jsx)(n.h2,{id:"plugins",children:"Plugins"}),"\n",(0,s.jsxs)(n.p,{children:["Our ",(0,s.jsx)(n.a,{href:"/docs/api/themes",children:"main themes"})," offer additional theme configuration options for Docusaurus core content plugins."]}),"\n",(0,s.jsx)(n.h3,{id:"docs",children:"Docs"}),"\n",(0,s.jsx)(r.Z,{name:"navbar-overview",children:(0,s.jsxs)(n.table,{children:[(0,s.jsx)(n.thead,{children:(0,s.jsxs)(n.tr,{children:[(0,s.jsx)(n.th,{children:"Name"}),(0,s.jsx)(n.th,{children:"Type"}),(0,s.jsx)(n.th,{children:"Default"}),(0,s.jsx)(n.th,{children:"Description"})]})}),(0,s.jsxs)(n.tbody,{children:[(0,s.jsxs)(n.tr,{children:[(0,s.jsx)(n.td,{children:(0,s.jsx)(n.code,{children:"versionPersistence"})}),(0,s.jsx)(n.td,{children:(0,s.jsx)(n.code,{children:"'localStorage' | 'none'"})}),(0,s.jsx)(n.td,{children:(0,s.jsx)(n.code,{children:"undefined"})}),(0,s.jsx)(n.td,{children:"Defines the browser persistence of the preferred docs version."})]}),(0,s.jsxs)(n.tr,{children:[(0,s.jsx)(n.td,{children:(0,s.jsx)(n.code,{children:"sidebar.hideable"})}),(0,s.jsx)(n.td,{children:(0,s.jsx)(n.code,{children:"boolean"})}),(0,s.jsx)(n.td,{children:(0,s.jsx)(n.code,{children:"false"})}),(0,s.jsx)(n.td,{children:"Show a hide button at the bottom of the sidebar."})]}),(0,s.jsxs)(n.tr,{children:[(0,s.jsx)(n.td,{children:(0,s.jsx)(n.code,{children:"sidebar.autoCollapseCategories"})}),(0,s.jsx)(n.td,{children:(0,s.jsx)(n.code,{children:"boolean"})}),(0,s.jsx)(n.td,{children:(0,s.jsx)(n.code,{children:"false"})}),(0,s.jsx)(n.td,{children:"Automatically collapse all sibling categories of the one you navigate to."})]})]})]})}),"\n",(0,s.jsx)(n.p,{children:"Example configuration:"}),"\n",(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-js",metastring:'title="docusaurus.config.js"',children:"export default {\n themeConfig: {\n docs: {\n // highlight-start\n versionPersistence: 'localStorage',\n sidebar: {\n hideable: false,\n autoCollapseCategories: false,\n },\n // highlight-end\n },\n },\n};\n"})}),"\n",(0,s.jsx)(n.h3,{id:"blog",children:"Blog"}),"\n",(0,s.jsx)(r.Z,{name:"navbar-overview",children:(0,s.jsxs)(n.table,{children:[(0,s.jsx)(n.thead,{children:(0,s.jsxs)(n.tr,{children:[(0,s.jsx)(n.th,{children:"Name"}),(0,s.jsx)(n.th,{children:"Type"}),(0,s.jsx)(n.th,{children:"Default"}),(0,s.jsx)(n.th,{children:"Description"})]})}),(0,s.jsx)(n.tbody,{children:(0,s.jsxs)(n.tr,{children:[(0,s.jsx)(n.td,{children:(0,s.jsx)(n.code,{children:"sidebar.groupByYear"})}),(0,s.jsx)(n.td,{children:(0,s.jsx)(n.code,{children:"boolean"})}),(0,s.jsx)(n.td,{children:(0,s.jsx)(n.code,{children:"true"})}),(0,s.jsx)(n.td,{children:"Group sidebar blog posts by years."})]})})]})}),"\n",(0,s.jsx)(n.p,{children:"Example configuration:"}),"\n",(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-js",metastring:'title="docusaurus.config.js"',children:"export default {\n themeConfig: {\n blog: {\n // highlight-start\n sidebar: {\n groupByYear: true,\n },\n // highlight-end\n },\n },\n};\n"})}),"\n",(0,s.jsx)(n.h2,{id:"navbar",children:"Navbar"}),"\n",(0,s.jsx)(n.p,{children:"Accepted fields:"}),"\n",(0,s.jsx)(r.Z,{name:"navbar-overview",children:(0,s.jsxs)(n.table,{children:[(0,s.jsx)(n.thead,{children:(0,s.jsxs)(n.tr,{children:[(0,s.jsx)(n.th,{children:"Name"}),(0,s.jsx)(n.th,{children:"Type"}),(0,s.jsx)(n.th,{children:"Default"}),(0,s.jsx)(n.th,{children:"Description"})]})}),(0,s.jsxs)(n.tbody,{children:[(0,s.jsxs)(n.tr,{children:[(0,s.jsx)(n.td,{children:(0,s.jsx)(n.code,{children:"title"})}),(0,s.jsx)(n.td,{children:(0,s.jsx)(n.code,{children:"string"})}),(0,s.jsx)(n.td,{children:(0,s.jsx)(n.code,{children:"undefined"})}),(0,s.jsx)(n.td,{children:"Title for the navbar."})]}),(0,s.jsxs)(n.tr,{children:[(0,s.jsx)(n.td,{children:(0,s.jsx)(n.code,{children:"logo"})}),(0,s.jsx)(n.td,{children:(0,s.jsx)(n.em,{children:"See below"})}),(0,s.jsx)(n.td,{children:(0,s.jsx)(n.code,{children:"undefined"})}),(0,s.jsx)(n.td,{children:"Customization of the logo object."})]}),(0,s.jsxs)(n.tr,{children:[(0,s.jsx)(n.td,{children:(0,s.jsx)(n.code,{children:"items"})}),(0,s.jsx)(n.td,{children:(0,s.jsx)(n.code,{children:"NavbarItem[]"})}),(0,s.jsx)(n.td,{children:(0,s.jsx)(n.code,{children:"[]"})}),(0,s.jsx)(n.td,{children:"A list of navbar items. See specification below."})]}),(0,s.jsxs)(n.tr,{children:[(0,s.jsx)(n.td,{children:(0,s.jsx)(n.code,{children:"hideOnScroll"})}),(0,s.jsx)(n.td,{children:(0,s.jsx)(n.code,{children:"boolean"})}),(0,s.jsx)(n.td,{children:(0,s.jsx)(n.code,{children:"false"})}),(0,s.jsx)(n.td,{children:"Whether the navbar is hidden when the user scrolls down."})]}),(0,s.jsxs)(n.tr,{children:[(0,s.jsx)(n.td,{children:(0,s.jsx)(n.code,{children:"style"})}),(0,s.jsx)(n.td,{children:(0,s.jsx)("code",{children:"'primary' | 'dark'"})}),(0,s.jsx)(n.td,{children:"Same as theme"}),(0,s.jsx)(n.td,{children:"Sets the navbar style, ignoring the dark/light theme."})]})]})]})}),"\n",(0,s.jsx)(n.h3,{id:"navbar-logo",children:"Navbar logo"}),"\n",(0,s.jsxs)(n.p,{children:["The logo can be placed in ",(0,s.jsx)(n.a,{href:"/docs/static-assets",children:"static folder"}),". Logo URL is set to base URL of your site by default. Although you can specify your own URL for the logo, if it is an external link, it will open in a new tab. In addition, you can override a value for the target attribute of logo link, it can come in handy if you are hosting docs website in a subdirectory of your main website, and in which case you probably do not need a link in the logo to the main website will open in a new tab."]}),"\n",(0,s.jsx)(n.p,{children:"To improve dark mode support, you can also set a different logo for this mode."}),"\n",(0,s.jsx)(n.p,{children:"Accepted fields:"}),"\n",(0,s.jsx)(r.Z,{name:"navbar-logo",children:(0,s.jsxs)(n.table,{children:[(0,s.jsx)(n.thead,{children:(0,s.jsxs)(n.tr,{children:[(0,s.jsx)(n.th,{children:"Name"}),(0,s.jsx)(n.th,{children:"Type"}),(0,s.jsx)(n.th,{children:"Default"}),(0,s.jsx)(n.th,{children:"Description"})]})}),(0,s.jsxs)(n.tbody,{children:[(0,s.jsxs)(n.tr,{children:[(0,s.jsx)(n.td,{children:(0,s.jsx)(n.code,{children:"alt"})}),(0,s.jsx)(n.td,{children:(0,s.jsx)(n.code,{children:"string"})}),(0,s.jsx)(n.td,{children:(0,s.jsx)(n.code,{children:"undefined"})}),(0,s.jsx)(n.td,{children:"Alt tag for the logo image."})]}),(0,s.jsxs)(n.tr,{children:[(0,s.jsx)(n.td,{children:(0,s.jsx)(n.code,{children:"src"})}),(0,s.jsx)(n.td,{children:(0,s.jsx)(n.code,{children:"string"})}),(0,s.jsx)(n.td,{children:(0,s.jsx)(n.strong,{children:"Required"})}),(0,s.jsx)(n.td,{children:"URL to the logo image. Base URL is appended by default."})]}),(0,s.jsxs)(n.tr,{children:[(0,s.jsx)(n.td,{children:(0,s.jsx)(n.code,{children:"srcDark"})}),(0,s.jsx)(n.td,{children:(0,s.jsx)(n.code,{children:"string"})}),(0,s.jsx)(n.td,{children:(0,s.jsx)(n.code,{children:"logo.src"})}),(0,s.jsx)(n.td,{children:"An alternative image URL to use in dark mode."})]}),(0,s.jsxs)(n.tr,{children:[(0,s.jsx)(n.td,{children:(0,s.jsx)(n.code,{children:"href"})}),(0,s.jsx)(n.td,{children:(0,s.jsx)(n.code,{children:"string"})}),(0,s.jsx)(n.td,{children:(0,s.jsx)(n.code,{children:"siteConfig.baseUrl"})}),(0,s.jsx)(n.td,{children:"Link to navigate to when the logo is clicked."})]}),(0,s.jsxs)(n.tr,{children:[(0,s.jsx)(n.td,{children:(0,s.jsx)(n.code,{children:"width"})}),(0,s.jsx)(n.td,{children:(0,s.jsx)("code",{children:"string | number"})}),(0,s.jsx)(n.td,{children:(0,s.jsx)(n.code,{children:"undefined"})}),(0,s.jsxs)(n.td,{children:["Specifies the ",(0,s.jsx)(n.code,{children:"width"})," attribute."]})]}),(0,s.jsxs)(n.tr,{children:[(0,s.jsx)(n.td,{children:(0,s.jsx)(n.code,{children:"height"})}),(0,s.jsx)(n.td,{children:(0,s.jsx)("code",{children:"string | number"})}),(0,s.jsx)(n.td,{children:(0,s.jsx)(n.code,{children:"undefined"})}),(0,s.jsxs)(n.td,{children:["Specifies the ",(0,s.jsx)(n.code,{children:"height"})," attribute."]})]}),(0,s.jsxs)(n.tr,{children:[(0,s.jsx)(n.td,{children:(0,s.jsx)(n.code,{children:"target"})}),(0,s.jsx)(n.td,{children:(0,s.jsx)(n.code,{children:"string"})}),(0,s.jsxs)(n.td,{children:["Calculated based on ",(0,s.jsx)(n.code,{children:"href"})," (external links will open in a new tab, all others in the current one)."]}),(0,s.jsxs)(n.td,{children:["The ",(0,s.jsx)(n.code,{children:"target"})," attribute of the link; controls whether the link is opened in a new tab, the current one, or otherwise."]})]}),(0,s.jsxs)(n.tr,{children:[(0,s.jsx)(n.td,{children:(0,s.jsx)(n.code,{children:"className"})}),(0,s.jsx)(n.td,{children:(0,s.jsx)(n.code,{children:"string"})}),(0,s.jsx)(n.td,{children:(0,s.jsx)(n.code,{children:"undefined"})}),(0,s.jsx)(n.td,{children:"CSS class applied to the image."})]}),(0,s.jsxs)(n.tr,{children:[(0,s.jsx)(n.td,{children:(0,s.jsx)(n.code,{children:"style"})}),(0,s.jsx)(n.td,{children:(0,s.jsx)(n.code,{children:"object"})}),(0,s.jsx)(n.td,{children:(0,s.jsx)(n.code,{children:"undefined"})}),(0,s.jsx)(n.td,{children:"CSS inline style object. React/JSX flavor, using camelCase properties."})]})]})]})}),"\n",(0,s.jsx)(n.p,{children:"Example configuration:"}),"\n",(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-js",metastring:'title="docusaurus.config.js"',children:"export default {\n themeConfig: {\n navbar: {\n title: 'Site Title',\n // highlight-start\n logo: {\n alt: 'Site Logo',\n src: 'img/logo.svg',\n srcDark: 'img/logo_dark.svg',\n href: 'https://docusaurus.io/',\n target: '_self',\n width: 32,\n height: 32,\n className: 'custom-navbar-logo-class',\n style: {border: 'solid red'},\n },\n // highlight-end\n },\n },\n};\n"})}),"\n",(0,s.jsx)(n.h3,{id:"navbar-items",children:"Navbar items"}),"\n",(0,s.jsxs)(n.p,{children:["You can add items to the navbar via ",(0,s.jsx)(n.code,{children:"themeConfig.navbar.items"}),"."]}),"\n",(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-js",metastring:'title="docusaurus.config.js"',children:"export default {\n themeConfig: {\n navbar: {\n // highlight-start\n items: [\n {\n type: 'doc',\n position: 'left',\n docId: 'introduction',\n label: 'Docs',\n },\n {to: 'blog', label: 'Blog', position: 'left'},\n {\n type: 'docsVersionDropdown',\n position: 'right',\n },\n {\n type: 'localeDropdown',\n position: 'right',\n },\n {\n href: 'https://github.com/facebook/docusaurus',\n position: 'right',\n className: 'header-github-link',\n 'aria-label': 'GitHub repository',\n },\n ],\n // highlight-end\n },\n },\n};\n"})}),"\n",(0,s.jsxs)(n.p,{children:["The items can have different behaviors based on the ",(0,s.jsx)(n.code,{children:"type"})," field. The sections below will introduce you to all the types of navbar items available."]}),"\n",(0,s.jsx)(n.h4,{id:"navbar-link",children:"Navbar link"}),"\n",(0,s.jsx)(n.p,{children:"By default, Navbar items are regular links (internal or external)."}),"\n",(0,s.jsxs)(n.p,{children:["React Router should automatically apply active link styling to links, but you can use ",(0,s.jsx)(n.code,{children:"activeBasePath"})," in edge cases. For cases in which a link should be active on several different paths (such as when you have multiple doc folders under the same sidebar), you can use ",(0,s.jsx)(n.code,{children:"activeBaseRegex"}),". ",(0,s.jsx)(n.code,{children:"activeBaseRegex"})," is a more flexible alternative to ",(0,s.jsx)(n.code,{children:"activeBasePath"})," and takes precedence over it -- Docusaurus parses it into a regular expression that is tested against the current URL."]}),"\n",(0,s.jsxs)(n.p,{children:["Outbound (external) links automatically get ",(0,s.jsx)(n.code,{children:'target="_blank" rel="noopener noreferrer"'})," attributes."]}),"\n",(0,s.jsx)(n.p,{children:"Accepted fields:"}),"\n",(0,s.jsx)(r.Z,{name:"navbar-link",children:(0,s.jsxs)(n.table,{children:[(0,s.jsx)(n.thead,{children:(0,s.jsxs)(n.tr,{children:[(0,s.jsx)(n.th,{children:"Name"}),(0,s.jsx)(n.th,{children:"Type"}),(0,s.jsx)(n.th,{children:"Default"}),(0,s.jsx)(n.th,{children:"Description"})]})}),(0,s.jsxs)(n.tbody,{children:[(0,s.jsxs)(n.tr,{children:[(0,s.jsx)(n.td,{children:(0,s.jsx)(n.code,{children:"type"})}),(0,s.jsx)(n.td,{children:(0,s.jsx)(n.code,{children:"'default'"})}),(0,s.jsx)(n.td,{children:"Optional"}),(0,s.jsx)(n.td,{children:"Sets the type of this item to a link."})]}),(0,s.jsxs)(n.tr,{children:[(0,s.jsx)(n.td,{children:(0,s.jsx)(n.code,{children:"label"})}),(0,s.jsx)(n.td,{children:(0,s.jsx)(n.code,{children:"string"})}),(0,s.jsx)(n.td,{children:(0,s.jsx)(n.strong,{children:"Required"})}),(0,s.jsx)(n.td,{children:"The name to be shown for this item."})]}),(0,s.jsxs)(n.tr,{children:[(0,s.jsx)(n.td,{children:(0,s.jsx)(n.code,{children:"html"})}),(0,s.jsx)(n.td,{children:(0,s.jsx)(n.code,{children:"string"})}),(0,s.jsx)(n.td,{children:"Optional"}),(0,s.jsxs)(n.td,{children:["Same as ",(0,s.jsx)(n.code,{children:"label"}),", but renders pure HTML instead of text content."]})]}),(0,s.jsxs)(n.tr,{children:[(0,s.jsx)(n.td,{children:(0,s.jsx)(n.code,{children:"to"})}),(0,s.jsx)(n.td,{children:(0,s.jsx)(n.code,{children:"string"})}),(0,s.jsx)(n.td,{children:(0,s.jsx)(n.strong,{children:"Required"})}),(0,s.jsx)(n.td,{children:"Client-side routing, used for navigating within the website. The baseUrl will be automatically prepended to this value."})]}),(0,s.jsxs)(n.tr,{children:[(0,s.jsx)(n.td,{children:(0,s.jsx)(n.code,{children:"href"})}),(0,s.jsx)(n.td,{children:(0,s.jsx)(n.code,{children:"string"})}),(0,s.jsx)(n.td,{children:(0,s.jsx)(n.strong,{children:"Required"})}),(0,s.jsxs)(n.td,{children:["A full-page navigation, used for navigating outside of the website. ",(0,s.jsxs)(n.strong,{children:["Only one of ",(0,s.jsx)(n.code,{children:"to"})," or ",(0,s.jsx)(n.code,{children:"href"})," should be used."]})]})]}),(0,s.jsxs)(n.tr,{children:[(0,s.jsx)(n.td,{children:(0,s.jsx)(n.code,{children:"prependBaseUrlToHref"})}),(0,s.jsx)(n.td,{children:(0,s.jsx)(n.code,{children:"boolean"})}),(0,s.jsx)(n.td,{children:(0,s.jsx)(n.code,{children:"false"})}),(0,s.jsxs)(n.td,{children:["Prepends the baseUrl to ",(0,s.jsx)(n.code,{children:"href"})," values."]})]}),(0,s.jsxs)(n.tr,{children:[(0,s.jsx)(n.td,{children:(0,s.jsx)(n.code,{children:"position"})}),(0,s.jsx)(n.td,{children:(0,s.jsx)("code",{children:"'left' | 'right'"})}),(0,s.jsx)(n.td,{children:(0,s.jsx)(n.code,{children:"'left'"})}),(0,s.jsx)(n.td,{children:"The side of the navbar this item should appear on."})]}),(0,s.jsxs)(n.tr,{children:[(0,s.jsx)(n.td,{children:(0,s.jsx)(n.code,{children:"activeBasePath"})}),(0,s.jsx)(n.td,{children:(0,s.jsx)(n.code,{children:"string"})}),(0,s.jsxs)(n.td,{children:[(0,s.jsx)(n.code,{children:"to"})," / ",(0,s.jsx)(n.code,{children:"href"})]}),(0,s.jsx)(n.td,{children:"To apply the active class styling on all routes starting with this path. This usually isn't necessary."})]}),(0,s.jsxs)(n.tr,{children:[(0,s.jsx)(n.td,{children:(0,s.jsx)(n.code,{children:"activeBaseRegex"})}),(0,s.jsx)(n.td,{children:(0,s.jsx)(n.code,{children:"string"})}),(0,s.jsx)(n.td,{children:(0,s.jsx)(n.code,{children:"undefined"})}),(0,s.jsxs)(n.td,{children:["Alternative to ",(0,s.jsx)(n.code,{children:"activeBasePath"})," if required."]})]}),(0,s.jsxs)(n.tr,{children:[(0,s.jsx)(n.td,{children:(0,s.jsx)(n.code,{children:"className"})}),(0,s.jsx)(n.td,{children:(0,s.jsx)(n.code,{children:"string"})}),(0,s.jsx)(n.td,{children:(0,s.jsx)(n.code,{children:"''"})}),(0,s.jsx)(n.td,{children:"Custom CSS class (for styling any item)."})]})]})]})}),"\n",(0,s.jsx)(n.admonition,{type:"note",children:(0,s.jsx)(n.p,{children:"In addition to the fields above, you can specify other arbitrary attributes that can be applied to a HTML link."})}),"\n",(0,s.jsx)(n.p,{children:"Example configuration:"}),"\n",(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-js",metastring:'title="docusaurus.config.js"',children:"export default {\n themeConfig: {\n navbar: {\n items: [\n // highlight-start\n {\n to: 'docs/introduction',\n // Only one of \"to\" or \"href\" should be used\n // href: 'https://www.facebook.com',\n label: 'Introduction',\n // Only one of \"label\" or \"html\" should be used\n // html: 'Introduction'\n position: 'left',\n activeBaseRegex: 'docs/(next|v8)',\n target: '_blank',\n },\n // highlight-end\n ],\n },\n },\n};\n"})}),"\n",(0,s.jsx)(n.h4,{id:"navbar-dropdown",children:"Navbar dropdown"}),"\n",(0,s.jsxs)(n.p,{children:["Navbar items of the type ",(0,s.jsx)(n.code,{children:"dropdown"})," has the additional ",(0,s.jsx)(n.code,{children:"items"})," field, an inner array of navbar items."]}),"\n",(0,s.jsxs)(n.p,{children:["Navbar dropdown items only accept the following ",(0,s.jsx)(n.strong,{children:'"link-like" item types'}),":"]}),"\n",(0,s.jsxs)(n.ul,{children:["\n",(0,s.jsx)(n.li,{children:(0,s.jsx)(n.a,{href:"#navbar-link",children:"Navbar link"})}),"\n",(0,s.jsx)(n.li,{children:(0,s.jsx)(n.a,{href:"#navbar-doc-link",children:"Navbar doc link"})}),"\n",(0,s.jsx)(n.li,{children:(0,s.jsx)(n.a,{href:"#navbar-docs-version",children:"Navbar docs version"})}),"\n",(0,s.jsx)(n.li,{children:(0,s.jsx)(n.a,{href:"#navbar-doc-sidebar",children:"Navbar doc sidebar"})}),"\n",(0,s.jsx)(n.li,{children:(0,s.jsx)(n.a,{href:"#navbar-with-custom-html",children:"Navbar with custom HTML"})}),"\n"]}),"\n",(0,s.jsxs)(n.p,{children:["Note that the dropdown base item is a clickable link as well, so this item can receive any of the props of a ",(0,s.jsx)(n.a,{href:"#navbar-link",children:"plain navbar link"}),"."]}),"\n",(0,s.jsx)(n.p,{children:"Accepted fields:"}),"\n",(0,s.jsx)(r.Z,{name:"navbar-dropdown",children:(0,s.jsxs)(n.table,{children:[(0,s.jsx)(n.thead,{children:(0,s.jsxs)(n.tr,{children:[(0,s.jsx)(n.th,{children:"Name"}),(0,s.jsx)(n.th,{children:"Type"}),(0,s.jsx)(n.th,{children:"Default"}),(0,s.jsx)(n.th,{children:"Description"})]})}),(0,s.jsxs)(n.tbody,{children:[(0,s.jsxs)(n.tr,{children:[(0,s.jsx)(n.td,{children:(0,s.jsx)(n.code,{children:"type"})}),(0,s.jsx)(n.td,{children:(0,s.jsx)(n.code,{children:"'dropdown'"})}),(0,s.jsx)(n.td,{children:"Optional"}),(0,s.jsx)(n.td,{children:"Sets the type of this item to a dropdown."})]}),(0,s.jsxs)(n.tr,{children:[(0,s.jsx)(n.td,{children:(0,s.jsx)(n.code,{children:"label"})}),(0,s.jsx)(n.td,{children:(0,s.jsx)(n.code,{children:"string"})}),(0,s.jsx)(n.td,{children:(0,s.jsx)(n.strong,{children:"Required"})}),(0,s.jsx)(n.td,{children:"The name to be shown for this item."})]}),(0,s.jsxs)(n.tr,{children:[(0,s.jsx)(n.td,{children:(0,s.jsx)(n.code,{children:"items"})}),(0,s.jsx)(n.td,{children:(0,s.jsxs)("code",{children:[(0,s.jsx)(n.a,{href:"#navbar-dropdown",children:"LinkLikeItem"}),"[]"]})}),(0,s.jsx)(n.td,{children:(0,s.jsx)(n.strong,{children:"Required"})}),(0,s.jsx)(n.td,{children:"The items to be contained in the dropdown."})]}),(0,s.jsxs)(n.tr,{children:[(0,s.jsx)(n.td,{children:(0,s.jsx)(n.code,{children:"position"})}),(0,s.jsx)(n.td,{children:(0,s.jsx)("code",{children:"'left' | 'right'"})}),(0,s.jsx)(n.td,{children:(0,s.jsx)(n.code,{children:"'left'"})}),(0,s.jsx)(n.td,{children:"The side of the navbar this item should appear on."})]})]})]})}),"\n",(0,s.jsx)(n.p,{children:"Example configuration:"}),"\n",(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-js",metastring:'title="docusaurus.config.js"',children:"export default {\n themeConfig: {\n navbar: {\n items: [\n // highlight-start\n {\n type: 'dropdown',\n label: 'Community',\n position: 'left',\n items: [\n {\n label: 'Facebook',\n href: 'https://www.facebook.com',\n },\n {\n type: 'doc',\n label: 'Social',\n docId: 'social',\n },\n // ... more items\n ],\n },\n // highlight-end\n ],\n },\n },\n};\n"})}),"\n",(0,s.jsx)(n.h4,{id:"navbar-doc-link",children:"Navbar doc link"}),"\n",(0,s.jsxs)(n.p,{children:["If you want to link to a specific doc, this special navbar item type will render the link to the doc of the provided ",(0,s.jsx)(n.code,{children:"docId"}),". It will get the class ",(0,s.jsx)(n.code,{children:"navbar__link--active"})," as long as you browse a doc of the same sidebar."]}),"\n",(0,s.jsx)(n.p,{children:"Accepted fields:"}),"\n",(0,s.jsx)(r.Z,{name:"navbar-doc-link",children:(0,s.jsxs)(n.table,{children:[(0,s.jsx)(n.thead,{children:(0,s.jsxs)(n.tr,{children:[(0,s.jsx)(n.th,{children:"Name"}),(0,s.jsx)(n.th,{children:"Type"}),(0,s.jsx)(n.th,{children:"Default"}),(0,s.jsx)(n.th,{children:"Description"})]})}),(0,s.jsxs)(n.tbody,{children:[(0,s.jsxs)(n.tr,{children:[(0,s.jsx)(n.td,{children:(0,s.jsx)(n.code,{children:"type"})}),(0,s.jsx)(n.td,{children:(0,s.jsx)(n.code,{children:"'doc'"})}),(0,s.jsx)(n.td,{children:(0,s.jsx)(n.strong,{children:"Required"})}),(0,s.jsx)(n.td,{children:"Sets the type of this item to a doc link."})]}),(0,s.jsxs)(n.tr,{children:[(0,s.jsx)(n.td,{children:(0,s.jsx)(n.code,{children:"docId"})}),(0,s.jsx)(n.td,{children:(0,s.jsx)(n.code,{children:"string"})}),(0,s.jsx)(n.td,{children:(0,s.jsx)(n.strong,{children:"Required"})}),(0,s.jsx)(n.td,{children:"The ID of the doc that this item links to."})]}),(0,s.jsxs)(n.tr,{children:[(0,s.jsx)(n.td,{children:(0,s.jsx)(n.code,{children:"label"})}),(0,s.jsx)(n.td,{children:(0,s.jsx)(n.code,{children:"string"})}),(0,s.jsx)(n.td,{children:(0,s.jsx)(n.code,{children:"docId"})}),(0,s.jsx)(n.td,{children:"The name to be shown for this item."})]}),(0,s.jsxs)(n.tr,{children:[(0,s.jsx)(n.td,{children:(0,s.jsx)(n.code,{children:"position"})}),(0,s.jsx)(n.td,{children:(0,s.jsx)("code",{children:"'left' | 'right'"})}),(0,s.jsx)(n.td,{children:(0,s.jsx)(n.code,{children:"'left'"})}),(0,s.jsx)(n.td,{children:"The side of the navbar this item should appear on."})]}),(0,s.jsxs)(n.tr,{children:[(0,s.jsx)(n.td,{children:(0,s.jsx)(n.code,{children:"docsPluginId"})}),(0,s.jsx)(n.td,{children:(0,s.jsx)(n.code,{children:"string"})}),(0,s.jsx)(n.td,{children:(0,s.jsx)(n.code,{children:"'default'"})}),(0,s.jsx)(n.td,{children:"The ID of the docs plugin that the doc belongs to."})]})]})]})}),"\n",(0,s.jsx)(n.p,{children:"Example configuration:"}),"\n",(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-js",metastring:'title="docusaurus.config.js"',children:"export default {\n themeConfig: {\n navbar: {\n items: [\n // highlight-start\n {\n type: 'doc',\n position: 'left',\n docId: 'introduction',\n label: 'Docs',\n },\n // highlight-end\n ],\n },\n },\n};\n"})}),"\n",(0,s.jsx)(n.h4,{id:"navbar-doc-sidebar",children:"Navbar linked to a sidebar"}),"\n",(0,s.jsx)(n.p,{children:"You can link a navbar item to the first document link (which can be a doc link or a generated category index) of a given sidebar without having to hardcode a doc ID."}),"\n",(0,s.jsx)(n.p,{children:"Accepted fields:"}),"\n",(0,s.jsx)(r.Z,{name:"navbar-doc-sidebar",children:(0,s.jsxs)(n.table,{children:[(0,s.jsx)(n.thead,{children:(0,s.jsxs)(n.tr,{children:[(0,s.jsx)(n.th,{children:"Name"}),(0,s.jsx)(n.th,{children:"Type"}),(0,s.jsx)(n.th,{children:"Default"}),(0,s.jsx)(n.th,{children:"Description"})]})}),(0,s.jsxs)(n.tbody,{children:[(0,s.jsxs)(n.tr,{children:[(0,s.jsx)(n.td,{children:(0,s.jsx)(n.code,{children:"type"})}),(0,s.jsx)(n.td,{children:(0,s.jsx)(n.code,{children:"'docSidebar'"})}),(0,s.jsx)(n.td,{children:(0,s.jsx)(n.strong,{children:"Required"})}),(0,s.jsx)(n.td,{children:"Sets the type of this navbar item to a sidebar's first document."})]}),(0,s.jsxs)(n.tr,{children:[(0,s.jsx)(n.td,{children:(0,s.jsx)(n.code,{children:"sidebarId"})}),(0,s.jsx)(n.td,{children:(0,s.jsx)(n.code,{children:"string"})}),(0,s.jsx)(n.td,{children:(0,s.jsx)(n.strong,{children:"Required"})}),(0,s.jsx)(n.td,{children:"The ID of the sidebar that this item is linked to."})]}),(0,s.jsxs)(n.tr,{children:[(0,s.jsx)(n.td,{children:(0,s.jsx)(n.code,{children:"label"})}),(0,s.jsx)(n.td,{children:(0,s.jsx)(n.code,{children:"string"})}),(0,s.jsx)(n.td,{children:"First document link's sidebar label"}),(0,s.jsx)(n.td,{children:"The name to be shown for this item."})]}),(0,s.jsxs)(n.tr,{children:[(0,s.jsx)(n.td,{children:(0,s.jsx)(n.code,{children:"position"})}),(0,s.jsx)(n.td,{children:(0,s.jsx)("code",{children:"'left' | 'right'"})}),(0,s.jsx)(n.td,{children:(0,s.jsx)(n.code,{children:"'left'"})}),(0,s.jsx)(n.td,{children:"The side of the navbar this item should appear on."})]}),(0,s.jsxs)(n.tr,{children:[(0,s.jsx)(n.td,{children:(0,s.jsx)(n.code,{children:"docsPluginId"})}),(0,s.jsx)(n.td,{children:(0,s.jsx)(n.code,{children:"string"})}),(0,s.jsx)(n.td,{children:(0,s.jsx)(n.code,{children:"'default'"})}),(0,s.jsx)(n.td,{children:"The ID of the docs plugin that the sidebar belongs to."})]})]})]})}),"\n",(0,s.jsx)(n.admonition,{type:"tip",children:(0,s.jsx)(n.p,{children:"Use this navbar item type if your sidebar is updated often and the order is not stable."})}),"\n",(0,s.jsx)(n.p,{children:"Example configuration:"}),"\n",(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-js",metastring:'title="docusaurus.config.js"',children:"export default {\n themeConfig: {\n navbar: {\n items: [\n // highlight-start\n {\n type: 'docSidebar',\n position: 'left',\n sidebarId: 'api',\n label: 'API',\n },\n // highlight-end\n ],\n },\n },\n};\n"})}),"\n",(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-js",metastring:'title="sidebars.js"',children:"export default {\n tutorial: [\n {\n type: 'autogenerated',\n dirName: 'guides',\n },\n ],\n api: [\n // highlight-next-line\n 'cli', // The navbar item will be linking to this doc\n 'docusaurus-core',\n {\n type: 'autogenerated',\n dirName: 'api',\n },\n ],\n};\n"})}),"\n",(0,s.jsx)(n.h4,{id:"navbar-docs-version-dropdown",children:"Navbar docs version dropdown"}),"\n",(0,s.jsx)(n.p,{children:"If you use docs with versioning, this special navbar item type that will render a dropdown with all your site's available versions."}),"\n",(0,s.jsx)(n.p,{children:"The user will be able to switch from one version to another, while staying on the same doc (as long as the doc ID is constant across versions)."}),"\n",(0,s.jsx)(n.p,{children:"Accepted fields:"}),"\n",(0,s.jsx)(r.Z,{name:"navbar-docs-version-dropdown",children:(0,s.jsxs)(n.table,{children:[(0,s.jsx)(n.thead,{children:(0,s.jsxs)(n.tr,{children:[(0,s.jsx)(n.th,{children:"Name"}),(0,s.jsx)(n.th,{children:"Type"}),(0,s.jsx)(n.th,{children:"Default"}),(0,s.jsx)(n.th,{children:"Description"})]})}),(0,s.jsxs)(n.tbody,{children:[(0,s.jsxs)(n.tr,{children:[(0,s.jsx)(n.td,{children:(0,s.jsx)(n.code,{children:"type"})}),(0,s.jsx)(n.td,{children:(0,s.jsx)(n.code,{children:"'docsVersionDropdown'"})}),(0,s.jsx)(n.td,{children:(0,s.jsx)(n.strong,{children:"Required"})}),(0,s.jsx)(n.td,{children:"Sets the type of this item to a docs version dropdown."})]}),(0,s.jsxs)(n.tr,{children:[(0,s.jsx)(n.td,{children:(0,s.jsx)(n.code,{children:"position"})}),(0,s.jsx)(n.td,{children:(0,s.jsx)("code",{children:"'left' | 'right'"})}),(0,s.jsx)(n.td,{children:(0,s.jsx)(n.code,{children:"'left'"})}),(0,s.jsx)(n.td,{children:"The side of the navbar this item should appear on."})]}),(0,s.jsxs)(n.tr,{children:[(0,s.jsx)(n.td,{children:(0,s.jsx)(n.code,{children:"dropdownItemsBefore"})}),(0,s.jsx)(n.td,{children:(0,s.jsxs)("code",{children:[(0,s.jsx)(n.a,{href:"#navbar-dropdown",children:"LinkLikeItem"}),"[]"]})}),(0,s.jsx)(n.td,{children:(0,s.jsx)(n.code,{children:"[]"})}),(0,s.jsx)(n.td,{children:"Add additional dropdown items at the beginning of the dropdown."})]}),(0,s.jsxs)(n.tr,{children:[(0,s.jsx)(n.td,{children:(0,s.jsx)(n.code,{children:"dropdownItemsAfter"})}),(0,s.jsx)(n.td,{children:(0,s.jsxs)("code",{children:[(0,s.jsx)(n.a,{href:"#navbar-dropdown",children:"LinkLikeItem"}),"[]"]})}),(0,s.jsx)(n.td,{children:(0,s.jsx)(n.code,{children:"[]"})}),(0,s.jsx)(n.td,{children:"Add additional dropdown items at the end of the dropdown."})]}),(0,s.jsxs)(n.tr,{children:[(0,s.jsx)(n.td,{children:(0,s.jsx)(n.code,{children:"docsPluginId"})}),(0,s.jsx)(n.td,{children:(0,s.jsx)(n.code,{children:"string"})}),(0,s.jsx)(n.td,{children:(0,s.jsx)(n.code,{children:"'default'"})}),(0,s.jsx)(n.td,{children:"The ID of the docs plugin that the doc versioning belongs to."})]}),(0,s.jsxs)(n.tr,{children:[(0,s.jsx)(n.td,{children:(0,s.jsx)(n.code,{children:"dropdownActiveClassDisabled"})}),(0,s.jsx)(n.td,{children:(0,s.jsx)(n.code,{children:"boolean"})}),(0,s.jsx)(n.td,{children:(0,s.jsx)(n.code,{children:"false"})}),(0,s.jsx)(n.td,{children:"Do not add the link active class when browsing docs."})]}),(0,s.jsxs)(n.tr,{children:[(0,s.jsx)(n.td,{children:(0,s.jsx)(n.code,{children:"versions"})}),(0,s.jsx)(n.td,{children:(0,s.jsx)(n.code,{children:"DropdownVersions"})}),(0,s.jsx)(n.td,{children:(0,s.jsx)(n.code,{children:"undefined"})}),(0,s.jsxs)(n.td,{children:["Specify a custom list of versions to include in the dropdown. See ",(0,s.jsx)(n.a,{href:"/docs/versioning#docsVersionDropdown",children:"the versioning guide"})," for details."]})]})]})]})}),"\n",(0,s.jsx)(n.p,{children:"Types:"}),"\n",(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-ts",children:"type DropdownVersion = {\n /** Allows you to provide a custom display label for each version. */\n label?: string;\n};\n\ntype DropdownVersions = string[] | {[versionName: string]: DropdownVersion};\n"})}),"\n",(0,s.jsx)(n.p,{children:"Example configuration:"}),"\n",(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-js",metastring:'title="docusaurus.config.js"',children:"export default {\n themeConfig: {\n navbar: {\n items: [\n // highlight-start\n {\n type: 'docsVersionDropdown',\n position: 'left',\n dropdownItemsAfter: [{to: '/versions', label: 'All versions'}],\n dropdownActiveClassDisabled: true,\n },\n // highlight-end\n ],\n },\n },\n};\n"})}),"\n",(0,s.jsx)(n.h4,{id:"navbar-docs-version",children:"Navbar docs version"}),"\n",(0,s.jsx)(n.p,{children:"If you use docs with versioning, this special navbar item type will link to the active/browsed version of your doc (depends on the current URL), and fallback to the latest version."}),"\n",(0,s.jsx)(n.p,{children:"Accepted fields:"}),"\n",(0,s.jsx)(r.Z,{name:"navbar-docs-version",children:(0,s.jsxs)(n.table,{children:[(0,s.jsx)(n.thead,{children:(0,s.jsxs)(n.tr,{children:[(0,s.jsx)(n.th,{children:"Name"}),(0,s.jsx)(n.th,{children:"Type"}),(0,s.jsx)(n.th,{children:"Default"}),(0,s.jsx)(n.th,{children:"Description"})]})}),(0,s.jsxs)(n.tbody,{children:[(0,s.jsxs)(n.tr,{children:[(0,s.jsx)(n.td,{children:(0,s.jsx)(n.code,{children:"type"})}),(0,s.jsx)(n.td,{children:(0,s.jsx)(n.code,{children:"'docsVersion'"})}),(0,s.jsx)(n.td,{children:(0,s.jsx)(n.strong,{children:"Required"})}),(0,s.jsx)(n.td,{children:"Sets the type of this item to a doc version link."})]}),(0,s.jsxs)(n.tr,{children:[(0,s.jsx)(n.td,{children:(0,s.jsx)(n.code,{children:"label"})}),(0,s.jsx)(n.td,{children:(0,s.jsx)(n.code,{children:"string"})}),(0,s.jsx)(n.td,{children:"The active/latest version label."}),(0,s.jsx)(n.td,{children:"The name to be shown for this item."})]}),(0,s.jsxs)(n.tr,{children:[(0,s.jsx)(n.td,{children:(0,s.jsx)(n.code,{children:"to"})}),(0,s.jsx)(n.td,{children:(0,s.jsx)(n.code,{children:"string"})}),(0,s.jsx)(n.td,{children:"The active/latest version."}),(0,s.jsx)(n.td,{children:"The internal link that this item points to."})]}),(0,s.jsxs)(n.tr,{children:[(0,s.jsx)(n.td,{children:(0,s.jsx)(n.code,{children:"position"})}),(0,s.jsx)(n.td,{children:(0,s.jsx)("code",{children:"'left' | 'right'"})}),(0,s.jsx)(n.td,{children:(0,s.jsx)(n.code,{children:"'left'"})}),(0,s.jsx)(n.td,{children:"The side of the navbar this item should appear on."})]}),(0,s.jsxs)(n.tr,{children:[(0,s.jsx)(n.td,{children:(0,s.jsx)(n.code,{children:"docsPluginId"})}),(0,s.jsx)(n.td,{children:(0,s.jsx)(n.code,{children:"string"})}),(0,s.jsx)(n.td,{children:(0,s.jsx)(n.code,{children:"'default'"})}),(0,s.jsx)(n.td,{children:"The ID of the docs plugin that the doc versioning belongs to."})]})]})]})}),"\n",(0,s.jsx)(n.p,{children:"Example configuration:"}),"\n",(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-js",metastring:'title="docusaurus.config.js"',children:"export default {\n themeConfig: {\n navbar: {\n items: [\n // highlight-start\n {\n type: 'docsVersion',\n position: 'left',\n to: '/path',\n label: 'label',\n },\n // highlight-end\n ],\n },\n },\n};\n"})}),"\n",(0,s.jsx)(n.h4,{id:"navbar-locale-dropdown",children:"Navbar locale dropdown"}),"\n",(0,s.jsxs)(n.p,{children:["If you use the ",(0,s.jsx)(n.a,{href:"/docs/i18n/introduction",children:"i18n feature"}),", this special navbar item type will render a dropdown with all your site's available locales."]}),"\n",(0,s.jsx)(n.p,{children:"The user will be able to switch from one locale to another, while staying on the same page."}),"\n",(0,s.jsx)(n.p,{children:"Accepted fields:"}),"\n",(0,s.jsx)(r.Z,{name:"navbar-locale-dropdown",children:(0,s.jsxs)(n.table,{children:[(0,s.jsx)(n.thead,{children:(0,s.jsxs)(n.tr,{children:[(0,s.jsx)(n.th,{children:"Name"}),(0,s.jsx)(n.th,{children:"Type"}),(0,s.jsx)(n.th,{children:"Default"}),(0,s.jsx)(n.th,{children:"Description"})]})}),(0,s.jsxs)(n.tbody,{children:[(0,s.jsxs)(n.tr,{children:[(0,s.jsx)(n.td,{children:(0,s.jsx)(n.code,{children:"type"})}),(0,s.jsx)(n.td,{children:(0,s.jsx)(n.code,{children:"'localeDropdown'"})}),(0,s.jsx)(n.td,{children:(0,s.jsx)(n.strong,{children:"Required"})}),(0,s.jsx)(n.td,{children:"Sets the type of this item to a locale dropdown."})]}),(0,s.jsxs)(n.tr,{children:[(0,s.jsx)(n.td,{children:(0,s.jsx)(n.code,{children:"position"})}),(0,s.jsx)(n.td,{children:(0,s.jsx)("code",{children:"'left' | 'right'"})}),(0,s.jsx)(n.td,{children:(0,s.jsx)(n.code,{children:"'left'"})}),(0,s.jsx)(n.td,{children:"The side of the navbar this item should appear on."})]}),(0,s.jsxs)(n.tr,{children:[(0,s.jsx)(n.td,{children:(0,s.jsx)(n.code,{children:"dropdownItemsBefore"})}),(0,s.jsx)(n.td,{children:(0,s.jsxs)("code",{children:[(0,s.jsx)(n.a,{href:"#navbar-dropdown",children:"LinkLikeItem"}),"[]"]})}),(0,s.jsx)(n.td,{children:(0,s.jsx)(n.code,{children:"[]"})}),(0,s.jsx)(n.td,{children:"Add additional dropdown items at the beginning of the dropdown."})]}),(0,s.jsxs)(n.tr,{children:[(0,s.jsx)(n.td,{children:(0,s.jsx)(n.code,{children:"dropdownItemsAfter"})}),(0,s.jsx)(n.td,{children:(0,s.jsxs)("code",{children:[(0,s.jsx)(n.a,{href:"#navbar-dropdown",children:"LinkLikeItem"}),"[]"]})}),(0,s.jsx)(n.td,{children:(0,s.jsx)(n.code,{children:"[]"})}),(0,s.jsx)(n.td,{children:"Add additional dropdown items at the end of the dropdown."})]}),(0,s.jsxs)(n.tr,{children:[(0,s.jsx)(n.td,{children:(0,s.jsx)(n.code,{children:"queryString"})}),(0,s.jsx)(n.td,{children:(0,s.jsx)(n.code,{children:"string"})}),(0,s.jsx)(n.td,{children:(0,s.jsx)(n.code,{children:"undefined"})}),(0,s.jsx)(n.td,{children:"The query string to be appended to the URL."})]})]})]})}),"\n",(0,s.jsx)(n.p,{children:"Example configuration:"}),"\n",(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-js",metastring:'title="docusaurus.config.js"',children:"export default {\n themeConfig: {\n navbar: {\n items: [\n // highlight-start\n {\n type: 'localeDropdown',\n position: 'left',\n dropdownItemsAfter: [\n {\n to: 'https://my-site.com/help-us-translate',\n label: 'Help us translate',\n },\n ],\n },\n // highlight-end\n ],\n },\n },\n};\n"})}),"\n",(0,s.jsx)(n.h4,{id:"navbar-search",children:"Navbar search"}),"\n",(0,s.jsxs)(n.p,{children:["If you use the ",(0,s.jsx)(n.a,{href:"/docs/search",children:"search"}),", the search bar will be the rightmost element in the navbar."]}),"\n",(0,s.jsx)(n.p,{children:"However, with this special navbar item type, you can change the default location."}),"\n",(0,s.jsx)(r.Z,{name:"navbar-search",children:(0,s.jsxs)(n.table,{children:[(0,s.jsx)(n.thead,{children:(0,s.jsxs)(n.tr,{children:[(0,s.jsx)(n.th,{children:"Name"}),(0,s.jsx)(n.th,{children:"Type"}),(0,s.jsx)(n.th,{children:"Default"}),(0,s.jsx)(n.th,{children:"Description"})]})}),(0,s.jsxs)(n.tbody,{children:[(0,s.jsxs)(n.tr,{children:[(0,s.jsx)(n.td,{children:(0,s.jsx)(n.code,{children:"type"})}),(0,s.jsx)(n.td,{children:(0,s.jsx)(n.code,{children:"'search'"})}),(0,s.jsx)(n.td,{children:(0,s.jsx)(n.strong,{children:"Required"})}),(0,s.jsx)(n.td,{children:"Sets the type of this item to a search bar."})]}),(0,s.jsxs)(n.tr,{children:[(0,s.jsx)(n.td,{children:(0,s.jsx)(n.code,{children:"position"})}),(0,s.jsx)(n.td,{children:(0,s.jsx)("code",{children:"'left' | 'right'"})}),(0,s.jsx)(n.td,{children:(0,s.jsx)(n.code,{children:"'left'"})}),(0,s.jsx)(n.td,{children:"The side of the navbar this item should appear on."})]}),(0,s.jsxs)(n.tr,{children:[(0,s.jsx)(n.td,{children:(0,s.jsx)(n.code,{children:"className"})}),(0,s.jsx)(n.td,{children:(0,s.jsx)(n.code,{children:"string"})}),(0,s.jsx)(n.td,{children:"/"}),(0,s.jsx)(n.td,{children:"Custom CSS class for this navbar item."})]})]})]})}),"\n",(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-js",metastring:'title="docusaurus.config.js"',children:"export default {\n themeConfig: {\n navbar: {\n items: [\n // highlight-start\n {\n type: 'search',\n position: 'right',\n },\n // highlight-end\n ],\n },\n },\n};\n"})}),"\n",(0,s.jsx)(n.h4,{id:"navbar-with-custom-html",children:"Navbar with custom HTML"}),"\n",(0,s.jsx)(n.p,{children:"You can also render your own HTML markup inside a navbar item using this navbar item type."}),"\n",(0,s.jsx)(r.Z,{name:"navbar-html",children:(0,s.jsxs)(n.table,{children:[(0,s.jsx)(n.thead,{children:(0,s.jsxs)(n.tr,{children:[(0,s.jsx)(n.th,{children:"Name"}),(0,s.jsx)(n.th,{children:"Type"}),(0,s.jsx)(n.th,{children:"Default"}),(0,s.jsx)(n.th,{children:"Description"})]})}),(0,s.jsxs)(n.tbody,{children:[(0,s.jsxs)(n.tr,{children:[(0,s.jsx)(n.td,{children:(0,s.jsx)(n.code,{children:"type"})}),(0,s.jsx)(n.td,{children:(0,s.jsx)(n.code,{children:"'html'"})}),(0,s.jsx)(n.td,{children:(0,s.jsx)(n.strong,{children:"Required"})}),(0,s.jsx)(n.td,{children:"Sets the type of this item to a HTML element."})]}),(0,s.jsxs)(n.tr,{children:[(0,s.jsx)(n.td,{children:(0,s.jsx)(n.code,{children:"position"})}),(0,s.jsx)(n.td,{children:(0,s.jsx)("code",{children:"'left' | 'right'"})}),(0,s.jsx)(n.td,{children:(0,s.jsx)(n.code,{children:"'left'"})}),(0,s.jsx)(n.td,{children:"The side of the navbar this item should appear on."})]}),(0,s.jsxs)(n.tr,{children:[(0,s.jsx)(n.td,{children:(0,s.jsx)(n.code,{children:"className"})}),(0,s.jsx)(n.td,{children:(0,s.jsx)(n.code,{children:"string"})}),(0,s.jsx)(n.td,{children:(0,s.jsx)(n.code,{children:"''"})}),(0,s.jsx)(n.td,{children:"Custom CSS class for this navbar item."})]}),(0,s.jsxs)(n.tr,{children:[(0,s.jsx)(n.td,{children:(0,s.jsx)(n.code,{children:"value"})}),(0,s.jsx)(n.td,{children:(0,s.jsx)(n.code,{children:"string"})}),(0,s.jsx)(n.td,{children:(0,s.jsx)(n.code,{children:"''"})}),(0,s.jsx)(n.td,{children:"Custom HTML to be rendered inside this navbar item."})]})]})]})}),"\n",(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-js",metastring:'title="docusaurus.config.js"',children:"export default {\n themeConfig: {\n navbar: {\n items: [\n // highlight-start\n {\n type: 'html',\n position: 'right',\n value: '',\n },\n // highlight-end\n ],\n },\n },\n};\n"})}),"\n",(0,s.jsx)(n.h3,{id:"auto-hide-sticky-navbar",children:"Auto-hide sticky navbar"}),"\n",(0,s.jsx)(n.p,{children:"You can enable this cool UI feature that automatically hides the navbar when a user starts scrolling down the page, and show it again when the user scrolls up."}),"\n",(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-js",metastring:'title="docusaurus.config.js"',children:"export default {\n themeConfig: {\n navbar: {\n // highlight-next-line\n hideOnScroll: true,\n },\n },\n};\n"})}),"\n",(0,s.jsx)(n.h3,{id:"navbar-style",children:"Navbar style"}),"\n",(0,s.jsx)(n.p,{children:"You can set the static Navbar style without disabling the theme switching ability. The selected style will always apply no matter which theme user have selected."}),"\n",(0,s.jsxs)(n.p,{children:["Currently, there are two possible style options: ",(0,s.jsx)(n.code,{children:"dark"})," and ",(0,s.jsx)(n.code,{children:"primary"})," (based on the ",(0,s.jsx)(n.code,{children:"--ifm-color-primary"})," color). You can see the styles preview in the ",(0,s.jsx)(n.a,{href:"https://infima.dev/docs/components/navbar/",children:"Infima documentation"}),"."]}),"\n",(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-js",metastring:'title="docusaurus.config.js"',children:"export default {\n themeConfig: {\n navbar: {\n // highlight-next-line\n style: 'primary',\n },\n },\n};\n"})}),"\n",(0,s.jsx)(n.h2,{id:"codeblock",children:"CodeBlock"}),"\n",(0,s.jsxs)(n.p,{children:["Docusaurus uses ",(0,s.jsx)(n.a,{href:"https://github.com/FormidableLabs/prism-react-renderer",children:"Prism React Renderer"})," to highlight code blocks. All configuration are in the ",(0,s.jsx)(n.code,{children:"prism"})," object."]}),"\n",(0,s.jsx)(n.p,{children:"Accepted fields:"}),"\n",(0,s.jsx)(r.Z,{name:"codeblock",children:(0,s.jsxs)(n.table,{children:[(0,s.jsx)(n.thead,{children:(0,s.jsxs)(n.tr,{children:[(0,s.jsx)(n.th,{children:"Name"}),(0,s.jsx)(n.th,{children:"Type"}),(0,s.jsx)(n.th,{children:"Default"}),(0,s.jsx)(n.th,{children:"Description"})]})}),(0,s.jsxs)(n.tbody,{children:[(0,s.jsxs)(n.tr,{children:[(0,s.jsx)(n.td,{children:(0,s.jsx)(n.code,{children:"theme"})}),(0,s.jsx)(n.td,{children:(0,s.jsx)(n.code,{children:"PrismTheme"})}),(0,s.jsx)(n.td,{children:(0,s.jsx)(n.code,{children:"palenight"})}),(0,s.jsx)(n.td,{children:"The Prism theme to use for light-theme code blocks."})]}),(0,s.jsxs)(n.tr,{children:[(0,s.jsx)(n.td,{children:(0,s.jsx)(n.code,{children:"darkTheme"})}),(0,s.jsx)(n.td,{children:(0,s.jsx)(n.code,{children:"PrismTheme"})}),(0,s.jsx)(n.td,{children:(0,s.jsx)(n.code,{children:"palenight"})}),(0,s.jsx)(n.td,{children:"The Prism theme to use for dark-theme code blocks."})]}),(0,s.jsxs)(n.tr,{children:[(0,s.jsx)(n.td,{children:(0,s.jsx)(n.code,{children:"defaultLanguage"})}),(0,s.jsx)(n.td,{children:(0,s.jsx)(n.code,{children:"string"})}),(0,s.jsx)(n.td,{children:(0,s.jsx)(n.code,{children:"undefined"})}),(0,s.jsx)(n.td,{children:"The default language to use for code blocks not declaring any explicit language."})]}),(0,s.jsxs)(n.tr,{children:[(0,s.jsx)(n.td,{children:(0,s.jsx)(n.code,{children:"magicComments"})}),(0,s.jsx)(n.td,{children:(0,s.jsx)(n.code,{children:"MagicCommentConfig[]"})}),(0,s.jsx)(n.td,{children:(0,s.jsx)(n.em,{children:"see below"})}),(0,s.jsxs)(n.td,{children:["The list of ",(0,s.jsx)(n.a,{href:"/docs/markdown-features/code-blocks#custom-magic-comments",children:"magic comments"}),"."]})]})]})]})}),"\n",(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-ts",children:"type MagicCommentConfig = {\n className: string;\n line?: string;\n block?: {start: string; end: string};\n};\n"})}),"\n",(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-js",children:"const defaultMagicComments = [\n {\n className: 'theme-code-block-highlighted-line',\n line: 'highlight-next-line',\n block: {start: 'highlight-start', end: 'highlight-end'},\n },\n];\n"})}),"\n",(0,s.jsx)(n.h3,{id:"theme",children:"Theme"}),"\n",(0,s.jsxs)(n.p,{children:["By default, we use ",(0,s.jsx)(n.a,{href:"https://github.com/FormidableLabs/prism-react-renderer/blob/master/packages/prism-react-renderer/src/themes/palenight.ts",children:"Palenight"})," as syntax highlighting theme. You can specify a custom theme from the ",(0,s.jsx)(n.a,{href:"https://github.com/FormidableLabs/prism-react-renderer/tree/master/packages/prism-react-renderer/src/themes",children:"list of available themes"}),". You may also use a different syntax highlighting theme when the site is in dark mode."]}),"\n",(0,s.jsx)(n.p,{children:"Example configuration:"}),"\n",(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-js",metastring:'title="docusaurus.config.js"',children:"import {themes as prismThemes} from 'prism-react-renderer';\n\nexport default {\n themeConfig: {\n prism: {\n // highlight-start\n theme: prismThemes.github,\n darkTheme: prismThemes.dracula,\n // highlight-end\n },\n },\n};\n"})}),"\n",(0,s.jsx)(n.admonition,{type:"note",children:(0,s.jsxs)(n.p,{children:["If you use the line highlighting Markdown syntax, you might need to specify a different highlight background color for the dark mode syntax highlighting theme. Refer to the ",(0,s.jsx)(n.a,{href:"/docs/markdown-features/code-blocks#line-highlighting",children:"docs for guidance"}),"."]})}),"\n",(0,s.jsx)(n.h3,{id:"default-language",children:"Default language"}),"\n",(0,s.jsxs)(n.p,{children:["You can set a default language for code blocks if no language is added after the opening triple backticks (i.e. ```). Note that a valid ",(0,s.jsx)(n.a,{href:"https://prismjs.com/#supported-languages",children:"language name"})," must be passed."]}),"\n",(0,s.jsx)(n.p,{children:"Example configuration:"}),"\n",(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-js",metastring:'title="docusaurus.config.js"',children:"export default {\n themeConfig: {\n prism: {\n // highlight-next-line\n defaultLanguage: 'javascript',\n },\n },\n};\n"})}),"\n",(0,s.jsx)(n.h2,{id:"footer-1",children:"Footer"}),"\n",(0,s.jsxs)(n.p,{children:["You can add logo and a copyright to the footer via ",(0,s.jsx)(n.code,{children:"themeConfig.footer"}),". Logo can be placed in ",(0,s.jsx)(n.a,{href:"/docs/static-assets",children:"static folder"}),". Logo URL works in the same way of the navbar logo."]}),"\n",(0,s.jsx)(n.p,{children:"Accepted fields:"}),"\n",(0,s.jsx)(r.Z,{name:"footer",children:(0,s.jsxs)(n.table,{children:[(0,s.jsx)(n.thead,{children:(0,s.jsxs)(n.tr,{children:[(0,s.jsx)(n.th,{children:"Name"}),(0,s.jsx)(n.th,{children:"Type"}),(0,s.jsx)(n.th,{children:"Default"}),(0,s.jsx)(n.th,{children:"Description"})]})}),(0,s.jsxs)(n.tbody,{children:[(0,s.jsxs)(n.tr,{children:[(0,s.jsx)(n.td,{children:(0,s.jsx)(n.code,{children:"logo"})}),(0,s.jsx)(n.td,{children:(0,s.jsx)(n.code,{children:"Logo"})}),(0,s.jsx)(n.td,{children:(0,s.jsx)(n.code,{children:"undefined"})}),(0,s.jsxs)(n.td,{children:["Customization of the logo object. See ",(0,s.jsx)(n.a,{href:"#navbar-logo",children:"Navbar logo"})," for details."]})]}),(0,s.jsxs)(n.tr,{children:[(0,s.jsx)(n.td,{children:(0,s.jsx)(n.code,{children:"copyright"})}),(0,s.jsx)(n.td,{children:(0,s.jsx)(n.code,{children:"string"})}),(0,s.jsx)(n.td,{children:(0,s.jsx)(n.code,{children:"undefined"})}),(0,s.jsx)(n.td,{children:"The copyright message to be displayed at the bottom, also supports custom HTML."})]}),(0,s.jsxs)(n.tr,{children:[(0,s.jsx)(n.td,{children:(0,s.jsx)(n.code,{children:"style"})}),(0,s.jsx)(n.td,{children:(0,s.jsx)("code",{children:"'dark' | 'light'"})}),(0,s.jsx)(n.td,{children:(0,s.jsx)(n.code,{children:"'light'"})}),(0,s.jsx)(n.td,{children:"The color theme of the footer component."})]}),(0,s.jsxs)(n.tr,{children:[(0,s.jsx)(n.td,{children:(0,s.jsx)(n.code,{children:"links"})}),(0,s.jsx)(n.td,{children:(0,s.jsx)("code",{children:"(Column | FooterLink)[]"})}),(0,s.jsx)(n.td,{children:(0,s.jsx)(n.code,{children:"[]"})}),(0,s.jsx)(n.td,{children:"The link groups to be present."})]})]})]})}),"\n",(0,s.jsx)(n.p,{children:"Example configuration:"}),"\n",(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-js",metastring:'title="docusaurus.config.js"',children:"export default {\n themeConfig: {\n // highlight-start\n footer: {\n logo: {\n alt: 'Meta Open Source Logo',\n src: 'img/meta_oss_logo.png',\n href: 'https://opensource.fb.com',\n width: 160,\n height: 51,\n },\n copyright: `Copyright \xa9 ${new Date().getFullYear()} My Project, Inc. Built with Docusaurus.`,\n },\n // highlight-end\n },\n};\n"})}),"\n",(0,s.jsx)(n.h3,{id:"footer-links",children:"Footer Links"}),"\n",(0,s.jsxs)(n.p,{children:["You can add links to the footer via ",(0,s.jsx)(n.code,{children:"themeConfig.footer.links"}),". There are two types of footer configurations: ",(0,s.jsx)(n.strong,{children:"multi-column footers"})," and ",(0,s.jsx)(n.strong,{children:"simple footers"}),"."]}),"\n",(0,s.jsxs)(n.p,{children:["Multi-column footer links have a ",(0,s.jsx)(n.code,{children:"title"})," and a list of ",(0,s.jsx)(n.code,{children:"FooterItem"}),"s for each column."]}),"\n",(0,s.jsx)(r.Z,{name:"footer-links",children:(0,s.jsxs)(n.table,{children:[(0,s.jsx)(n.thead,{children:(0,s.jsxs)(n.tr,{children:[(0,s.jsx)(n.th,{children:"Name"}),(0,s.jsx)(n.th,{children:"Type"}),(0,s.jsx)(n.th,{children:"Default"}),(0,s.jsx)(n.th,{children:"Description"})]})}),(0,s.jsxs)(n.tbody,{children:[(0,s.jsxs)(n.tr,{children:[(0,s.jsx)(n.td,{children:(0,s.jsx)(n.code,{children:"title"})}),(0,s.jsx)(n.td,{children:(0,s.jsx)(n.code,{children:"string"})}),(0,s.jsx)(n.td,{children:(0,s.jsx)(n.code,{children:"undefined"})}),(0,s.jsx)(n.td,{children:"Label of the section of these links."})]}),(0,s.jsxs)(n.tr,{children:[(0,s.jsx)(n.td,{children:(0,s.jsx)(n.code,{children:"items"})}),(0,s.jsx)(n.td,{children:(0,s.jsx)(n.code,{children:"FooterItem[]"})}),(0,s.jsx)(n.td,{children:(0,s.jsx)(n.code,{children:"[]"})}),(0,s.jsx)(n.td,{children:"Links in this section."})]})]})]})}),"\n",(0,s.jsxs)(n.p,{children:["Accepted fields of each ",(0,s.jsx)(n.code,{children:"FooterItem"}),":"]}),"\n",(0,s.jsx)(r.Z,{name:"footer-items",children:(0,s.jsxs)(n.table,{children:[(0,s.jsx)(n.thead,{children:(0,s.jsxs)(n.tr,{children:[(0,s.jsx)(n.th,{children:"Name"}),(0,s.jsx)(n.th,{children:"Type"}),(0,s.jsx)(n.th,{children:"Default"}),(0,s.jsx)(n.th,{children:"Description"})]})}),(0,s.jsxs)(n.tbody,{children:[(0,s.jsxs)(n.tr,{children:[(0,s.jsx)(n.td,{children:(0,s.jsx)(n.code,{children:"label"})}),(0,s.jsx)(n.td,{children:(0,s.jsx)(n.code,{children:"string"})}),(0,s.jsx)(n.td,{children:(0,s.jsx)(n.strong,{children:"Required"})}),(0,s.jsx)(n.td,{children:"Text to be displayed for this link."})]}),(0,s.jsxs)(n.tr,{children:[(0,s.jsx)(n.td,{children:(0,s.jsx)(n.code,{children:"to"})}),(0,s.jsx)(n.td,{children:(0,s.jsx)(n.code,{children:"string"})}),(0,s.jsx)(n.td,{children:(0,s.jsx)(n.strong,{children:"Required"})}),(0,s.jsx)(n.td,{children:"Client-side routing, used for navigating within the website. The baseUrl will be automatically prepended to this value."})]}),(0,s.jsxs)(n.tr,{children:[(0,s.jsx)(n.td,{children:(0,s.jsx)(n.code,{children:"href"})}),(0,s.jsx)(n.td,{children:(0,s.jsx)(n.code,{children:"string"})}),(0,s.jsx)(n.td,{children:(0,s.jsx)(n.strong,{children:"Required"})}),(0,s.jsxs)(n.td,{children:["A full-page navigation, used for navigating outside of the website. ",(0,s.jsxs)(n.strong,{children:["Only one of ",(0,s.jsx)(n.code,{children:"to"})," or ",(0,s.jsx)(n.code,{children:"href"})," should be used."]})]})]}),(0,s.jsxs)(n.tr,{children:[(0,s.jsx)(n.td,{children:(0,s.jsx)(n.code,{children:"html"})}),(0,s.jsx)(n.td,{children:(0,s.jsx)(n.code,{children:"string"})}),(0,s.jsx)(n.td,{children:(0,s.jsx)(n.code,{children:"undefined"})}),(0,s.jsxs)(n.td,{children:["Renders the HTML pass-through instead of a simple link. In case ",(0,s.jsx)(n.code,{children:"html"})," is used, no other options should be provided."]})]})]})]})}),"\n",(0,s.jsx)(n.p,{children:"Example multi-column configuration:"}),"\n",(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-js",metastring:'title="docusaurus.config.js"',children:"export default {\n footer: {\n // highlight-start\n links: [\n {\n title: 'Docs',\n items: [\n {\n label: 'Style Guide',\n to: 'docs/',\n },\n {\n label: 'Second Doc',\n to: 'docs/doc2/',\n },\n ],\n },\n {\n title: 'Community',\n items: [\n {\n label: 'Stack Overflow',\n href: 'https://stackoverflow.com/questions/tagged/docusaurus',\n },\n {\n label: 'Discord',\n href: 'https://discordapp.com/invite/docusaurus',\n },\n {\n label: 'X',\n href: 'https://x.com/docusaurus',\n },\n {\n html: `\n \n\n \n `,\n },\n ],\n },\n ],\n // highlight-end\n },\n};\n"})}),"\n",(0,s.jsxs)(n.p,{children:["A simple footer just has a list of ",(0,s.jsx)(n.code,{children:"FooterItem"}),"s displayed in a row."]}),"\n",(0,s.jsx)(n.p,{children:"Example simple configuration:"}),"\n",(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-js",metastring:'title="docusaurus.config.js"',children:'export default {\n footer: {\n // highlight-start\n links: [\n {\n label: \'Stack Overflow\',\n href: \'https://stackoverflow.com/questions/tagged/docusaurus\',\n },\n {\n label: \'Discord\',\n href: \'https://discordapp.com/invite/docusaurus\',\n },\n {\n label: \'X\',\n href: \'https://x.com/docusaurus\',\n },\n {\n html: `\n \n
\n \n `,\n },\n ],\n // highlight-end\n },\n};\n'})}),"\n",(0,s.jsx)(n.h2,{id:"table-of-contents",children:"Table of Contents"}),"\n",(0,s.jsxs)(n.p,{children:["You can adjust the default table of contents via ",(0,s.jsx)(n.code,{children:"themeConfig.tableOfContents"}),"."]}),"\n",(0,s.jsx)(r.Z,{children:(0,s.jsxs)(n.table,{children:[(0,s.jsx)(n.thead,{children:(0,s.jsxs)(n.tr,{children:[(0,s.jsx)(n.th,{children:"Name"}),(0,s.jsx)(n.th,{children:"Type"}),(0,s.jsx)(n.th,{children:"Default"}),(0,s.jsx)(n.th,{children:"Description"})]})}),(0,s.jsxs)(n.tbody,{children:[(0,s.jsxs)(n.tr,{children:[(0,s.jsx)(n.td,{children:(0,s.jsx)(n.code,{children:"minHeadingLevel"})}),(0,s.jsx)(n.td,{children:(0,s.jsx)(n.code,{children:"number"})}),(0,s.jsx)(n.td,{children:(0,s.jsx)(n.code,{children:"2"})}),(0,s.jsx)(n.td,{children:"The minimum heading level shown in the table of contents. Must be between 2 and 6 and lower or equal to the max value."})]}),(0,s.jsxs)(n.tr,{children:[(0,s.jsx)(n.td,{children:(0,s.jsx)(n.code,{children:"maxHeadingLevel"})}),(0,s.jsx)(n.td,{children:(0,s.jsx)(n.code,{children:"number"})}),(0,s.jsx)(n.td,{children:(0,s.jsx)(n.code,{children:"3"})}),(0,s.jsx)(n.td,{children:"Max heading level displayed in the TOC. Should be an integer between 2 and 6."})]})]})]})}),"\n",(0,s.jsx)(n.p,{children:"Example configuration:"}),"\n",(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-js",metastring:'title="docusaurus.config.js"',children:"export default {\n themeConfig: {\n // highlight-start\n tableOfContents: {\n minHeadingLevel: 2,\n maxHeadingLevel: 5,\n },\n // highlight-end\n },\n};\n"})}),"\n",(0,s.jsx)(n.h2,{id:"hooks",children:"Hooks"}),"\n",(0,s.jsx)(n.h3,{id:"use-color-mode",children:(0,s.jsx)(n.code,{children:"useColorMode"})}),"\n",(0,s.jsxs)(n.p,{children:["A React hook to access the color context. This context contains functions for selecting light/dark/system mode and exposes the current color mode and the choice from the user. The color mode values ",(0,s.jsx)(n.strong,{children:"should not be used for dynamic content rendering"})," (see below)."]}),"\n",(0,s.jsx)(n.p,{children:"Usage example:"}),"\n",(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-jsx",children:"// highlight-next-line\nimport {useColorMode} from '@docusaurus/theme-common';\n\nconst MyColorModeButton = () => {\n // highlight-start\n const {\n colorMode, // the \"effective\" color mode, never null\n colorModeChoice, // the color mode chosen by the user, can be null\n setColorMode, // set the color mode chosen by the user\n } = useColorMode();\n // highlight-end\n\n return (\n \n );\n};\n"})}),"\n",(0,s.jsx)(n.p,{children:"Attributes:"}),"\n",(0,s.jsxs)(n.ul,{children:["\n",(0,s.jsxs)(n.li,{children:[(0,s.jsx)(n.code,{children:"colorMode: 'light' | 'dark'"}),": The effective color mode currently applied to the UI. It cannot be ",(0,s.jsx)(n.code,{children:"null"}),"."]}),"\n",(0,s.jsxs)(n.li,{children:[(0,s.jsx)(n.code,{children:"colorModeChoice: 'light' | 'dark' | null"}),": The color mode explicitly chosen by the user. It can be ",(0,s.jsx)(n.code,{children:"null"})," if user has not made any choice yet, or if they reset their choice to the system/default value."]}),"\n",(0,s.jsxs)(n.li,{children:[(0,s.jsx)(n.code,{children:"setColorMode(colorModeChoice: 'light' | 'dark' | null, options: {persist: boolean}): void"}),": A function to call when the user explicitly chose a color mode. ",(0,s.jsx)(n.code,{children:"null"})," permits to reset the choice to the system/default value. By default, the choice is persisted in ",(0,s.jsx)(n.code,{children:"localStorage"})," and restored on page reload, but you can opt out with ",(0,s.jsx)(n.code,{children:"{persist: false}"}),"."]}),"\n"]}),"\n",(0,s.jsxs)(n.admonition,{type:"warning",children:[(0,s.jsxs)(n.p,{children:["Don't use ",(0,s.jsx)(n.code,{children:"colorMode"})," and ",(0,s.jsx)(n.code,{children:"colorModeChoice"})," while rendering React components. Doing so is likely to produce ",(0,s.jsx)(n.a,{href:"https://en.wikipedia.org/wiki/Flash_of_unstyled_content",children:"FOUC"}),", layout shifts and ",(0,s.jsx)(n.a,{href:"https://18.react.dev/reference/react-dom/client/hydrateRoot",children:"React hydration"})," mismatches if you use them to render JSX content dynamically."]}),(0,s.jsxs)(n.p,{children:["However, these values are safe to use ",(0,s.jsx)(n.strong,{children:"after React hydration"}),", in ",(0,s.jsx)(n.code,{children:"useEffect"})," and event listeners, like in the ",(0,s.jsx)(n.code,{children:"MyColorModeButton"})," example above."]}),(0,s.jsxs)(n.p,{children:["If you need to render content dynamically depending on the current theme, the only way to avoid FOUC, layout shifts and hydration mismatch is to rely on CSS selectors to render content dynamically, based on the ",(0,s.jsx)(n.code,{children:"html"})," data attributes that we set before the page displays anything:"]}),(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-html",children:'\n \x3c!-- content --\x3e\n\n'})}),(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-css",children:"[data-theme='light']\n[data-theme='dark']\n\n[data-theme-choice='light']\n[data-theme-choice='dark']\n[data-theme-choice='system']\n"})}),(0,s.jsxs)(d,{children:[(0,s.jsxs)("summary",{children:["Why are ",(0,s.jsx)(n.code,{children:"colorMode"})," and ",(0,s.jsx)(n.code,{children:"colorModeChoice"})," unsafe when rendering?"]}),(0,s.jsxs)(n.p,{children:["To understand the problem, you need to understand how ",(0,s.jsx)(n.a,{href:"https://18.react.dev/reference/react-dom/client/hydrateRoot",children:"React hydration"})," works."]}),(0,s.jsxs)(n.p,{children:["During the static site generation phase, Docusaurus doesn't know what the user color mode choice is, and ",(0,s.jsx)(n.code,{children:"useColorMode()"})," returns the following static values:"]}),(0,s.jsxs)(n.ul,{children:["\n",(0,s.jsx)(n.li,{children:(0,s.jsx)(n.code,{children:"colorMode = themeConfig.colorMode.defaultMode"})}),"\n",(0,s.jsx)(n.li,{children:(0,s.jsx)(n.code,{children:"colorModeChoice = null"})}),"\n"]}),(0,s.jsx)(n.p,{children:"During the very first React client-side render (the hydration), React must produce the exact same HTML markup, and will also use these static values."}),(0,s.jsxs)(n.p,{children:["The correct ",(0,s.jsx)(n.code,{children:"colorMode"})," and ",(0,s.jsx)(n.code,{children:"colorModeChoice"})," values will only be provided in the second React render."]}),(0,s.jsxs)(n.p,{children:["Typically, the following component will lead to ",(0,s.jsx)(n.strong,{children:"React hydration mismatches"}),". The label may switch from ",(0,s.jsx)(n.code,{children:"light"})," to ",(0,s.jsx)(n.code,{children:"dark"})," while React hydrates, leading to a confusing user experience."]}),(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-jsx",children:"import {useColorMode} from '@docusaurus/theme-common';\n\nconst DisplayCurrentColorMode = () => {\n const {colorMode} = useColorMode();\n return {colorMode};\n};\n"})})]})]}),"\n",(0,s.jsxs)(n.admonition,{type:"note",children:[(0,s.jsxs)(n.p,{children:["The component calling ",(0,s.jsx)(n.code,{children:"useColorMode"})," must be a child of the ",(0,s.jsx)(n.code,{children:"Layout"})," component."]}),(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-jsx",children:"function ExamplePage() {\n return (\n
\n \n );\n}\n"})})]}),"\n",(0,s.jsx)(n.h2,{id:"i18n",children:"i18n"}),"\n",(0,s.jsxs)(n.p,{children:["Read the ",(0,s.jsx)(n.a,{href:"/docs/i18n/introduction",children:"i18n introduction"})," first."]}),"\n",(0,s.jsx)(n.h3,{id:"translation-files-location",children:"Translation files location"}),"\n",(0,s.jsxs)(n.ul,{children:["\n",(0,s.jsxs)(n.li,{children:[(0,s.jsx)(n.strong,{children:"Base path"}),": ",(0,s.jsx)(n.code,{children:"website/i18n/[locale]/docusaurus-theme-[themeName]"})]}),"\n",(0,s.jsxs)(n.li,{children:[(0,s.jsx)(n.strong,{children:"Multi-instance path"}),": N/A"]}),"\n",(0,s.jsxs)(n.li,{children:[(0,s.jsx)(n.strong,{children:"JSON files"}),": extracted with ",(0,s.jsx)(n.a,{href:"/docs/cli#docusaurus-write-translations-sitedir",children:(0,s.jsx)(n.code,{children:"docusaurus write-translations"})})]}),"\n",(0,s.jsxs)(n.li,{children:[(0,s.jsx)(n.strong,{children:"Markdown files"}),": N/A"]}),"\n"]}),"\n",(0,s.jsx)(n.h3,{id:"example-file-system-structure",children:"Example file-system structure"}),"\n",(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-bash",children:"website/i18n/[locale]/docusaurus-theme-classic\n\u2502\n\u2502 # translations for the theme\n\u251C\u2500\u2500 navbar.json\n\u2514\u2500\u2500 footer.json\n"})})]})}function x(e={}){let{wrapper:n}={...(0,t.a)(),...e.components};return n?(0,s.jsx)(n,{...e,children:(0,s.jsx)(a,{...e})}):a(e)}},32240:function(e,n,d){d.d(n,{Z:()=>c});var i=d(85893),s=d(67294),t=d(96700),r=d(3620);let l=s.forwardRef(function(e,n){let{name:d,children:l}=e,c=function(e){let n=e;for(;(0,s.isValidElement)(n);)[n]=s.Children.toArray(n.props.children);if("string"!=typeof n)throw Error(`Could not extract APITable row name from JSX tree: -${JSON.stringify(e,null,2)}`);return n}(l),o=d?`${d}-${c}`:c,h=`#${o}`,a=(0,r.k6)();return(0,t.Z)().collectAnchor(o),(0,i.jsx)("tr",{id:o,tabIndex:0,ref:a.location.hash===h?n:void 0,onClick:e=>{let n="TD"===e.target.tagName.toUpperCase(),d=!!window.getSelection()?.toString();n&&!d&&a.push(h)},onKeyDown:e=>{"Enter"===e.key&&a.push(h)},children:l.props.children})});function c(e){let{children:n,name:d}=e;if("table"!==n.type)throw Error("Bad usage of APITable component.\nIt is probably that your Markdown table is malformed.\nMake sure to double-check you have the appropriate number of columns for each table row.");let[t,r]=s.Children.toArray(n.props.children),c=(0,s.useRef)(null);(0,s.useEffect)(()=>{c.current?.focus()},[c]);let o=s.Children.map(r.props.children,e=>(0,i.jsx)(l,{name:d,ref:c,children:e}));return(0,i.jsxs)("table",{className:"apiTable_e8hp",children:[t,(0,i.jsx)("tbody",{children:o})]})}},80980:function(e,n,d){d.d(n,{Z:()=>l,a:()=>r});var i=d(67294);let s={},t=i.createContext(s);function r(e){let n=i.useContext(t);return i.useMemo(function(){return"function"==typeof e?e(n):{...n,...e}},[n,e])}function l(e){let n;return n=e.disableParentContext?"function"==typeof e.components?e.components(s):e.components||s:r(e.components),i.createElement(t.Provider,{value:n},e.children)}}}]); \ No newline at end of file diff --git a/assets/js/048b0d50.03df768d.js b/assets/js/048b0d50.03df768d.js deleted file mode 100644 index e4bf66ec19..0000000000 --- a/assets/js/048b0d50.03df768d.js +++ /dev/null @@ -1 +0,0 @@ -"use strict";(self.webpackChunkwebsite=self.webpackChunkwebsite||[]).push([["30992"],{83119:function(e,n,t){t.r(n),t.d(n,{frontMatter:()=>l,default:()=>h,contentTitle:()=>c,assets:()=>d,toc:()=>u,metadata:()=>a});var a=JSON.parse('{"type":"mdx","permalink":"/tests/pages/diagrams","source":"@site/_dogfooding/_pages tests/diagrams.mdx","title":"Diagram Examples","description":"Invalid Diagrams","frontMatter":{},"lastUpdatedBy":"Ben McCann","lastUpdatedAt":1744155424000,"editUrl":"https://github.com/facebook/docusaurus/edit/main/website/_dogfooding/_pages tests/diagrams.mdx","unlisted":false}'),i=t(85893),r=t(80980),s=t(15398),o=t(58636);let l={},c="Diagram Examples",d={},u=[{value:"Invalid Diagrams",id:"invalid-diagrams",level:2},{value:"Invalid type",id:"invalid-type",level:3},{value:"Invalid content",id:"invalid-content",level:3},{value:"Sequence Diagram",id:"sequence-diagram",level:2},{value:"Sequence Diagram (forest theme directive)",id:"sequence-diagram-forest-theme-directive",level:2},{value:"Gantt Chart",id:"gantt-chart",level:2},{value:"Flow Chart",id:"flow-chart",level:2},{value:"With Markdown:",id:"with-markdown",level:3},{value:"Class Diagram",id:"class-diagram",level:2},{value:"State Diagram",id:"state-diagram",level:2},{value:"Entity Relationship Diagram",id:"entity-relationship-diagram",level:2},{value:"User Journey",id:"user-journey",level:2},{value:"Pie Chart",id:"pie-chart",level:2},{value:"Requirement Diagram",id:"requirement-diagram",level:2},{value:"Gitgraph (Git) Diagram",id:"gitgraph-git-diagram",level:2},{value:"Mermaid in tabs",id:"mermaid-in-tabs",level:2},{value:"Mindmap",id:"mindmap",level:2},{value:"Quadrant Chart",id:"quadrant-chart",level:2},{value:"Architecture Diagram",id:"architecture-diagram",level:2}];function m(e){let n={a:"a",admonition:"admonition",code:"code",h1:"h1",h2:"h2",h3:"h3",header:"header",li:"li",mermaid:"mermaid",p:"p",pre:"pre",ul:"ul",...(0,r.a)(),...e.components};return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(n.header,{children:(0,i.jsx)(n.h1,{id:"diagram-examples",children:"Diagram Examples"})}),"\n",(0,i.jsx)(n.h2,{id:"invalid-diagrams",children:"Invalid Diagrams"}),"\n",(0,i.jsx)(n.p,{children:"Those errors should not crash the whole page"}),"\n",(0,i.jsx)(n.h3,{id:"invalid-type",children:"Invalid type"}),"\n",(0,i.jsx)(n.mermaid,{value:"badType\n participant Alice\n participant Bob"}),"\n",(0,i.jsx)(n.h3,{id:"invalid-content",children:"Invalid content"}),"\n",(0,i.jsx)(n.mermaid,{value:"sequenceDiagram\n badInstruction Alice\n participant Bob"}),"\n",(0,i.jsx)(n.h2,{id:"sequence-diagram",children:"Sequence Diagram"}),"\n",(0,i.jsx)(n.mermaid,{value:"sequenceDiagram\n participant Alice\n participant Bob\n Alice->>John: Hello John, how are you?\n loop Health check\n John->>John: Fight against hypochondria\n end\n Note right of John: Rational thoughts\n
prevail!\n John--\x3e>Alice: Great!\n John->>Bob: How about you?\n Bob--\x3e>John: Jolly good!"}),"\n",(0,i.jsx)(n.h2,{id:"sequence-diagram-forest-theme-directive",children:"Sequence Diagram (forest theme directive)"}),"\n",(0,i.jsx)(n.p,{children:"It is possible to override default config locally with Mermaid text directives such as:"}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{children:'%%{init: { "theme": "forest" } }%%\n'})}),"\n",(0,i.jsx)(n.mermaid,{value:'%%{init: { "theme": "forest" } }%%\n\nsequenceDiagram\n participant Alice\n participant Bob\n Alice->>John: Hello John, how are you?\n loop Health check\n John->>John: Fight against hypochondria\n end\n Note right of John: Rational thoughts
prevail!\n John--\x3e>Alice: Great!\n John->>Bob: How about you?\n Bob--\x3e>John: Jolly good!'}),"\n",(0,i.jsx)(n.h2,{id:"gantt-chart",children:"Gantt Chart"}),"\n",(0,i.jsx)(n.mermaid,{value:"gantt\ndateFormat YYYY-MM-DD\ntitle Adding GANTT diagram to mermaid\nexcludes weekdays 2014-01-10\n\nsection A section\nCompleted task :done, des1, 2014-01-06,2014-01-08\nActive task :active, des2, 2014-01-09, 3d\nFuture task : des3, after des2, 5d\nFuture task2 : des4, after des3, 5d"}),"\n",(0,i.jsx)(n.h2,{id:"flow-chart",children:"Flow Chart"}),"\n",(0,i.jsx)(n.mermaid,{value:"flowchart TD\n A[Start] --\x3e B{Is it?}\n B --\x3e|Yes| C[OK]\n C --\x3e D[Rethink]\n D --\x3e B\n B ----\x3e|No| E[End]"}),"\n",(0,i.jsx)(n.h3,{id:"with-markdown",children:"With Markdown:"}),"\n",(0,i.jsx)(n.mermaid,{value:'flowchart LR\n markdown["`This **is** _Markdown_`"]\n newLines["`Line1\n Line 2\n Line 3`"]\n markdown --\x3e newLines'}),"\n",(0,i.jsx)(n.h2,{id:"class-diagram",children:"Class Diagram"}),"\n",(0,i.jsx)(n.mermaid,{value:" classDiagram\n Animal <|-- Duck\n Animal <|-- Fish\n Animal <|-- Zebra\n Animal : +int age\n Animal : +String gender\n Animal: +isMammal()\n Animal: +mate()\n class Duck{\n +String beakColor\n +swim()\n +quack()\n }\n class Fish{\n -int sizeInFeet\n -canEat()\n }\n class Zebra{\n +bool is_wild\n +run()\n }"}),"\n",(0,i.jsx)(n.h2,{id:"state-diagram",children:"State Diagram"}),"\n",(0,i.jsx)(n.mermaid,{value:"stateDiagram-v2\n [*] --\x3e Active\n\n state Active {\n [*] --\x3e NumLockOff\n NumLockOff --\x3e NumLockOn : EvNumLockPressed\n NumLockOn --\x3e NumLockOff : EvNumLockPressed\n --\n [*] --\x3e CapsLockOff\n CapsLockOff --\x3e CapsLockOn : EvCapsLockPressed\n CapsLockOn --\x3e CapsLockOff : EvCapsLockPressed\n --\n [*] --\x3e ScrollLockOff\n ScrollLockOff --\x3e ScrollLockOn : EvScrollLockPressed\n ScrollLockOn --\x3e ScrollLockOff : EvScrollLockPressed\n }"}),"\n",(0,i.jsx)(n.h2,{id:"entity-relationship-diagram",children:"Entity Relationship Diagram"}),"\n",(0,i.jsx)(n.mermaid,{value:"erDiagram\n CAR ||--o{ NAMED-DRIVER : allows\n CAR {\n string registrationNumber\n string make\n string model\n }\n PERSON ||--o{ NAMED-DRIVER : is\n PERSON {\n string firstName\n string lastName\n int age\n }"}),"\n",(0,i.jsx)(n.h2,{id:"user-journey",children:"User Journey"}),"\n",(0,i.jsx)(n.mermaid,{value:"journey\n title My working day\n section Go to work\n Make tea: 5: Me\n Go upstairs: 3: Me\n Do work: 1: Me, Cat\n section Go home\n Go downstairs: 5: Me\n Sit down: 5: Me"}),"\n",(0,i.jsx)(n.admonition,{type:"note",children:(0,i.jsxs)(n.p,{children:["If there's too much space above it's due to a ",(0,i.jsx)(n.a,{href:"https://github.com/mermaid-js/mermaid/issues/3501",children:"Mermaid bug"})]})}),"\n",(0,i.jsx)(n.h2,{id:"pie-chart",children:"Pie Chart"}),"\n",(0,i.jsx)(n.mermaid,{value:'pie showData\n title Key elements in Product X\n "Calcium" : 42.96\n "Potassium" : 50.05\n "Magnesium" : 10.01\n "Iron" : 5'}),"\n",(0,i.jsx)(n.h2,{id:"requirement-diagram",children:"Requirement Diagram"}),"\n",(0,i.jsx)(n.mermaid,{value:' requirementDiagram\n\n requirement test_req {\n id: 1\n text: the test text.\n risk: high\n verifymethod: test\n }\n\n functionalRequirement test_req2 {\n id: 1.1\n text: the second test text.\n risk: low\n verifymethod: inspection\n }\n\n performanceRequirement test_req3 {\n id: 1.2\n text: the third test text.\n risk: medium\n verifymethod: demonstration\n }\n\n interfaceRequirement test_req4 {\n id: 1.2.1\n text: the fourth test text.\n risk: medium\n verifymethod: analysis\n }\n\n physicalRequirement test_req5 {\n id: 1.2.2\n text: the fifth test text.\n risk: medium\n verifymethod: analysis\n }\n\n designConstraint test_req6 {\n id: 1.2.3\n text: the sixth test text.\n risk: medium\n verifymethod: analysis\n }\n\n element test_entity {\n type: simulation\n }\n\n element test_entity2 {\n type: word doc\n docRef: reqs/test_entity\n }\n\n element test_entity3 {\n type: "test suite"\n docRef: github.com/all_the_tests\n }\n\n\n test_entity - satisfies -> test_req2\n test_req - traces -> test_req2\n test_req - contains -> test_req3\n test_req3 - contains -> test_req4\n test_req4 - derives -> test_req5\n test_req5 - refines -> test_req6\n test_entity3 - verifies -> test_req5\n test_req <- copies - test_entity2'}),"\n",(0,i.jsx)(n.h2,{id:"gitgraph-git-diagram",children:"Gitgraph (Git) Diagram"}),"\n",(0,i.jsx)(n.mermaid,{value:"%%{init: { 'logLevel': 'debug', 'theme': 'base' } }%%\n gitGraph\n commit\n branch hotfix\n checkout hotfix\n commit\n branch develop\n checkout develop\n commit id:\"ash\" tag:\"abc\"\n branch featureB\n checkout featureB\n commit type:HIGHLIGHT\n checkout main\n checkout hotfix\n commit type:NORMAL\n checkout develop\n commit type:REVERSE\n checkout featureB\n commit\n checkout main\n merge hotfix\n checkout featureB\n commit\n checkout develop\n branch featureA\n commit\n checkout develop\n merge hotfix\n checkout featureA\n commit\n checkout featureB\n commit\n checkout develop\n merge featureA\n branch release\n checkout release\n commit\n checkout main\n commit\n checkout release\n merge main\n checkout develop\n merge release"}),"\n",(0,i.jsx)(n.h2,{id:"mermaid-in-tabs",children:"Mermaid in tabs"}),"\n","\n",(0,i.jsxs)(s.Z,{children:[(0,i.jsxs)(o.Z,{value:"tab-a",children:[(0,i.jsx)(n.p,{children:"The following mermaid diagram is shown:"}),(0,i.jsx)(n.mermaid,{value:"graph LR\n a ---\x3e c(10)\n b ---\x3e c(10)"})]}),(0,i.jsxs)(o.Z,{value:"tab-b",children:[(0,i.jsx)(n.p,{children:"This mermaid diagram is not displayed:"}),(0,i.jsx)(n.mermaid,{value:"graph LR\n d ---\x3e z(42)\n e ---\x3e z(42)"})]})]}),"\n",(0,i.jsx)(n.h2,{id:"mindmap",children:"Mindmap"}),"\n",(0,i.jsx)(n.mermaid,{value:"mindmap\n root((conda-forge))\n (Repos)\n (Package building)\n [*-feedstock]\n [staged-recipes]\n [cdt-builds]\n [msys2-recipes]\n (Maintenance)\n [admin-requests]\n [repodata-patches]\n (Configuration)\n [.github]\n [.cirun]\n [conda-forge-pinning]\n [conda-forge-ci-setup]\n [docker-images]\n [conda-smithy]\n (Automations)\n [admin-migrations]\n [artifact-validation]\n [regro/cf-scripts]\n [conda-forge-webservices]\n [regro/cf-graph-countyfair]\n [regro/libcfgraph + regro/libcflib]\n [feedstock-outputs]\n (Communications)\n [conda-forge.github.io]\n [blog]\n [status]\n [by-the-numbers]\n [conda-forge-status-monitor]\n [feedstocks]\n (Bots & apps)\n [conda-forge-admin]\n [conda-forge-bot]\n [conda-forge-coordinator]\n [conda-forge-daemon]\n [conda-forge-linter]\n [conda-forge-manager]\n [conda-forge-status]\n [regro-cf-autotick-bot]\n [conda-forge-curator]\n [conda-forge-webservices]\n (Delivery)\n [anaconda.org]\n [ghcr.io]\n [quay.io]\n (Installers)\n Miniforge\n Mambaforge\n (CI for builds)\n Azure Pipelines\n Travis CI\n cirun.io\n (Infra)\n Heroku\n Github Actions\n Circle CI"}),"\n",(0,i.jsx)(n.h2,{id:"quadrant-chart",children:"Quadrant Chart"}),"\n",(0,i.jsx)(n.mermaid,{value:"quadrantChart\n title Reach and engagement of campaigns\n x-axis Low Reach --\x3e High Reach\n y-axis Low Engagement --\x3e High Engagement\n quadrant-1 We should expand\n quadrant-2 Need to promote\n quadrant-3 Re-evaluate\n quadrant-4 May be improved\n Campaign A: [0.3, 0.6]\n Campaign B: [0.45, 0.23]\n Campaign C: [0.57, 0.69]\n Campaign D: [0.78, 0.34]\n Campaign E: [0.40, 0.34]\n Campaign F: [0.35, 0.78]"}),"\n",(0,i.jsx)(n.h2,{id:"architecture-diagram",children:"Architecture Diagram"}),"\n",(0,i.jsxs)(n.ul,{children:["\n",(0,i.jsxs)(n.li,{children:["See ",(0,i.jsx)(n.a,{href:"https://mermaid.js.org/syntax/architecture",children:"https://mermaid.js.org/syntax/architecture"})]}),"\n",(0,i.jsxs)(n.li,{children:["See ",(0,i.jsx)(n.a,{href:"https://github.com/facebook/docusaurus/discussions/10508",children:"https://github.com/facebook/docusaurus/discussions/10508"})]}),"\n"]}),"\n",(0,i.jsx)(n.mermaid,{value:"architecture-beta\n group api(cloud)[API]\n\n service db(database)[Database] in api\n service disk1(disk)[Storage] in api\n service disk2(disk)[Storage] in api\n service server(server)[Server] in api\n\n db:L -- R:server\n disk1:T -- B:server\n disk2:T -- B:db"})]})}function h(e={}){let{wrapper:n}={...(0,r.a)(),...e.components};return n?(0,i.jsx)(n,{...e,children:(0,i.jsx)(m,{...e})}):m(e)}},58636:function(e,n,t){t.d(n,{Z:()=>r});var a=t(85893);t(67294);var i=t(90496);function r(e){let{children:n,hidden:t,className:r}=e;return(0,a.jsx)("div",{role:"tabpanel",className:(0,i.Z)("tabItem_pnkT",r),hidden:t,children:n})}},15398:function(e,n,t){t.d(n,{Z:()=>b});var a=t(85893),i=t(67294),r=t(90496),s=t(54947),o=t(3620),l=t(844),c=t(97486),d=t(32263),u=t(16971);function m(e){return i.Children.toArray(e).filter(e=>"\n"!==e).map(e=>{if(!e||(0,i.isValidElement)(e)&&function(e){let{props:n}=e;return!!n&&"object"==typeof n&&"value"in n}(e))return e;throw Error(`Docusaurus error: Badchild <${"string"==typeof e.type?e.type:e.type.name}>: all children of the component should be , and every should have a unique "value" prop.`)})?.filter(Boolean)??[]}function h(e){let{value:n,tabValues:t}=e;return t.some(e=>e.value===n)}var g=t(71607);function p(e){let{className:n,block:t,selectedValue:i,selectValue:o,tabValues:l}=e,c=[],{blockElementScrollPositionUntilNextRender:d}=(0,s.o5)(),u=e=>{let n=e.currentTarget,t=l[c.indexOf(n)].value;t!==i&&(d(n),o(t))},m=e=>{let n=null;switch(e.key){case"Enter":u(e);break;case"ArrowRight":{let t=c.indexOf(e.currentTarget)+1;n=c[t]??c[0];break}case"ArrowLeft":{let t=c.indexOf(e.currentTarget)-1;n=c[t]??c[c.length-1]}}n?.focus()};return(0,a.jsx)("ul",{role:"tablist","aria-orientation":"horizontal",className:(0,r.Z)("tabs",{"tabs--block":t},n),children:l.map(e=>{let{value:n,label:t,attributes:s}=e;return(0,a.jsx)("li",{role:"tab",tabIndex:i===n?0:-1,"aria-selected":i===n,ref:e=>{c.push(e)},onKeyDown:m,onClick:u,...s,className:(0,r.Z)("tabs__item","tabItem_AQgk",s?.className,{"tabs__item--active":i===n}),children:t??n},n)})})}function f(e){let{lazy:n,children:t,selectedValue:s}=e,o=(Array.isArray(t)?t:[t]).filter(Boolean);if(n){let e=o.find(e=>e.props.value===s);return e?(0,i.cloneElement)(e,{className:(0,r.Z)("margin-top--md",e.props.className)}):null}return(0,a.jsx)("div",{className:"margin-top--md",children:o.map((e,n)=>(0,i.cloneElement)(e,{key:n,hidden:e.props.value!==s}))})}function v(e){let n=function(e){let{defaultValue:n,queryString:t=!1,groupId:a}=e,r=function(e){let{values:n,children:t}=e;return(0,i.useMemo)(()=>{let e=n??m(t).map(e=>{let{props:{value:n,label:t,attributes:a,default:i}}=e;return{value:n,label:t,attributes:a,default:i}}),a=(0,d.lx)(e,(e,n)=>e.value===n.value);if(a.length>0)throw Error(`Docusaurus error: Duplicate values "${a.map(e=>e.value).join(", ")}" found in . Every value needs to be unique.`);return e},[n,t])}(e),[s,g]=(0,i.useState)(()=>(function(e){let{defaultValue:n,tabValues:t}=e;if(0===t.length)throw Error("Docusaurus error: the component requires at least one children component");if(n){if(!h({value:n,tabValues:t}))throw Error(`Docusaurus error: The has a defaultValue "${n}" but none of its children has the corresponding value. Available values are: ${t.map(e=>e.value).join(", ")}. If you intend to show no default tab, use defaultValue={null} instead.`);return n}let a=t.find(e=>e.default)??t[0];if(!a)throw Error("Unexpected error: 0 tabValues");return a.value})({defaultValue:n,tabValues:r})),[p,f]=function(e){let{queryString:n=!1,groupId:t}=e,a=(0,o.k6)(),r=function(e){let{queryString:n=!1,groupId:t}=e;if("string"==typeof n)return n;if(!1===n)return null;if(!0===n&&!t)throw Error('Docusaurus error: The component groupId prop is required if queryString=true, because this value is used as the search param name. You can also provide an explicit value such as queryString="my-search-param".');return t??null}({queryString:n,groupId:t});return[(0,c._X)(r),(0,i.useCallback)(e=>{if(!r)return;let n=new URLSearchParams(a.location.search);n.set(r,e),a.replace({...a.location,search:n.toString()})},[r,a])]}({queryString:t,groupId:a}),[v,b]=function(e){let{groupId:n}=e,t=n?`docusaurus.tab.${n}`:null,[a,r]=(0,u.Nk)(t);return[a,(0,i.useCallback)(e=>{t&&r.set(e)},[t,r])]}({groupId:a}),x=(()=>{let e=p??v;return h({value:e,tabValues:r})?e:null})();return(0,l.Z)(()=>{x&&g(x)},[x]),{selectedValue:s,selectValue:(0,i.useCallback)(e=>{if(!h({value:e,tabValues:r}))throw Error(`Can't select invalid tab value=${e}`);g(e),f(e),b(e)},[f,b,r]),tabValues:r}}(e);return(0,a.jsxs)("div",{className:(0,r.Z)("tabs-container","tabList_Qoir"),children:[(0,a.jsx)(p,{...n,...e}),(0,a.jsx)(f,{...n,...e})]})}function b(e){let n=(0,g.Z)();return(0,a.jsx)(v,{...e,children:m(e.children)},String(n))}},80980:function(e,n,t){t.d(n,{Z:()=>o,a:()=>s});var a=t(67294);let i={},r=a.createContext(i);function s(e){let n=a.useContext(r);return a.useMemo(function(){return"function"==typeof e?e(n):{...n,...e}},[n,e])}function o(e){let n;return n=e.disableParentContext?"function"==typeof e.components?e.components(i):e.components||i:s(e.components),a.createElement(r.Provider,{value:n},e.children)}}}]); \ No newline at end of file diff --git a/assets/js/048b0d50.1f063606.js b/assets/js/048b0d50.1f063606.js new file mode 100644 index 0000000000..2252411f24 --- /dev/null +++ b/assets/js/048b0d50.1f063606.js @@ -0,0 +1 @@ +"use strict";(self.webpackChunkwebsite=self.webpackChunkwebsite||[]).push([["30992"],{83119:function(e,n,t){t.r(n),t.d(n,{frontMatter:()=>l,default:()=>h,contentTitle:()=>c,assets:()=>d,toc:()=>u,metadata:()=>a});var a=JSON.parse('{"type":"mdx","permalink":"/tests/pages/diagrams","source":"@site/_dogfooding/_pages tests/diagrams.mdx","title":"Diagram Examples","description":"Invalid Diagrams","frontMatter":{},"lastUpdatedBy":"S\xe9bastien Lorber","lastUpdatedAt":1744293302000,"editUrl":"https://github.com/facebook/docusaurus/edit/main/website/_dogfooding/_pages tests/diagrams.mdx","unlisted":false}'),i=t(85893),r=t(80980),s=t(15398),o=t(58636);let l={},c="Diagram Examples",d={},u=[{value:"Invalid Diagrams",id:"invalid-diagrams",level:2},{value:"Invalid type",id:"invalid-type",level:3},{value:"Invalid content",id:"invalid-content",level:3},{value:"Sequence Diagram",id:"sequence-diagram",level:2},{value:"Sequence Diagram (forest theme directive)",id:"sequence-diagram-forest-theme-directive",level:2},{value:"Gantt Chart",id:"gantt-chart",level:2},{value:"Flow Chart",id:"flow-chart",level:2},{value:"With Markdown:",id:"with-markdown",level:3},{value:"Class Diagram",id:"class-diagram",level:2},{value:"State Diagram",id:"state-diagram",level:2},{value:"Entity Relationship Diagram",id:"entity-relationship-diagram",level:2},{value:"User Journey",id:"user-journey",level:2},{value:"Pie Chart",id:"pie-chart",level:2},{value:"Requirement Diagram",id:"requirement-diagram",level:2},{value:"Gitgraph (Git) Diagram",id:"gitgraph-git-diagram",level:2},{value:"Mermaid in tabs",id:"mermaid-in-tabs",level:2},{value:"Mindmap",id:"mindmap",level:2},{value:"Quadrant Chart",id:"quadrant-chart",level:2},{value:"Architecture Diagram",id:"architecture-diagram",level:2}];function m(e){let n={a:"a",admonition:"admonition",code:"code",h1:"h1",h2:"h2",h3:"h3",header:"header",li:"li",mermaid:"mermaid",p:"p",pre:"pre",ul:"ul",...(0,r.a)(),...e.components};return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(n.header,{children:(0,i.jsx)(n.h1,{id:"diagram-examples",children:"Diagram Examples"})}),"\n",(0,i.jsx)(n.h2,{id:"invalid-diagrams",children:"Invalid Diagrams"}),"\n",(0,i.jsx)(n.p,{children:"Those errors should not crash the whole page"}),"\n",(0,i.jsx)(n.h3,{id:"invalid-type",children:"Invalid type"}),"\n",(0,i.jsx)(n.mermaid,{value:"badType\n participant Alice\n participant Bob"}),"\n",(0,i.jsx)(n.h3,{id:"invalid-content",children:"Invalid content"}),"\n",(0,i.jsx)(n.mermaid,{value:"sequenceDiagram\n badInstruction Alice\n participant Bob"}),"\n",(0,i.jsx)(n.h2,{id:"sequence-diagram",children:"Sequence Diagram"}),"\n",(0,i.jsx)(n.mermaid,{value:"sequenceDiagram\n participant Alice\n participant Bob\n Alice->>John: Hello John, how are you?\n loop Health check\n John->>John: Fight against hypochondria\n end\n Note right of John: Rational thoughts
prevail!\n John--\x3e>Alice: Great!\n John->>Bob: How about you?\n Bob--\x3e>John: Jolly good!"}),"\n",(0,i.jsx)(n.h2,{id:"sequence-diagram-forest-theme-directive",children:"Sequence Diagram (forest theme directive)"}),"\n",(0,i.jsx)(n.p,{children:"It is possible to override default config locally with Mermaid text directives such as:"}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{children:'%%{init: { "theme": "forest" } }%%\n'})}),"\n",(0,i.jsx)(n.mermaid,{value:'%%{init: { "theme": "forest" } }%%\n\nsequenceDiagram\n participant Alice\n participant Bob\n Alice->>John: Hello John, how are you?\n loop Health check\n John->>John: Fight against hypochondria\n end\n Note right of John: Rational thoughts
prevail!\n John--\x3e>Alice: Great!\n John->>Bob: How about you?\n Bob--\x3e>John: Jolly good!'}),"\n",(0,i.jsx)(n.h2,{id:"gantt-chart",children:"Gantt Chart"}),"\n",(0,i.jsx)(n.mermaid,{value:"gantt\ndateFormat YYYY-MM-DD\ntitle Adding GANTT diagram to mermaid\nexcludes weekdays 2014-01-10\n\nsection A section\nCompleted task :done, des1, 2014-01-06,2014-01-08\nActive task :active, des2, 2014-01-09, 3d\nFuture task : des3, after des2, 5d\nFuture task2 : des4, after des3, 5d"}),"\n",(0,i.jsx)(n.h2,{id:"flow-chart",children:"Flow Chart"}),"\n",(0,i.jsx)(n.mermaid,{value:"flowchart TD\n A[Start] --\x3e B{Is it?}\n B --\x3e|Yes| C[OK]\n C --\x3e D[Rethink]\n D --\x3e B\n B ----\x3e|No| E[End]"}),"\n",(0,i.jsx)(n.h3,{id:"with-markdown",children:"With Markdown:"}),"\n",(0,i.jsx)(n.mermaid,{value:'flowchart LR\n markdown["`This **is** _Markdown_`"]\n newLines["`Line1\n Line 2\n Line 3`"]\n markdown --\x3e newLines'}),"\n",(0,i.jsx)(n.h2,{id:"class-diagram",children:"Class Diagram"}),"\n",(0,i.jsx)(n.mermaid,{value:" classDiagram\n Animal <|-- Duck\n Animal <|-- Fish\n Animal <|-- Zebra\n Animal : +int age\n Animal : +String gender\n Animal: +isMammal()\n Animal: +mate()\n class Duck{\n +String beakColor\n +swim()\n +quack()\n }\n class Fish{\n -int sizeInFeet\n -canEat()\n }\n class Zebra{\n +bool is_wild\n +run()\n }"}),"\n",(0,i.jsx)(n.h2,{id:"state-diagram",children:"State Diagram"}),"\n",(0,i.jsx)(n.mermaid,{value:"stateDiagram-v2\n [*] --\x3e Active\n\n state Active {\n [*] --\x3e NumLockOff\n NumLockOff --\x3e NumLockOn : EvNumLockPressed\n NumLockOn --\x3e NumLockOff : EvNumLockPressed\n --\n [*] --\x3e CapsLockOff\n CapsLockOff --\x3e CapsLockOn : EvCapsLockPressed\n CapsLockOn --\x3e CapsLockOff : EvCapsLockPressed\n --\n [*] --\x3e ScrollLockOff\n ScrollLockOff --\x3e ScrollLockOn : EvScrollLockPressed\n ScrollLockOn --\x3e ScrollLockOff : EvScrollLockPressed\n }"}),"\n",(0,i.jsx)(n.h2,{id:"entity-relationship-diagram",children:"Entity Relationship Diagram"}),"\n",(0,i.jsx)(n.mermaid,{value:"erDiagram\n CAR ||--o{ NAMED-DRIVER : allows\n CAR {\n string registrationNumber\n string make\n string model\n }\n PERSON ||--o{ NAMED-DRIVER : is\n PERSON {\n string firstName\n string lastName\n int age\n }"}),"\n",(0,i.jsx)(n.h2,{id:"user-journey",children:"User Journey"}),"\n",(0,i.jsx)(n.mermaid,{value:"journey\n title My working day\n section Go to work\n Make tea: 5: Me\n Go upstairs: 3: Me\n Do work: 1: Me, Cat\n section Go home\n Go downstairs: 5: Me\n Sit down: 5: Me"}),"\n",(0,i.jsx)(n.admonition,{type:"note",children:(0,i.jsxs)(n.p,{children:["If there's too much space above it's due to a ",(0,i.jsx)(n.a,{href:"https://github.com/mermaid-js/mermaid/issues/3501",children:"Mermaid bug"})]})}),"\n",(0,i.jsx)(n.h2,{id:"pie-chart",children:"Pie Chart"}),"\n",(0,i.jsx)(n.mermaid,{value:'pie showData\n title Key elements in Product X\n "Calcium" : 42.96\n "Potassium" : 50.05\n "Magnesium" : 10.01\n "Iron" : 5'}),"\n",(0,i.jsx)(n.h2,{id:"requirement-diagram",children:"Requirement Diagram"}),"\n",(0,i.jsx)(n.mermaid,{value:' requirementDiagram\n\n requirement test_req {\n id: 1\n text: the test text.\n risk: high\n verifymethod: test\n }\n\n functionalRequirement test_req2 {\n id: 1.1\n text: the second test text.\n risk: low\n verifymethod: inspection\n }\n\n performanceRequirement test_req3 {\n id: 1.2\n text: the third test text.\n risk: medium\n verifymethod: demonstration\n }\n\n interfaceRequirement test_req4 {\n id: 1.2.1\n text: the fourth test text.\n risk: medium\n verifymethod: analysis\n }\n\n physicalRequirement test_req5 {\n id: 1.2.2\n text: the fifth test text.\n risk: medium\n verifymethod: analysis\n }\n\n designConstraint test_req6 {\n id: 1.2.3\n text: the sixth test text.\n risk: medium\n verifymethod: analysis\n }\n\n element test_entity {\n type: simulation\n }\n\n element test_entity2 {\n type: word doc\n docRef: reqs/test_entity\n }\n\n element test_entity3 {\n type: "test suite"\n docRef: github.com/all_the_tests\n }\n\n\n test_entity - satisfies -> test_req2\n test_req - traces -> test_req2\n test_req - contains -> test_req3\n test_req3 - contains -> test_req4\n test_req4 - derives -> test_req5\n test_req5 - refines -> test_req6\n test_entity3 - verifies -> test_req5\n test_req <- copies - test_entity2'}),"\n",(0,i.jsx)(n.h2,{id:"gitgraph-git-diagram",children:"Gitgraph (Git) Diagram"}),"\n",(0,i.jsx)(n.mermaid,{value:"%%{init: { 'logLevel': 'debug', 'theme': 'base' } }%%\n gitGraph\n commit\n branch hotfix\n checkout hotfix\n commit\n branch develop\n checkout develop\n commit id:\"ash\" tag:\"abc\"\n branch featureB\n checkout featureB\n commit type:HIGHLIGHT\n checkout main\n checkout hotfix\n commit type:NORMAL\n checkout develop\n commit type:REVERSE\n checkout featureB\n commit\n checkout main\n merge hotfix\n checkout featureB\n commit\n checkout develop\n branch featureA\n commit\n checkout develop\n merge hotfix\n checkout featureA\n commit\n checkout featureB\n commit\n checkout develop\n merge featureA\n branch release\n checkout release\n commit\n checkout main\n commit\n checkout release\n merge main\n checkout develop\n merge release"}),"\n",(0,i.jsx)(n.h2,{id:"mermaid-in-tabs",children:"Mermaid in tabs"}),"\n","\n",(0,i.jsxs)(s.Z,{children:[(0,i.jsxs)(o.Z,{value:"tab-a",children:[(0,i.jsx)(n.p,{children:"The following mermaid diagram is shown:"}),(0,i.jsx)(n.mermaid,{value:"graph LR\n a ---\x3e c(10)\n b ---\x3e c(10)"})]}),(0,i.jsxs)(o.Z,{value:"tab-b",children:[(0,i.jsx)(n.p,{children:"This mermaid diagram is not displayed:"}),(0,i.jsx)(n.mermaid,{value:"graph LR\n d ---\x3e z(42)\n e ---\x3e z(42)"})]})]}),"\n",(0,i.jsx)(n.h2,{id:"mindmap",children:"Mindmap"}),"\n",(0,i.jsx)(n.mermaid,{value:"mindmap\n root((conda-forge))\n (Repos)\n (Package building)\n [*-feedstock]\n [staged-recipes]\n [cdt-builds]\n [msys2-recipes]\n (Maintenance)\n [admin-requests]\n [repodata-patches]\n (Configuration)\n [.github]\n [.cirun]\n [conda-forge-pinning]\n [conda-forge-ci-setup]\n [docker-images]\n [conda-smithy]\n (Automations)\n [admin-migrations]\n [artifact-validation]\n [regro/cf-scripts]\n [conda-forge-webservices]\n [regro/cf-graph-countyfair]\n [regro/libcfgraph + regro/libcflib]\n [feedstock-outputs]\n (Communications)\n [conda-forge.github.io]\n [blog]\n [status]\n [by-the-numbers]\n [conda-forge-status-monitor]\n [feedstocks]\n (Bots & apps)\n [conda-forge-admin]\n [conda-forge-bot]\n [conda-forge-coordinator]\n [conda-forge-daemon]\n [conda-forge-linter]\n [conda-forge-manager]\n [conda-forge-status]\n [regro-cf-autotick-bot]\n [conda-forge-curator]\n [conda-forge-webservices]\n (Delivery)\n [anaconda.org]\n [ghcr.io]\n [quay.io]\n (Installers)\n Miniforge\n Mambaforge\n (CI for builds)\n Azure Pipelines\n Travis CI\n cirun.io\n (Infra)\n Heroku\n Github Actions\n Circle CI"}),"\n",(0,i.jsx)(n.h2,{id:"quadrant-chart",children:"Quadrant Chart"}),"\n",(0,i.jsx)(n.mermaid,{value:"quadrantChart\n title Reach and engagement of campaigns\n x-axis Low Reach --\x3e High Reach\n y-axis Low Engagement --\x3e High Engagement\n quadrant-1 We should expand\n quadrant-2 Need to promote\n quadrant-3 Re-evaluate\n quadrant-4 May be improved\n Campaign A: [0.3, 0.6]\n Campaign B: [0.45, 0.23]\n Campaign C: [0.57, 0.69]\n Campaign D: [0.78, 0.34]\n Campaign E: [0.40, 0.34]\n Campaign F: [0.35, 0.78]"}),"\n",(0,i.jsx)(n.h2,{id:"architecture-diagram",children:"Architecture Diagram"}),"\n",(0,i.jsxs)(n.ul,{children:["\n",(0,i.jsxs)(n.li,{children:["See ",(0,i.jsx)(n.a,{href:"https://mermaid.js.org/syntax/architecture",children:"https://mermaid.js.org/syntax/architecture"})]}),"\n",(0,i.jsxs)(n.li,{children:["See ",(0,i.jsx)(n.a,{href:"https://github.com/facebook/docusaurus/discussions/10508",children:"https://github.com/facebook/docusaurus/discussions/10508"})]}),"\n"]}),"\n",(0,i.jsx)(n.mermaid,{value:"architecture-beta\n group api(cloud)[API]\n\n service db(database)[Database] in api\n service disk1(disk)[Storage] in api\n service disk2(disk)[Storage] in api\n service server(server)[Server] in api\n\n db:L -- R:server\n disk1:T -- B:server\n disk2:T -- B:db"})]})}function h(e={}){let{wrapper:n}={...(0,r.a)(),...e.components};return n?(0,i.jsx)(n,{...e,children:(0,i.jsx)(m,{...e})}):m(e)}},58636:function(e,n,t){t.d(n,{Z:()=>r});var a=t(85893);t(67294);var i=t(90496);function r(e){let{children:n,hidden:t,className:r}=e;return(0,a.jsx)("div",{role:"tabpanel",className:(0,i.Z)("tabItem_pnkT",r),hidden:t,children:n})}},15398:function(e,n,t){t.d(n,{Z:()=>b});var a=t(85893),i=t(67294),r=t(90496),s=t(54947),o=t(3620),l=t(844),c=t(97486),d=t(32263),u=t(16971);function m(e){return i.Children.toArray(e).filter(e=>"\n"!==e).map(e=>{if(!e||(0,i.isValidElement)(e)&&function(e){let{props:n}=e;return!!n&&"object"==typeof n&&"value"in n}(e))return e;throw Error(`Docusaurus error: Badchild <${"string"==typeof e.type?e.type:e.type.name}>: all children of the component should be , and every should have a unique "value" prop.`)})?.filter(Boolean)??[]}function h(e){let{value:n,tabValues:t}=e;return t.some(e=>e.value===n)}var g=t(71607);function p(e){let{className:n,block:t,selectedValue:i,selectValue:o,tabValues:l}=e,c=[],{blockElementScrollPositionUntilNextRender:d}=(0,s.o5)(),u=e=>{let n=e.currentTarget,t=l[c.indexOf(n)].value;t!==i&&(d(n),o(t))},m=e=>{let n=null;switch(e.key){case"Enter":u(e);break;case"ArrowRight":{let t=c.indexOf(e.currentTarget)+1;n=c[t]??c[0];break}case"ArrowLeft":{let t=c.indexOf(e.currentTarget)-1;n=c[t]??c[c.length-1]}}n?.focus()};return(0,a.jsx)("ul",{role:"tablist","aria-orientation":"horizontal",className:(0,r.Z)("tabs",{"tabs--block":t},n),children:l.map(e=>{let{value:n,label:t,attributes:s}=e;return(0,a.jsx)("li",{role:"tab",tabIndex:i===n?0:-1,"aria-selected":i===n,ref:e=>{c.push(e)},onKeyDown:m,onClick:u,...s,className:(0,r.Z)("tabs__item","tabItem_AQgk",s?.className,{"tabs__item--active":i===n}),children:t??n},n)})})}function f(e){let{lazy:n,children:t,selectedValue:s}=e,o=(Array.isArray(t)?t:[t]).filter(Boolean);if(n){let e=o.find(e=>e.props.value===s);return e?(0,i.cloneElement)(e,{className:(0,r.Z)("margin-top--md",e.props.className)}):null}return(0,a.jsx)("div",{className:"margin-top--md",children:o.map((e,n)=>(0,i.cloneElement)(e,{key:n,hidden:e.props.value!==s}))})}function v(e){let n=function(e){let{defaultValue:n,queryString:t=!1,groupId:a}=e,r=function(e){let{values:n,children:t}=e;return(0,i.useMemo)(()=>{let e=n??m(t).map(e=>{let{props:{value:n,label:t,attributes:a,default:i}}=e;return{value:n,label:t,attributes:a,default:i}}),a=(0,d.lx)(e,(e,n)=>e.value===n.value);if(a.length>0)throw Error(`Docusaurus error: Duplicate values "${a.map(e=>e.value).join(", ")}" found in . Every value needs to be unique.`);return e},[n,t])}(e),[s,g]=(0,i.useState)(()=>(function(e){let{defaultValue:n,tabValues:t}=e;if(0===t.length)throw Error("Docusaurus error: the component requires at least one children component");if(n){if(!h({value:n,tabValues:t}))throw Error(`Docusaurus error: The has a defaultValue "${n}" but none of its children has the corresponding value. Available values are: ${t.map(e=>e.value).join(", ")}. If you intend to show no default tab, use defaultValue={null} instead.`);return n}let a=t.find(e=>e.default)??t[0];if(!a)throw Error("Unexpected error: 0 tabValues");return a.value})({defaultValue:n,tabValues:r})),[p,f]=function(e){let{queryString:n=!1,groupId:t}=e,a=(0,o.k6)(),r=function(e){let{queryString:n=!1,groupId:t}=e;if("string"==typeof n)return n;if(!1===n)return null;if(!0===n&&!t)throw Error('Docusaurus error: The component groupId prop is required if queryString=true, because this value is used as the search param name. You can also provide an explicit value such as queryString="my-search-param".');return t??null}({queryString:n,groupId:t});return[(0,c._X)(r),(0,i.useCallback)(e=>{if(!r)return;let n=new URLSearchParams(a.location.search);n.set(r,e),a.replace({...a.location,search:n.toString()})},[r,a])]}({queryString:t,groupId:a}),[v,b]=function(e){let{groupId:n}=e,t=n?`docusaurus.tab.${n}`:null,[a,r]=(0,u.Nk)(t);return[a,(0,i.useCallback)(e=>{t&&r.set(e)},[t,r])]}({groupId:a}),x=(()=>{let e=p??v;return h({value:e,tabValues:r})?e:null})();return(0,l.Z)(()=>{x&&g(x)},[x]),{selectedValue:s,selectValue:(0,i.useCallback)(e=>{if(!h({value:e,tabValues:r}))throw Error(`Can't select invalid tab value=${e}`);g(e),f(e),b(e)},[f,b,r]),tabValues:r}}(e);return(0,a.jsxs)("div",{className:(0,r.Z)("tabs-container","tabList_Qoir"),children:[(0,a.jsx)(p,{...n,...e}),(0,a.jsx)(f,{...n,...e})]})}function b(e){let n=(0,g.Z)();return(0,a.jsx)(v,{...e,children:m(e.children)},String(n))}},80980:function(e,n,t){t.d(n,{Z:()=>o,a:()=>s});var a=t(67294);let i={},r=a.createContext(i);function s(e){let n=a.useContext(r);return a.useMemo(function(){return"function"==typeof e?e(n):{...n,...e}},[n,e])}function o(e){let n;return n=e.disableParentContext?"function"==typeof e.components?e.components(i):e.components||i:s(e.components),a.createElement(r.Provider,{value:n},e.children)}}}]); \ No newline at end of file diff --git a/assets/js/060daea9.76e2ef54.js b/assets/js/060daea9.939c951b.js similarity index 93% rename from assets/js/060daea9.76e2ef54.js rename to assets/js/060daea9.939c951b.js index d3f8d72b8e..cf152a00fb 100644 --- a/assets/js/060daea9.76e2ef54.js +++ b/assets/js/060daea9.939c951b.js @@ -1 +1 @@ -"use strict";(self.webpackChunkwebsite=self.webpackChunkwebsite||[]).push([["12371"],{98171:function(e,t,s){s.d(t,{Z:()=>a});let a=s.p+"assets/images/social-card-8ca15c1adaeb77ca302178575136a0b6.png"},93837:function(e,t,s){s.d(t,{Z:()=>a});let a=s.p+"assets/images/social-card-8ca15c1adaeb77ca302178575136a0b6.png"},10517:function(e,t,s){s.r(t),s.d(t,{assets:()=>c,contentTitle:()=>i,default:()=>p,frontMatter:()=>o,metadata:()=>a,toc:()=>l});var a=s(3813),r=s(85893),n=s(80980);let o={title:"Docusaurus 3.2",authors:["slorber"],tags:["release"],image:"./img/social-card.png",date:new Date("2024-03-29T00:00:00.000Z")},i=void 0,c={image:s(98171).Z,authorsImageUrls:[void 0]},l=[];function u(e){let t={a:"a",img:"img",p:"p",strong:"strong",...(0,n.a)(),...e.components};return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsxs)(t.p,{children:["We are happy to announce ",(0,r.jsx)(t.strong,{children:"Docusaurus 3.2"}),"."]}),"\n",(0,r.jsxs)(t.p,{children:["The upgrade should be easy: as explained in our ",(0,r.jsx)(t.a,{href:"/community/release-process",children:"release process documentation"}),", minor versions respect ",(0,r.jsx)(t.a,{href:"https://semver.org/",children:"Semantic Versioning"}),"."]}),"\n",(0,r.jsx)(t.p,{children:(0,r.jsx)(t.img,{alt:"Docusaurus blog post social card",src:s(93837).Z+"",width:"1200",height:"600"})})]})}function p(e={}){let{wrapper:t}={...(0,n.a)(),...e.components};return t?(0,r.jsx)(t,{...e,children:(0,r.jsx)(u,{...e})}):u(e)}},80980:function(e,t,s){s.d(t,{Z:()=>i,a:()=>o});var a=s(67294);let r={},n=a.createContext(r);function o(e){let t=a.useContext(n);return a.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),a.createElement(n.Provider,{value:t},e.children)}},3813:function(e){e.exports=JSON.parse('{"permalink":"/blog/releases/3.2","editUrl":"https://github.com/facebook/docusaurus/edit/main/website/blog/releases/3.2/index.mdx","source":"@site/blog/releases/3.2/index.mdx","title":"Docusaurus 3.2","description":"We are happy to announce Docusaurus 3.2.","date":"2024-03-29T00:00:00.000Z","tags":[{"inline":false,"label":"Release","permalink":"/blog/tags/release","description":"Blog posts about Docusaurus\' new releases"}],"readingTime":3.475,"hasTruncateMarker":true,"authors":[{"name":"S\xe9bastien Lorber","title":"Docusaurus maintainer, This Week In React editor","url":"https://thisweekinreact.com","page":{"permalink":"/blog/authors/slorber"},"description":"A freelance React and React-Native developer near Paris and Docusaurus maintainer. Also runs ThisWeekInReact.com, a newsletter to stay updated with the React ecosystem.","socials":{"bluesky":"https://bsky.app/profile/sebastienlorber.com","x":"https://x.com/sebastienlorber","linkedin":"https://www.linkedin.com/in/sebastienlorber/","github":"https://github.com/slorber","instagram":"https://www.instagram.com/thisweekinreact","newsletter":"https://thisweekinreact.com"},"imageURL":"https://github.com/slorber.png","key":"slorber"}],"frontMatter":{"title":"Docusaurus 3.2","authors":["slorber"],"tags":["release"],"image":"./img/social-card.png","date":"2024-03-29T00:00:00.000Z"},"unlisted":false,"lastUpdatedAt":1744155424000,"lastUpdatedBy":"Ben McCann","prevItem":{"title":"Docusaurus 3.3","permalink":"/blog/releases/3.3"},"nextItem":{"title":"Docusaurus 3.1","permalink":"/blog/releases/3.1"}}')}}]); \ No newline at end of file +"use strict";(self.webpackChunkwebsite=self.webpackChunkwebsite||[]).push([["12371"],{98171:function(e,t,s){s.d(t,{Z:()=>a});let a=s.p+"assets/images/social-card-8ca15c1adaeb77ca302178575136a0b6.png"},93837:function(e,t,s){s.d(t,{Z:()=>a});let a=s.p+"assets/images/social-card-8ca15c1adaeb77ca302178575136a0b6.png"},10517:function(e,t,s){s.r(t),s.d(t,{assets:()=>c,contentTitle:()=>i,default:()=>p,frontMatter:()=>o,metadata:()=>a,toc:()=>l});var a=s(3813),r=s(85893),n=s(80980);let o={title:"Docusaurus 3.2",authors:["slorber"],tags:["release"],image:"./img/social-card.png",date:new Date("2024-03-29T00:00:00.000Z")},i=void 0,c={image:s(98171).Z,authorsImageUrls:[void 0]},l=[];function u(e){let t={a:"a",img:"img",p:"p",strong:"strong",...(0,n.a)(),...e.components};return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsxs)(t.p,{children:["We are happy to announce ",(0,r.jsx)(t.strong,{children:"Docusaurus 3.2"}),"."]}),"\n",(0,r.jsxs)(t.p,{children:["The upgrade should be easy: as explained in our ",(0,r.jsx)(t.a,{href:"/community/release-process",children:"release process documentation"}),", minor versions respect ",(0,r.jsx)(t.a,{href:"https://semver.org/",children:"Semantic Versioning"}),"."]}),"\n",(0,r.jsx)(t.p,{children:(0,r.jsx)(t.img,{alt:"Docusaurus blog post social card",src:s(93837).Z+"",width:"1200",height:"600"})})]})}function p(e={}){let{wrapper:t}={...(0,n.a)(),...e.components};return t?(0,r.jsx)(t,{...e,children:(0,r.jsx)(u,{...e})}):u(e)}},80980:function(e,t,s){s.d(t,{Z:()=>i,a:()=>o});var a=s(67294);let r={},n=a.createContext(r);function o(e){let t=a.useContext(n);return a.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),a.createElement(n.Provider,{value:t},e.children)}},3813:function(e){e.exports=JSON.parse('{"permalink":"/blog/releases/3.2","editUrl":"https://github.com/facebook/docusaurus/edit/main/website/blog/releases/3.2/index.mdx","source":"@site/blog/releases/3.2/index.mdx","title":"Docusaurus 3.2","description":"We are happy to announce Docusaurus 3.2.","date":"2024-03-29T00:00:00.000Z","tags":[{"inline":false,"label":"Release","permalink":"/blog/tags/release","description":"Blog posts about Docusaurus\' new releases"}],"readingTime":3.475,"hasTruncateMarker":true,"authors":[{"name":"S\xe9bastien Lorber","title":"Docusaurus maintainer, This Week In React editor","url":"https://thisweekinreact.com","page":{"permalink":"/blog/authors/slorber"},"description":"A freelance React and React-Native developer near Paris and Docusaurus maintainer. Also runs ThisWeekInReact.com, a newsletter to stay updated with the React ecosystem.","socials":{"bluesky":"https://bsky.app/profile/sebastienlorber.com","x":"https://x.com/sebastienlorber","linkedin":"https://www.linkedin.com/in/sebastienlorber/","github":"https://github.com/slorber","instagram":"https://www.instagram.com/thisweekinreact","newsletter":"https://thisweekinreact.com"},"imageURL":"https://github.com/slorber.png","key":"slorber"}],"frontMatter":{"title":"Docusaurus 3.2","authors":["slorber"],"tags":["release"],"image":"./img/social-card.png","date":"2024-03-29T00:00:00.000Z"},"unlisted":false,"lastUpdatedAt":1744293302000,"lastUpdatedBy":"S\xe9bastien Lorber","prevItem":{"title":"Docusaurus 3.3","permalink":"/blog/releases/3.3"},"nextItem":{"title":"Docusaurus 3.1","permalink":"/blog/releases/3.1"}}')}}]); \ No newline at end of file diff --git a/assets/js/06c6ffc3.2f87a7bd.js b/assets/js/06c6ffc3.2f87a7bd.js new file mode 100644 index 0000000000..d9c8105990 --- /dev/null +++ b/assets/js/06c6ffc3.2f87a7bd.js @@ -0,0 +1 @@ +"use strict";(self.webpackChunkwebsite=self.webpackChunkwebsite||[]).push([["79557"],{26933:function(e,n,s){s.r(n),s.d(n,{frontMatter:()=>a,default:()=>p,contentTitle:()=>c,assets:()=>d,toc:()=>h,metadata:()=>i});var i=JSON.parse('{"id":"deployment","title":"Deployment","description":"Deploy your Docusaurus app for production on a range of static site hosting services.","source":"@site/docs/deployment.mdx","sourceDirName":".","slug":"/deployment","permalink":"/docs/deployment","draft":false,"unlisted":false,"editUrl":"https://github.com/facebook/docusaurus/edit/main/website/docs/deployment.mdx","tags":[],"version":"current","lastUpdatedBy":"S\xe9bastien Lorber","lastUpdatedAt":1744293302000,"frontMatter":{"description":"Deploy your Docusaurus app for production on a range of static site hosting services."},"sidebar":"docs","previous":{"title":"Using Plugins","permalink":"/docs/using-plugins"},"next":{"title":"i18n - Introduction","permalink":"/docs/i18n/introduction"}}'),t=s(85893),o=s(80980),r=s(15398),l=s(58636);let a={description:"Deploy your Docusaurus app for production on a range of static site hosting services."},c="Deployment",d={},h=[{value:"Configuration",id:"configuration",level:2},{value:"Testing your Build Locally",id:"testing-build-locally",level:2},{value:"Trailing slash configuration",id:"trailing-slashes",level:2},{value:"Using environment variables",id:"using-environment-variables",level:2},{value:"Choosing a hosting provider",id:"choosing-a-hosting-provider",level:2},{value:"Self-Hosting",id:"self-hosting",level:2},{value:"Deploying to Netlify",id:"deploying-to-netlify",level:2},{value:"Deploying to Vercel",id:"deploying-to-vercel",level:2},{value:"Deploying to GitHub Pages",id:"deploying-to-github-pages",level:2},{value:"Overview",id:"github-pages-overview",level:3},{value:" docusaurus.config.js
settings",id:"docusaurusconfigjs-settings",level:3},{value:"Environment settings",id:"environment-settings",level:3},{value:"Deploy",id:"deploy",level:3},{value:"Triggering deployment with GitHub Actions",id:"triggering-deployment-with-github-actions",level:3},{value:"Triggering deployment with Travis CI",id:"triggering-deployment-with-travis-ci",level:3},{value:"Triggering deployment with Buddy",id:"triggering-deployment-with-buddy",level:3},{value:"Using Azure Pipelines",id:"using-azure-pipelines",level:3},{value:"Using Drone",id:"using-drone",level:3},{value:"Deploying to Flightcontrol",id:"deploying-to-flightcontrol",level:2},{value:"Deploying to Koyeb",id:"deploying-to-koyeb",level:2},{value:"Deploying to Render",id:"deploying-to-render",level:2},{value:"Deploying to Qovery",id:"deploying-to-qovery",level:2},{value:"Deploying to Hostman",id:"deploying-to-hostman",level:2},{value:"Deploying to Surge",id:"deploying-to-surge",level:2},{value:"Using your domain",id:"using-your-domain",level:3},{value:"Setting up CNAME file",id:"setting-up-cname-file",level:3},{value:"Deploying to Stormkit",id:"deploying-to-stormkit",level:2},{value:"Deploying to QuantCDN",id:"deploying-to-quantcdn",level:2},{value:"Deploying to Layer0",id:"deploying-to-layer0",level:2},{value:"Deploying to Cloudflare Pages",id:"deploying-to-cloudflare-pages",level:2},{value:"Deploying to Azure Static Web Apps",id:"deploying-to-azure-static-web-apps",level:2},{value:"Deploying to Kinsta",id:"deploying-to-kinsta",level:2}];function u(e){let n={a:"a",admonition:"admonition",code:"code",em:"em",h1:"h1",h2:"h2",h3:"h3",header:"header",img:"img",li:"li",ol:"ol",p:"p",pre:"pre",strong:"strong",table:"table",tbody:"tbody",td:"td",th:"th",thead:"thead",tr:"tr",ul:"ul",...(0,o.a)(),...e.components},{Details:s}=n;return s||function(e,n){throw Error("Expected "+(n?"component":"object")+" `"+e+"` to be defined: you likely forgot to import, pass, or provide it.")}("Details",!0),(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(n.header,{children:(0,t.jsx)(n.h1,{id:"deployment",children:"Deployment"})}),"\n",(0,t.jsx)(n.p,{children:"To build the static files of your website for production, run:"}),"\n",(0,t.jsxs)(r.Z,{groupId:"npm2yarn",children:[(0,t.jsx)(l.Z,{value:"npm",children:(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-bash",children:"npm run build\n"})})}),(0,t.jsx)(l.Z,{value:"yarn",label:"Yarn",children:(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-bash",children:"yarn build\n"})})}),(0,t.jsx)(l.Z,{value:"pnpm",label:"pnpm",children:(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-bash",children:"pnpm run build\n"})})}),(0,t.jsx)(l.Z,{value:"bun",label:"Bun",children:(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-bash",children:"bun run build\n"})})})]}),"\n",(0,t.jsxs)(n.p,{children:["Once it finishes, the static files will be generated within the ",(0,t.jsx)(n.code,{children:"build"})," directory."]}),"\n",(0,t.jsxs)(n.admonition,{type:"note",children:[(0,t.jsxs)(n.p,{children:["The only responsibility of Docusaurus is to build your site and emit static files in ",(0,t.jsx)(n.code,{children:"build"}),"."]}),(0,t.jsx)(n.p,{children:"It is now up to you to choose how to host those static files."})]}),"\n",(0,t.jsxs)(n.p,{children:["You can deploy your site to static site hosting services such as ",(0,t.jsx)(n.a,{href:"https://vercel.com/",children:"Vercel"}),", ",(0,t.jsx)(n.a,{href:"https://pages.github.com/",children:"GitHub Pages"}),", ",(0,t.jsx)(n.a,{href:"https://www.netlify.com/",children:"Netlify"}),", ",(0,t.jsx)(n.a,{href:"https://render.com/docs/static-sites",children:"Render"}),", and ",(0,t.jsx)(n.a,{href:"https://surge.sh/help/getting-started-with-surge",children:"Surge"}),"."]}),"\n",(0,t.jsx)(n.p,{children:"A Docusaurus site is statically rendered, and it can generally work without JavaScript!"}),"\n",(0,t.jsx)(n.h2,{id:"configuration",children:"Configuration"}),"\n",(0,t.jsxs)(n.p,{children:["The following parameters are required in ",(0,t.jsx)(n.code,{children:"docusaurus.config.js"})," to optimize routing and serve files from the correct location:"]}),"\n",(0,t.jsxs)(n.table,{children:[(0,t.jsx)(n.thead,{children:(0,t.jsxs)(n.tr,{children:[(0,t.jsx)(n.th,{children:"Name"}),(0,t.jsx)(n.th,{children:"Description"})]})}),(0,t.jsxs)(n.tbody,{children:[(0,t.jsxs)(n.tr,{children:[(0,t.jsx)(n.td,{children:(0,t.jsx)(n.code,{children:"url"})}),(0,t.jsxs)(n.td,{children:["URL for your site. For a site deployed at ",(0,t.jsx)(n.code,{children:"https://my-org.com/my-project/"}),", ",(0,t.jsx)(n.code,{children:"url"})," is ",(0,t.jsx)(n.code,{children:"https://my-org.com/"}),"."]})]}),(0,t.jsxs)(n.tr,{children:[(0,t.jsx)(n.td,{children:(0,t.jsx)(n.code,{children:"baseUrl"})}),(0,t.jsxs)(n.td,{children:["Base URL for your project, with a trailing slash. For a site deployed at ",(0,t.jsx)(n.code,{children:"https://my-org.com/my-project/"}),", ",(0,t.jsx)(n.code,{children:"baseUrl"})," is ",(0,t.jsx)(n.code,{children:"/my-project/"}),"."]})]})]})]}),"\n",(0,t.jsx)(n.h2,{id:"testing-build-locally",children:"Testing your Build Locally"}),"\n",(0,t.jsxs)(n.p,{children:["It is important to test your build locally before deploying it for production. Docusaurus provides a ",(0,t.jsx)(n.a,{href:"/docs/cli#docusaurus-serve-sitedir",children:(0,t.jsx)(n.code,{children:"docusaurus serve"})})," command for that:"]}),"\n",(0,t.jsxs)(r.Z,{groupId:"npm2yarn",children:[(0,t.jsx)(l.Z,{value:"npm",children:(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-bash",children:"npm run serve\n"})})}),(0,t.jsx)(l.Z,{value:"yarn",label:"Yarn",children:(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-bash",children:"yarn serve\n"})})}),(0,t.jsx)(l.Z,{value:"pnpm",label:"pnpm",children:(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-bash",children:"pnpm run serve\n"})})}),(0,t.jsx)(l.Z,{value:"bun",label:"Bun",children:(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-bash",children:"bun run serve\n"})})})]}),"\n",(0,t.jsxs)(n.p,{children:["By default, this will load your site at ",(0,t.jsx)(n.a,{href:"http://localhost:3000/",children:(0,t.jsx)(n.code,{children:"http://localhost:3000/"})}),"."]}),"\n",(0,t.jsx)(n.h2,{id:"trailing-slashes",children:"Trailing slash configuration"}),"\n",(0,t.jsxs)(n.p,{children:["Docusaurus has a ",(0,t.jsxs)(n.a,{href:"/docs/api/docusaurus-config#trailingSlash",children:[(0,t.jsx)(n.code,{children:"trailingSlash"})," config"]})," to allow customizing URLs/links and emitted filename patterns."]}),"\n",(0,t.jsxs)(n.p,{children:["The default value generally works fine. Unfortunately, each static hosting provider has a ",(0,t.jsx)(n.strong,{children:"different behavior"}),", and deploying the exact same site to various hosts can lead to distinct results. Depending on your host, it can be useful to change this config."]}),"\n",(0,t.jsx)(n.admonition,{type:"tip",children:(0,t.jsxs)(n.p,{children:["Use ",(0,t.jsx)(n.a,{href:"https://github.com/slorber/trailing-slash-guide",children:"slorber/trailing-slash-guide"})," to understand better the behavior of your host and configure ",(0,t.jsx)(n.code,{children:"trailingSlash"})," appropriately."]})}),"\n",(0,t.jsx)(n.h2,{id:"using-environment-variables",children:"Using environment variables"}),"\n",(0,t.jsxs)(n.p,{children:["Putting potentially sensitive information in the environment is common practice. However, in a typical Docusaurus website, the ",(0,t.jsx)(n.code,{children:"docusaurus.config.js"})," file is the only interface to the Node.js environment (see ",(0,t.jsx)(n.a,{href:"/docs/advanced/architecture",children:"our architecture overview"}),"), while everything else (MDX pages, React components, etc.) are client side and do not have direct access to the ",(0,t.jsx)(n.code,{children:"process"})," global variable. In this case, you can consider using ",(0,t.jsx)(n.a,{href:"/docs/api/docusaurus-config#customFields",children:(0,t.jsx)(n.code,{children:"customFields"})})," to pass environment variables to the client side."]}),"\n",(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-js",metastring:'title="docusaurus.config.js"',children:"// If you are using dotenv (https://www.npmjs.com/package/dotenv)\nimport 'dotenv/config';\n\nexport default {\n title: '...',\n url: process.env.URL, // You can use environment variables to control site specifics as well\n // highlight-start\n customFields: {\n // Put your custom environment here\n teamEmail: process.env.EMAIL,\n },\n // highlight-end\n};\n"})}),"\n",(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-jsx",metastring:'title="home.jsx"',children:"import useDocusaurusContext from '@docusaurus/useDocusaurusContext';\n\nexport default function Home() {\n const {\n siteConfig: {customFields},\n } = useDocusaurusContext();\n returnContact us through {customFields.teamEmail}!;\n}\n"})}),"\n",(0,t.jsx)(n.h2,{id:"choosing-a-hosting-provider",children:"Choosing a hosting provider"}),"\n",(0,t.jsx)(n.p,{children:"There are a few common hosting options:"}),"\n",(0,t.jsxs)(n.ul,{children:["\n",(0,t.jsxs)(n.li,{children:[(0,t.jsx)(n.a,{href:"#self-hosting",children:"Self hosting"})," with an HTTP server like Apache2 or Nginx."]}),"\n",(0,t.jsxs)(n.li,{children:["Jamstack providers (e.g. ",(0,t.jsx)(n.a,{href:"#deploying-to-netlify",children:"Netlify"})," and ",(0,t.jsx)(n.a,{href:"#deploying-to-vercel",children:"Vercel"}),"). We will use them as references, but the same reasoning can apply to other providers."]}),"\n",(0,t.jsxs)(n.li,{children:[(0,t.jsx)(n.a,{href:"#deploying-to-github-pages",children:"GitHub Pages"})," (by definition, it is also Jamstack, but we compare it separately)."]}),"\n"]}),"\n",(0,t.jsx)(n.p,{children:"If you are unsure of which one to choose, ask the following questions:"}),"\n",(0,t.jsxs)(s,{children:[(0,t.jsx)("summary",{children:(0,t.jsx)(n.p,{children:"How many resources (money, person-hours, etc.) am I willing to invest in this?"})}),(0,t.jsxs)(n.ul,{children:["\n",(0,t.jsx)(n.li,{children:"\uD83D\uDD34 Self-hosting requires experience in networking as well as Linux and web server administration. It's the most difficult option, and would require the most time to manage successfully. Expense-wise, cloud services are almost never free, and purchasing/deploying an onsite server can be even more costly."}),"\n",(0,t.jsx)(n.li,{children:"\uD83D\uDFE2 Jamstack providers can help you set up a working website in almost no time and offer features like server-side redirects that are easily configurable. Many providers offer generous build-time quotas even for free plans that you would almost never exceed. However, free plans have limits, and you would need to pay once you hit those limits. Check the pricing page of your provider for details."}),"\n",(0,t.jsxs)(n.li,{children:["\uD83D\uDFE1 The GitHub Pages deployment workflow can be tedious to set up. (Evidence: see the length of ",(0,t.jsx)(n.a,{href:"#deploying-to-github-pages",children:"Deploying to GitHub Pages"}),"!) However, this service (including build and deployment) is always free for public repositories, and we have detailed instructions to help you make it work."]}),"\n"]})]}),"\n",(0,t.jsxs)(s,{children:[(0,t.jsx)("summary",{children:"How much server-side customization do I need?"}),(0,t.jsxs)(n.ul,{children:["\n",(0,t.jsx)(n.li,{children:"\uD83D\uDFE2 With self-hosting, you have access to the entire server's configuration. You can configure the virtual host to serve different content based on the request URL, you can do complicated server-side redirects, you can implement authentication, and so on. If you need a lot of server-side features, self-host your website."}),"\n",(0,t.jsx)(n.li,{children:"\uD83D\uDFE1 Jamstack usually offers some server-side configuration (e.g. URL formatting (trailing slashes), server-side redirects, etc.)."}),"\n",(0,t.jsx)(n.li,{children:"\uD83D\uDD34 GitHub Pages doesn't expose server-side configuration besides enforcing HTTPS and setting CNAME records."}),"\n"]})]}),"\n",(0,t.jsxs)(s,{children:[(0,t.jsx)("summary",{children:"Do I need collaboration-friendly deployment workflows?"}),(0,t.jsxs)(n.ul,{children:["\n",(0,t.jsx)(n.li,{children:"\uD83D\uDFE1 Self-hosted services can leverage continuous deployment functionality like Netlify, but more heavy-lifting is involved. Usually, you would designate a specific person to manage the deployment, and the workflow wouldn't be very git-based as opposed to the other two options."}),"\n",(0,t.jsx)(n.li,{children:"\uD83D\uDFE2 Netlify and Vercel have deploy previews for every pull request, which is useful for a team to review work before merging to production. You can also manage a team with different member access to the deployment."}),"\n",(0,t.jsx)(n.li,{children:"\uD83D\uDFE1 GitHub Pages cannot do deploy previews in a non-convoluted way. One repo can only be associated with one site deployment. On the other hand, you can control who has write access to the site's deployment."}),"\n"]})]}),"\n",(0,t.jsx)(n.p,{children:"There isn't a silver bullet. You need to weigh your needs and resources before making a choice."}),"\n",(0,t.jsx)(n.h2,{id:"self-hosting",children:"Self-Hosting"}),"\n",(0,t.jsxs)(n.p,{children:["Docusaurus can be self-hosted using ",(0,t.jsx)(n.a,{href:"/docs/cli#docusaurus-serve-sitedir",children:(0,t.jsx)(n.code,{children:"docusaurus serve"})}),". Change port using ",(0,t.jsx)(n.code,{children:"--port"})," and ",(0,t.jsx)(n.code,{children:"--host"})," to change host."]}),"\n",(0,t.jsxs)(r.Z,{groupId:"npm2yarn",children:[(0,t.jsx)(l.Z,{value:"npm",children:(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-bash",children:"npm run serve -- --build --port 80 --host 0.0.0.0\n"})})}),(0,t.jsx)(l.Z,{value:"yarn",label:"Yarn",children:(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-bash",children:"yarn serve --build --port 80 --host 0.0.0.0\n"})})}),(0,t.jsx)(l.Z,{value:"pnpm",label:"pnpm",children:(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-bash",children:"pnpm run serve --build --port 80 --host 0.0.0.0\n"})})}),(0,t.jsx)(l.Z,{value:"bun",label:"Bun",children:(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-bash",children:"bun run serve --build --port 80 --host 0.0.0.0\n"})})})]}),"\n",(0,t.jsx)(n.admonition,{type:"warning",children:(0,t.jsx)(n.p,{children:"It is not the best option, compared to a static hosting provider / CDN."})}),"\n",(0,t.jsxs)(n.admonition,{type:"warning",children:[(0,t.jsx)(n.p,{children:"In the following sections, we will introduce a few common hosting providers and how they should be configured to deploy Docusaurus sites most efficiently. Docusaurus is not affiliated with any of these services, and this information is provided for convenience only. Some of the write-ups are provided by third-parties, and recent API changes may not be reflected on our side. If you see outdated content, PRs are welcome."}),(0,t.jsx)(n.p,{children:"Because we can only provide this content on a best-effort basis only, we have stopped accepting PRs adding new hosting options. You can, however, publish your writeup on a separate site (e.g. your blog, or the provider's official website), and ask us to include a link to your writeup."})]}),"\n",(0,t.jsx)(n.h2,{id:"deploying-to-netlify",children:"Deploying to Netlify"}),"\n",(0,t.jsxs)(n.p,{children:["To deploy your Docusaurus sites to ",(0,t.jsx)(n.a,{href:"https://www.netlify.com/",children:"Netlify"}),", first make sure the following options are properly configured:"]}),"\n",(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-js",metastring:'title="docusaurus.config.js"',children:"export default {\n // highlight-start\n url: 'https://docusaurus-2.netlify.app', // Url to your site with no trailing slash\n baseUrl: '/', // Base directory of your site relative to your repo\n // highlight-end\n // ...\n};\n"})}),"\n",(0,t.jsxs)(n.p,{children:["Then, ",(0,t.jsx)(n.a,{href:"https://app.netlify.com/start",children:"create your site with Netlify"}),"."]}),"\n",(0,t.jsx)(n.p,{children:"While you set up the site, specify the build commands and directories as follows:"}),"\n",(0,t.jsxs)(n.ul,{children:["\n",(0,t.jsxs)(n.li,{children:["build command: ",(0,t.jsx)(n.code,{children:"npm run build"})]}),"\n",(0,t.jsxs)(n.li,{children:["publish directory: ",(0,t.jsx)(n.code,{children:"build"})]}),"\n"]}),"\n",(0,t.jsx)(n.p,{children:'If you did not configure these build options, you may still go to "Site settings" -> "Build & deploy" after your site is created.'}),"\n",(0,t.jsxs)(n.p,{children:["Once properly configured with the above options, your site should deploy and automatically redeploy upon merging to your deploy branch, which defaults to ",(0,t.jsx)(n.code,{children:"main"}),"."]}),"\n",(0,t.jsxs)(n.admonition,{type:"warning",children:[(0,t.jsxs)(n.p,{children:["Some Docusaurus sites put the ",(0,t.jsx)(n.code,{children:"docs"})," folder outside of ",(0,t.jsx)(n.code,{children:"website"})," (most likely former Docusaurus v1 sites):"]}),(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-bash",children:"repo # git root\n\u251C\u2500\u2500 docs # MD files\n\u2514\u2500\u2500 website # Docusaurus root\n"})}),(0,t.jsxs)(n.p,{children:["If you decide to use the ",(0,t.jsx)(n.code,{children:"website"})," folder as Netlify's base directory, Netlify will not trigger builds when you update the ",(0,t.jsx)(n.code,{children:"docs"})," folder, and you need to configure a ",(0,t.jsxs)(n.a,{href:"https://docs.netlify.com/configure-builds/common-configurations/ignore-builds/",children:["custom ",(0,t.jsx)(n.code,{children:"ignore"})," command"]}),":"]}),(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-toml",metastring:'title="website/netlify.toml"',children:'[build]\n ignore = "git diff --quiet $CACHED_COMMIT_REF $COMMIT_REF . ../docs/"\n'})})]}),"\n",(0,t.jsxs)(n.admonition,{type:"warning",children:[(0,t.jsx)(n.p,{children:"By default, Netlify adds trailing slashes to Docusaurus URLs."}),(0,t.jsxs)(n.p,{children:["It is recommended to disable the Netlify setting ",(0,t.jsx)(n.code,{children:"Post Processing > Asset Optimization > Pretty Urls"})," to prevent lowercase URLs, unnecessary redirects, and 404 errors."]}),(0,t.jsxs)(n.p,{children:[(0,t.jsx)(n.strong,{children:"Be very careful"}),": the ",(0,t.jsx)(n.code,{children:"Disable asset optimization"})," global checkbox is broken and does not really disable the ",(0,t.jsx)(n.code,{children:"Pretty URLs"})," setting in practice. Please make sure to ",(0,t.jsx)(n.strong,{children:"uncheck it independently"}),"."]}),(0,t.jsxs)(n.p,{children:["If you want to keep the ",(0,t.jsx)(n.code,{children:"Pretty Urls"})," Netlify setting on, adjust the ",(0,t.jsx)(n.code,{children:"trailingSlash"})," Docusaurus config appropriately."]}),(0,t.jsxs)(n.p,{children:["Refer to ",(0,t.jsx)(n.a,{href:"https://github.com/slorber/trailing-slash-guide",children:"slorber/trailing-slash-guide"})," for more information."]})]}),"\n",(0,t.jsx)(n.h2,{id:"deploying-to-vercel",children:"Deploying to Vercel"}),"\n",(0,t.jsxs)(n.p,{children:["Deploying your Docusaurus project to ",(0,t.jsx)(n.a,{href:"https://vercel.com/",children:"Vercel"})," will provide you with ",(0,t.jsx)(n.a,{href:"https://vercel.com/",children:"various benefits"})," in the areas of performance and ease of use."]}),"\n",(0,t.jsxs)(n.p,{children:["To deploy your Docusaurus project with a ",(0,t.jsx)(n.a,{href:"https://vercel.com/docs/concepts/git",children:"Vercel for Git Integration"}),", make sure it has been pushed to a Git repository."]}),"\n",(0,t.jsxs)(n.p,{children:["Import the project into Vercel using the ",(0,t.jsx)(n.a,{href:"https://vercel.com/import/git",children:"Import Flow"}),". During the import, you will find all relevant options preconfigured for you; however, you can choose to change any of these ",(0,t.jsx)(n.a,{href:"https://vercel.com/docs/build-step#build-&-development-settings",children:"options"}),"."]}),"\n",(0,t.jsxs)(n.p,{children:["After your project has been imported, all subsequent pushes to branches will generate ",(0,t.jsx)(n.a,{href:"https://vercel.com/docs/platform/deployments#preview",children:"Preview Deployments"}),", and all changes made to the ",(0,t.jsx)(n.a,{href:"https://vercel.com/docs/git-integrations#production-branch",children:"Production Branch"}),' (usually "main" or "master") will result in a ',(0,t.jsx)(n.a,{href:"https://vercel.com/docs/platform/deployments#production",children:"Production Deployment"}),"."]}),"\n",(0,t.jsx)(n.h2,{id:"deploying-to-github-pages",children:"Deploying to GitHub Pages"}),"\n",(0,t.jsxs)(n.p,{children:["Docusaurus provides an easy way to publish to ",(0,t.jsx)(n.a,{href:"https://pages.github.com/",children:"GitHub Pages"}),", which comes free with every GitHub repository."]}),"\n",(0,t.jsx)(n.h3,{id:"github-pages-overview",children:"Overview"}),"\n",(0,t.jsxs)(n.p,{children:["Usually, there are two repositories (at least two branches) involved in a publishing process: the branch containing the source files, and the branch containing the build output to be served with GitHub Pages. In the following tutorial, they will be referred to as ",(0,t.jsx)(n.strong,{children:'"source"'})," and ",(0,t.jsx)(n.strong,{children:'"deployment"'}),", respectively."]}),"\n",(0,t.jsxs)(n.p,{children:["Each GitHub repository is associated with a GitHub Pages service. If the deployment repository is called ",(0,t.jsx)(n.code,{children:"my-org/my-project"})," (where ",(0,t.jsx)(n.code,{children:"my-org"})," is the organization name or username), the deployed site will appear at ",(0,t.jsx)(n.code,{children:"https://my-org.github.io/my-project/"}),". If the deployment repository is called ",(0,t.jsx)(n.code,{children:"my-org/my-org.github.io"})," (the ",(0,t.jsx)(n.em,{children:"organization GitHub Pages repo"}),"), the site will appear at ",(0,t.jsx)(n.code,{children:"https://my-org.github.io/"}),"."]}),"\n",(0,t.jsxs)(n.admonition,{type:"info",children:[(0,t.jsxs)(n.p,{children:["In case you want to use your custom domain for GitHub Pages, create a ",(0,t.jsx)(n.code,{children:"CNAME"})," file in the ",(0,t.jsx)(n.code,{children:"static"})," directory. Anything within the ",(0,t.jsx)(n.code,{children:"static"})," directory will be copied to the root of the ",(0,t.jsx)(n.code,{children:"build"})," directory for deployment. When using a custom domain, you should be able to move back from ",(0,t.jsx)(n.code,{children:"baseUrl: '/projectName/'"})," to ",(0,t.jsx)(n.code,{children:"baseUrl: '/'"}),", and also set your ",(0,t.jsx)(n.code,{children:"url"})," to your custom domain."]}),(0,t.jsxs)(n.p,{children:["You may refer to GitHub Pages' documentation ",(0,t.jsx)(n.a,{href:"https://help.github.com/en/articles/user-organization-and-project-pages",children:"User, Organization, and Project Pages"})," for more details."]})]}),"\n",(0,t.jsxs)(n.p,{children:["GitHub Pages picks up deploy-ready files (the output from ",(0,t.jsx)(n.code,{children:"docusaurus build"}),") from the default branch (",(0,t.jsx)(n.code,{children:"master"})," / ",(0,t.jsx)(n.code,{children:"main"}),", usually) or the ",(0,t.jsx)(n.code,{children:"gh-pages"})," branch, and either from the root or the ",(0,t.jsx)(n.code,{children:"/docs"})," folder. You can configure that through ",(0,t.jsx)(n.code,{children:"Settings > Pages"}),' in your repository. This branch will be called the "deployment branch".']}),"\n",(0,t.jsxs)(n.p,{children:["We provide a ",(0,t.jsx)(n.code,{children:"docusaurus deploy"})," command that helps you deploy your site from the source branch to the deployment branch in one command: clone, build, and commit."]}),"\n",(0,t.jsxs)(n.h3,{id:"docusaurusconfigjs-settings",children:[(0,t.jsx)(n.code,{children:"docusaurus.config.js"})," settings"]}),"\n",(0,t.jsxs)(n.p,{children:["First, modify your ",(0,t.jsx)(n.code,{children:"docusaurus.config.js"})," and add the following params:"]}),"\n",(0,t.jsxs)(n.table,{children:[(0,t.jsx)(n.thead,{children:(0,t.jsxs)(n.tr,{children:[(0,t.jsx)(n.th,{children:"Name"}),(0,t.jsx)(n.th,{children:"Description"})]})}),(0,t.jsxs)(n.tbody,{children:[(0,t.jsxs)(n.tr,{children:[(0,t.jsx)(n.td,{children:(0,t.jsx)(n.code,{children:"organizationName"})}),(0,t.jsx)(n.td,{children:"The GitHub user or organization that owns the deployment repository."})]}),(0,t.jsxs)(n.tr,{children:[(0,t.jsx)(n.td,{children:(0,t.jsx)(n.code,{children:"projectName"})}),(0,t.jsx)(n.td,{children:"The name of the deployment repository."})]}),(0,t.jsxs)(n.tr,{children:[(0,t.jsx)(n.td,{children:(0,t.jsx)(n.code,{children:"deploymentBranch"})}),(0,t.jsxs)(n.td,{children:["The name of the deployment branch. It defaults to ",(0,t.jsx)(n.code,{children:"'gh-pages'"})," for non-organization GitHub Pages repos (",(0,t.jsx)(n.code,{children:"projectName"})," not ending in ",(0,t.jsx)(n.code,{children:".github.io"}),"). Otherwise, it needs to be explicit as a config field or environment variable."]})]})]})]}),"\n",(0,t.jsxs)(n.p,{children:["These fields also have their environment variable counterparts which have a higher priority: ",(0,t.jsx)(n.code,{children:"ORGANIZATION_NAME"}),", ",(0,t.jsx)(n.code,{children:"PROJECT_NAME"}),", and ",(0,t.jsx)(n.code,{children:"DEPLOYMENT_BRANCH"}),"."]}),"\n",(0,t.jsx)(n.admonition,{type:"warning",children:(0,t.jsxs)(n.p,{children:["GitHub Pages adds a trailing slash to Docusaurus URLs by default. It is recommended to set a ",(0,t.jsx)(n.code,{children:"trailingSlash"})," config (",(0,t.jsx)(n.code,{children:"true"})," or ",(0,t.jsx)(n.code,{children:"false"}),", not ",(0,t.jsx)(n.code,{children:"undefined"}),")."]})}),"\n",(0,t.jsx)(n.p,{children:"Example:"}),"\n",(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-js",metastring:'title="docusaurus.config.js"',children:"export default {\n // ...\n url: 'https://endiliey.github.io', // Your website URL\n baseUrl: '/',\n // highlight-start\n projectName: 'endiliey.github.io',\n organizationName: 'endiliey',\n trailingSlash: false,\n // highlight-end\n // ...\n};\n"})}),"\n",(0,t.jsx)(n.admonition,{type:"warning",children:(0,t.jsxs)(n.p,{children:["By default, GitHub Pages runs published files through ",(0,t.jsx)(n.a,{href:"https://jekyllrb.com/",children:"Jekyll"}),". Since Jekyll will discard any files that begin with ",(0,t.jsx)(n.code,{children:"_"}),", it is recommended that you disable Jekyll by adding an empty file named ",(0,t.jsx)(n.code,{children:".nojekyll"})," file to your ",(0,t.jsx)(n.code,{children:"static"})," directory."]})}),"\n",(0,t.jsx)(n.h3,{id:"environment-settings",children:"Environment settings"}),"\n",(0,t.jsxs)(n.table,{children:[(0,t.jsx)(n.thead,{children:(0,t.jsxs)(n.tr,{children:[(0,t.jsx)(n.th,{children:"Name"}),(0,t.jsx)(n.th,{children:"Description"})]})}),(0,t.jsxs)(n.tbody,{children:[(0,t.jsxs)(n.tr,{children:[(0,t.jsx)(n.td,{children:(0,t.jsx)(n.code,{children:"USE_SSH"})}),(0,t.jsxs)(n.td,{children:["Set to ",(0,t.jsx)(n.code,{children:"true"})," to use SSH instead of the default HTTPS for the connection to the GitHub repo. If the source repo URL is an SSH URL (e.g. ",(0,t.jsx)(n.code,{children:"git@github.com:facebook/docusaurus.git"}),"), ",(0,t.jsx)(n.code,{children:"USE_SSH"})," is inferred to be ",(0,t.jsx)(n.code,{children:"true"}),"."]})]}),(0,t.jsxs)(n.tr,{children:[(0,t.jsx)(n.td,{children:(0,t.jsx)(n.code,{children:"GIT_USER"})}),(0,t.jsxs)(n.td,{children:["The username for a GitHub account that ",(0,t.jsx)(n.strong,{children:"has push access to the deployment repo"}),". For your own repositories, this will usually be your GitHub username. Required if not using SSH, and ignored otherwise."]})]}),(0,t.jsxs)(n.tr,{children:[(0,t.jsx)(n.td,{children:(0,t.jsx)(n.code,{children:"GIT_PASS"})}),(0,t.jsxs)(n.td,{children:["Personal access token of the git user (specified by ",(0,t.jsx)(n.code,{children:"GIT_USER"}),"), to facilitate non-interactive deployment (e.g. continuous deployment)"]})]}),(0,t.jsxs)(n.tr,{children:[(0,t.jsx)(n.td,{children:(0,t.jsx)(n.code,{children:"CURRENT_BRANCH"})}),(0,t.jsxs)(n.td,{children:["The source branch. Usually, the branch will be ",(0,t.jsx)(n.code,{children:"main"})," or ",(0,t.jsx)(n.code,{children:"master"}),", but it could be any branch except for ",(0,t.jsx)(n.code,{children:"gh-pages"}),". If nothing is set for this variable, then the current branch from which ",(0,t.jsx)(n.code,{children:"docusaurus deploy"})," is invoked will be used."]})]}),(0,t.jsxs)(n.tr,{children:[(0,t.jsx)(n.td,{children:(0,t.jsx)(n.code,{children:"GIT_USER_NAME"})}),(0,t.jsxs)(n.td,{children:["The ",(0,t.jsx)(n.code,{children:"git config user.name"})," value to use when pushing to the deployment repo"]})]}),(0,t.jsxs)(n.tr,{children:[(0,t.jsx)(n.td,{children:(0,t.jsx)(n.code,{children:"GIT_USER_EMAIL"})}),(0,t.jsxs)(n.td,{children:["The ",(0,t.jsx)(n.code,{children:"git config user.email"})," value to use when pushing to the deployment repo"]})]})]})]}),"\n",(0,t.jsx)(n.p,{children:"GitHub enterprise installations should work in the same manner as github.com; you only need to set the organization's GitHub Enterprise host as an environment variable:"}),"\n",(0,t.jsxs)(n.table,{children:[(0,t.jsx)(n.thead,{children:(0,t.jsxs)(n.tr,{children:[(0,t.jsx)(n.th,{children:"Name"}),(0,t.jsx)(n.th,{children:"Description"})]})}),(0,t.jsxs)(n.tbody,{children:[(0,t.jsxs)(n.tr,{children:[(0,t.jsx)(n.td,{children:(0,t.jsx)(n.code,{children:"GITHUB_HOST"})}),(0,t.jsx)(n.td,{children:"The domain name of your GitHub enterprise site."})]}),(0,t.jsxs)(n.tr,{children:[(0,t.jsx)(n.td,{children:(0,t.jsx)(n.code,{children:"GITHUB_PORT"})}),(0,t.jsx)(n.td,{children:"The port of your GitHub enterprise site."})]})]})]}),"\n",(0,t.jsx)(n.h3,{id:"deploy",children:"Deploy"}),"\n",(0,t.jsx)(n.p,{children:"Finally, to deploy your site to GitHub Pages, run:"}),"\n",(0,t.jsxs)(r.Z,{children:[(0,t.jsx)(l.Z,{value:"bash",label:"Bash",children:(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-bash",children:"GIT_USER=yarn deploy\n"})})}),(0,t.jsx)(l.Z,{value:"windows",label:"Windows",children:(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-batch",children:'cmd /C "set "GIT_USER= " && yarn deploy"\n'})})}),(0,t.jsx)(l.Z,{value:"powershell",label:"PowerShell",children:(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-powershell",children:"cmd /C 'set \"GIT_USER= \" && yarn deploy'\n"})})})]}),"\n",(0,t.jsxs)(n.admonition,{type:"warning",children:[(0,t.jsxs)(n.p,{children:["Beginning in August 2021, GitHub requires every command-line sign-in to use the ",(0,t.jsx)(n.strong,{children:"personal access token"})," instead of the password. When GitHub prompts for your password, enter the PAT instead. See the ",(0,t.jsx)(n.a,{href:"https://docs.github.com/en/authentication/keeping-your-account-and-data-secure/creating-a-personal-access-token",children:"GitHub documentation"})," for more information."]}),(0,t.jsxs)(n.p,{children:["Alternatively, you can use SSH (",(0,t.jsx)(n.code,{children:"USE_SSH=true"}),") to log in."]})]}),"\n",(0,t.jsx)(n.h3,{id:"triggering-deployment-with-github-actions",children:"Triggering deployment with GitHub Actions"}),"\n",(0,t.jsxs)(n.p,{children:[(0,t.jsx)(n.a,{href:"https://help.github.com/en/actions",children:"GitHub Actions"})," allow you to automate, customize, and execute your software development workflows right in your repository."]}),"\n",(0,t.jsxs)(n.p,{children:["The workflow examples below assume your website source resides in the ",(0,t.jsx)(n.code,{children:"main"})," branch of your repository (the ",(0,t.jsx)(n.em,{children:"source branch"})," is ",(0,t.jsx)(n.code,{children:"main"}),"), and your ",(0,t.jsx)(n.a,{href:"https://help.github.com/en/github/working-with-github-pages/configuring-a-publishing-source-for-your-github-pages-site",children:"publishing source"})," is configured for ",(0,t.jsx)(n.a,{href:"https://docs.github.com/en/pages/getting-started-with-github-pages/configuring-a-publishing-source-for-your-github-pages-site#publishing-with-a-custom-github-actions-workflow",children:"publishing with a custom GitHub Actions Workflow"}),"."]}),"\n",(0,t.jsx)(n.p,{children:"Our goal is that:"}),"\n",(0,t.jsxs)(n.ol,{children:["\n",(0,t.jsxs)(n.li,{children:["When a new pull request is made to ",(0,t.jsx)(n.code,{children:"main"}),", there's an action that ensures the site builds successfully, without actually deploying. This job will be called ",(0,t.jsx)(n.code,{children:"test-deploy"}),"."]}),"\n",(0,t.jsxs)(n.li,{children:["When a pull request is merged to the ",(0,t.jsx)(n.code,{children:"main"})," branch or someone pushes to the ",(0,t.jsx)(n.code,{children:"main"})," branch directly, it will be built and deployed to GitHub Pages. This job will be called ",(0,t.jsx)(n.code,{children:"deploy"}),"."]}),"\n"]}),"\n",(0,t.jsx)(n.p,{children:"Here are two approaches to deploying your docs with GitHub Actions. Based on the location of your deployment repository, choose the relevant tab below:"}),"\n",(0,t.jsxs)(n.ul,{children:["\n",(0,t.jsxs)(n.li,{children:["Source repo and deployment repo are the ",(0,t.jsx)(n.strong,{children:"same"})," repository."]}),"\n",(0,t.jsxs)(n.li,{children:["The deployment repo is a ",(0,t.jsx)(n.strong,{children:"remote"})," repository, different from the source. Instructions for this scenario assume ",(0,t.jsx)(n.a,{href:"https://help.github.com/en/github/working-with-github-pages/configuring-a-publishing-source-for-your-github-pages-site",children:"publishing source"})," is the ",(0,t.jsx)(n.code,{children:"gh-pages"})," branch."]}),"\n"]}),"\n",(0,t.jsxs)(r.Z,{children:[(0,t.jsxs)(l.Z,{value:"same",label:"Same",children:[(0,t.jsxs)(n.p,{children:["While you can have both jobs defined in the same workflow file, the original ",(0,t.jsx)(n.code,{children:"deploy"})," workflow will always be listed as skipped in the PR check suite status, which is not indicative of the actual status and provides no value to the review process. We therefore propose to manage them as separate workflows instead."]}),(0,t.jsxs)(s,{children:[(0,t.jsx)("summary",{children:"GitHub action files"}),(0,t.jsx)(n.p,{children:"Add these two workflow files:"}),(0,t.jsxs)(n.admonition,{title:"Tweak the parameters for your setup",type:"warning",children:[(0,t.jsxs)(n.p,{children:["These files assume you are using Yarn. If you use npm, change ",(0,t.jsx)(n.code,{children:"cache: yarn"}),", ",(0,t.jsx)(n.code,{children:"yarn install --frozen-lockfile"}),", ",(0,t.jsx)(n.code,{children:"yarn build"})," to ",(0,t.jsx)(n.code,{children:"cache: npm"}),", ",(0,t.jsx)(n.code,{children:"npm ci"}),", ",(0,t.jsx)(n.code,{children:"npm run build"})," accordingly."]}),(0,t.jsxs)(n.p,{children:["If your Docusaurus project is not at the root of your repo, you may need to configure a ",(0,t.jsx)(n.a,{href:"https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#example-set-the-default-shell-and-working-directory",children:"default working directory"}),", and adjust the paths accordingly."]})]}),(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-yml",metastring:'title=".github/workflows/deploy.yml"',children:"name: Deploy to GitHub Pages\n\non:\n push:\n branches:\n - main\n # Review gh actions docs if you want to further define triggers, paths, etc\n # https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#on\n\njobs:\n build:\n name: Build Docusaurus\n runs-on: ubuntu-latest\n steps:\n - uses: actions/checkout@v4\n with:\n fetch-depth: 0\n - uses: actions/setup-node@v4\n with:\n node-version: 18\n cache: yarn\n\n - name: Install dependencies\n run: yarn install --frozen-lockfile\n - name: Build website\n run: yarn build\n\n - name: Upload Build Artifact\n uses: actions/upload-pages-artifact@v3\n with:\n path: build\n\n deploy:\n name: Deploy to GitHub Pages\n needs: build\n\n # Grant GITHUB_TOKEN the permissions required to make a Pages deployment\n permissions:\n pages: write # to deploy to Pages\n id-token: write # to verify the deployment originates from an appropriate source\n\n # Deploy to the github-pages environment\n environment:\n name: github-pages\n url: ${{ steps.deployment.outputs.page_url }}\n\n runs-on: ubuntu-latest\n steps:\n - name: Deploy to GitHub Pages\n id: deployment\n uses: actions/deploy-pages@v4\n"})}),(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-yml",metastring:'title=".github/workflows/test-deploy.yml"',children:"name: Test deployment\n\non:\n pull_request:\n branches:\n - main\n # Review gh actions docs if you want to further define triggers, paths, etc\n # https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#on\n\njobs:\n test-deploy:\n name: Test deployment\n runs-on: ubuntu-latest\n steps:\n - uses: actions/checkout@v4\n with:\n fetch-depth: 0\n - uses: actions/setup-node@v4\n with:\n node-version: 18\n cache: yarn\n\n - name: Install dependencies\n run: yarn install --frozen-lockfile\n - name: Test build website\n run: yarn build\n"})})]})]}),(0,t.jsxs)(l.Z,{value:"remote",label:"Remote",children:[(0,t.jsx)(n.p,{children:"A cross-repo publish is more difficult to set up because you need to push to another repo with permission checks. We will be using SSH to do the authentication."}),(0,t.jsxs)(n.ol,{children:["\n",(0,t.jsxs)(n.li,{children:["Generate a new ",(0,t.jsx)(n.a,{href:"https://help.github.com/en/github/authenticating-to-github/generating-a-new-ssh-key-and-adding-it-to-the-ssh-agent",children:"SSH key"}),". Since this SSH key will be used in CI, make sure to not enter any passphrase."]}),"\n",(0,t.jsxs)(n.li,{children:["By default, your public key should have been created in ",(0,t.jsx)(n.code,{children:"~/.ssh/id_rsa.pub"}),"; otherwise, use the name you've provided in the previous step to add your key to ",(0,t.jsx)(n.a,{href:"https://developer.github.com/v3/guides/managing-deploy-keys/",children:"GitHub deploy keys"}),"."]}),"\n",(0,t.jsxs)(n.li,{children:["Copy the key to clipboard with ",(0,t.jsx)(n.code,{children:"pbcopy < ~/.ssh/id_rsa.pub"})," and paste it as a ",(0,t.jsx)(n.a,{href:"https://developer.github.com/v3/guides/managing-deploy-keys/#deploy-keys",children:"deploy key"})," in the deployment repository. Copy the file content if the command line doesn't work for you. Check the box for ",(0,t.jsx)(n.code,{children:"Allow write access"})," before saving your deployment key."]}),"\n",(0,t.jsxs)(n.li,{children:["You'll need your private key as a ",(0,t.jsx)(n.a,{href:"https://help.github.com/en/actions/configuring-and-managing-workflows/creating-and-storing-encrypted-secrets",children:"GitHub secret"})," to allow Docusaurus to run the deployment for you."]}),"\n",(0,t.jsxs)(n.li,{children:["Copy your private key with ",(0,t.jsx)(n.code,{children:"pbcopy < ~/.ssh/id_rsa"})," and paste a GitHub secret with the name ",(0,t.jsx)(n.code,{children:"GH_PAGES_DEPLOY"})," on your source repository. Copy the file content if the command line doesn't work for you. Save your secret."]}),"\n",(0,t.jsxs)(n.li,{children:["Create your ",(0,t.jsx)(n.a,{href:"https://docs.github.com/en/actions/use-cases-and-examples/creating-an-example-workflow",children:"documentation workflow"})," in the ",(0,t.jsx)(n.code,{children:".github/workflows/"})," directory. In this example it's the ",(0,t.jsx)(n.code,{children:"deploy.yml"})," file."]}),"\n"]}),(0,t.jsx)(n.p,{children:"At this point, you should have:"}),(0,t.jsxs)(n.ul,{children:["\n",(0,t.jsx)(n.li,{children:"the source repo with the GitHub workflow set with the private SSH key as the GitHub Secret, and"}),"\n",(0,t.jsx)(n.li,{children:"your deployment repo set with the public SSH key in GitHub Deploy Keys."}),"\n"]}),(0,t.jsxs)(s,{children:[(0,t.jsx)("summary",{children:"GitHub action file"}),(0,t.jsxs)(n.admonition,{type:"warning",children:[(0,t.jsxs)(n.p,{children:["Please make sure that you replace ",(0,t.jsx)(n.code,{children:"actions@github.com"})," with your GitHub email and ",(0,t.jsx)(n.code,{children:"gh-actions"})," with your name."]}),(0,t.jsxs)(n.p,{children:["This file assumes you are using Yarn. If you use npm, change ",(0,t.jsx)(n.code,{children:"cache: yarn"}),", ",(0,t.jsx)(n.code,{children:"yarn install --frozen-lockfile"}),", ",(0,t.jsx)(n.code,{children:"yarn build"})," to ",(0,t.jsx)(n.code,{children:"cache: npm"}),", ",(0,t.jsx)(n.code,{children:"npm ci"}),", ",(0,t.jsx)(n.code,{children:"npm run build"})," accordingly."]})]}),(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-yml",metastring:'title=".github/workflows/deploy.yml"',children:"name: Deploy to GitHub Pages\n\non:\n pull_request:\n branches: [main]\n push:\n branches: [main]\n\npermissions:\n contents: write\n\njobs:\n test-deploy:\n if: github.event_name != 'push'\n runs-on: ubuntu-latest\n steps:\n - uses: actions/checkout@v4\n with:\n fetch-depth: 0\n - uses: actions/setup-node@v4\n with:\n node-version: 18\n cache: yarn\n - name: Install dependencies\n run: yarn install --frozen-lockfile\n - name: Test build website\n run: yarn build\n deploy:\n if: github.event_name != 'pull_request'\n runs-on: ubuntu-latest\n steps:\n - uses: actions/checkout@v4\n with:\n fetch-depth: 0\n - uses: actions/setup-node@v4\n with:\n node-version: 18\n cache: yarn\n - uses: webfactory/ssh-agent@v0.5.0\n with:\n ssh-private-key: ${{ secrets.GH_PAGES_DEPLOY }}\n - name: Deploy to GitHub Pages\n env:\n USE_SSH: true\n run: |\n git config --global user.email \"actions@github.com\"\n git config --global user.name \"gh-actions\"\n yarn install --frozen-lockfile\n yarn deploy\n"})})]})]})]}),"\n",(0,t.jsxs)(s,{children:[(0,t.jsx)("summary",{children:"Site not deployed properly?"}),(0,t.jsx)(n.p,{children:"After pushing to main, if you don't see your site published at the desired location (for example, it says \"There isn't a GitHub Pages site here\", or it's showing your repo's README.md file), try the following:"}),(0,t.jsxs)(n.ul,{children:["\n",(0,t.jsx)(n.li,{children:"Wait about three minutes and refresh. It may take a few minutes for GitHub pages to pick up the new files."}),"\n",(0,t.jsx)(n.li,{children:"Check your repo's landing page for a little green tick next to the last commit's title, indicating the CI has passed. If you see a cross, it means the build or deployment failed, and you should check the log for more debugging information."}),"\n",(0,t.jsxs)(n.li,{children:['Click on the tick and make sure you see a "Deploy to GitHub Pages" workflow. Names like "pages build and deployment / deploy" are GitHub\'s default workflows, indicating your custom deployment workflow failed to be triggered at all. Make sure the YAML files are placed under the ',(0,t.jsx)(n.code,{children:".github/workflows"}),' folder, and that the trigger condition is set correctly (e.g., if your default branch is "master" instead of "main", you need to change the ',(0,t.jsx)(n.code,{children:"on.push"})," property)."]}),"\n",(0,t.jsxs)(n.li,{children:['Under your repo\'s Settings > Pages, make sure the "Source" (which is the source for the ',(0,t.jsx)(n.em,{children:"deployment"}),' files, not "source" as in our terminology) is set to "gh-pages" + "/ (root)", since we are using ',(0,t.jsx)(n.code,{children:"gh-pages"})," as the deployment branch."]}),"\n"]}),(0,t.jsx)(n.p,{children:"If you are using a custom domain:"}),(0,t.jsxs)(n.ul,{children:["\n",(0,t.jsxs)(n.li,{children:["Verify that you have the correct DNS records set up if you're using a custom domain. See ",(0,t.jsx)(n.a,{href:"https://docs.github.com/en/pages/configuring-a-custom-domain-for-your-github-pages-site/about-custom-domains-and-github-pages",children:"GitHub pages documentation on configuring custom domains"}),". Also, please be aware that it may take up to 24 hours for DNS changes to propagate through the internet."]}),"\n"]})]}),"\n",(0,t.jsx)(n.h3,{id:"triggering-deployment-with-travis-ci",children:"Triggering deployment with Travis CI"}),"\n",(0,t.jsxs)(n.p,{children:["Continuous integration (CI) services are typically used to perform routine tasks whenever new commits are checked in to source control. These tasks can be any combination of running unit tests and integration tests, automating builds, publishing packages to npm, and deploying changes to your website. All you need to do to automate the deployment of your website is to invoke the ",(0,t.jsx)(n.code,{children:"yarn deploy"})," script whenever your website is updated. The following section covers how to do just that using ",(0,t.jsx)(n.a,{href:"https://travis-ci.com/",children:"Travis CI"}),", a popular continuous integration service provider."]}),"\n",(0,t.jsxs)(n.ol,{children:["\n",(0,t.jsxs)(n.li,{children:["Go to ",(0,t.jsx)(n.a,{href:"https://github.com/settings/tokens",children:"https://github.com/settings/tokens"})," and generate a new ",(0,t.jsx)(n.a,{href:"https://help.github.com/articles/creating-a-personal-access-token-for-the-command-line/",children:"personal access token"}),". When creating the token, grant it the ",(0,t.jsx)(n.code,{children:"repo"})," scope so that it has the permissions it needs."]}),"\n",(0,t.jsxs)(n.li,{children:["Using your GitHub account, ",(0,t.jsx)(n.a,{href:"https://github.com/marketplace/travis-ci",children:"add the Travis CI app"})," to the repository you want to activate."]}),"\n",(0,t.jsxs)(n.li,{children:["Open your Travis CI dashboard. The URL looks like ",(0,t.jsx)(n.code,{children:"https://travis-ci.com/USERNAME/REPO"}),", and navigate to the ",(0,t.jsx)(n.code,{children:"More options > Setting > Environment Variables"})," section of your repository."]}),"\n",(0,t.jsxs)(n.li,{children:["Create a new environment variable named ",(0,t.jsx)(n.code,{children:"GH_TOKEN"})," with your newly generated token as its value, then ",(0,t.jsx)(n.code,{children:"GH_EMAIL"})," (your email address) and ",(0,t.jsx)(n.code,{children:"GH_NAME"})," (your GitHub username)."]}),"\n",(0,t.jsxs)(n.li,{children:["Create a ",(0,t.jsx)(n.code,{children:".travis.yml"})," on the root of your repository with the following:"]}),"\n"]}),"\n",(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-yml",metastring:'title=".travis.yml"',children:'language: node_js\nnode_js:\n - 18\nbranches:\n only:\n - main\ncache:\n yarn: true\nscript:\n - git config --global user.name "${GH_NAME}"\n - git config --global user.email "${GH_EMAIL}"\n - echo "machine github.com login ${GH_NAME} password ${GH_TOKEN}" > ~/.netrc\n - yarn install\n - GIT_USER="${GH_NAME}" yarn deploy\n'})}),"\n",(0,t.jsxs)(n.p,{children:["Now, whenever a new commit lands in ",(0,t.jsx)(n.code,{children:"main"}),", Travis CI will run your suite of tests and if everything passes, your website will be deployed via the ",(0,t.jsx)(n.code,{children:"yarn deploy"})," script."]}),"\n",(0,t.jsx)(n.h3,{id:"triggering-deployment-with-buddy",children:"Triggering deployment with Buddy"}),"\n",(0,t.jsxs)(n.p,{children:[(0,t.jsx)(n.a,{href:"https://buddy.works/",children:"Buddy"})," is an easy-to-use CI/CD tool that allows you to automate the deployment of your portal to different environments, including GitHub Pages."]}),"\n",(0,t.jsx)(n.p,{children:"Follow these steps to create a pipeline that automatically deploys a new version of your website whenever you push changes to the selected branch of your project:"}),"\n",(0,t.jsxs)(n.ol,{children:["\n",(0,t.jsxs)(n.li,{children:["Go to ",(0,t.jsx)(n.a,{href:"https://github.com/settings/tokens",children:"https://github.com/settings/tokens"})," and generate a new ",(0,t.jsx)(n.a,{href:"https://help.github.com/articles/creating-a-personal-access-token-for-the-command-line/",children:"personal access token"}),". When creating the token, grant it the ",(0,t.jsx)(n.code,{children:"repo"})," scope so that it has the permissions it needs."]}),"\n",(0,t.jsx)(n.li,{children:"Sign in to your Buddy account and create a new project."}),"\n",(0,t.jsx)(n.li,{children:"Choose GitHub as your git hosting provider and select the repository with the code of your website."}),"\n",(0,t.jsxs)(n.li,{children:["Using the left navigation panel, switch to the ",(0,t.jsx)(n.code,{children:"Pipelines"})," view."]}),"\n",(0,t.jsxs)(n.li,{children:["Create a new pipeline. Define its name, set the trigger mode to ",(0,t.jsx)(n.code,{children:"On push"}),", and select the branch that triggers the pipeline execution."]}),"\n",(0,t.jsxs)(n.li,{children:["Add a ",(0,t.jsx)(n.code,{children:"Node.js"})," action."]}),"\n",(0,t.jsx)(n.li,{children:"Add these commands in the action's terminal:"}),"\n"]}),"\n",(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-bash",children:'GIT_USER= \ngit config --global user.email " "\ngit config --global user.name " "\nyarn deploy\n'})}),"\n",(0,t.jsxs)(n.p,{children:["After creating this simple pipeline, each new commit pushed to the branch you selected deploys your website to GitHub Pages using ",(0,t.jsx)(n.code,{children:"yarn deploy"}),". Read ",(0,t.jsx)(n.a,{href:"https://buddy.works/guides/react-docusaurus",children:"this guide"})," to learn more about setting up a CI/CD pipeline for Docusaurus."]}),"\n",(0,t.jsx)(n.h3,{id:"using-azure-pipelines",children:"Using Azure Pipelines"}),"\n",(0,t.jsxs)(n.ol,{children:["\n",(0,t.jsxs)(n.li,{children:["Sign Up at ",(0,t.jsx)(n.a,{href:"https://azure.microsoft.com/en-us/services/devops/pipelines/",children:"Azure Pipelines"})," if you haven't already."]}),"\n",(0,t.jsx)(n.li,{children:"Create an organization. Within the organization, create a project and connect your repository from GitHub."}),"\n",(0,t.jsxs)(n.li,{children:["Go to ",(0,t.jsx)(n.a,{href:"https://github.com/settings/tokens",children:"https://github.com/settings/tokens"})," and generate a new ",(0,t.jsx)(n.a,{href:"https://help.github.com/articles/creating-a-personal-access-token-for-the-command-line/",children:"personal access token"})," with the ",(0,t.jsx)(n.code,{children:"repo"})," scope."]}),"\n",(0,t.jsxs)(n.li,{children:["In the project page (which looks like ",(0,t.jsx)(n.code,{children:"https://dev.azure.com/ORG_NAME/REPO_NAME/_build"}),"), create a new pipeline with the following text. Also, click on edit and add a new environment variable named ",(0,t.jsx)(n.code,{children:"GH_TOKEN"})," with your newly generated token as its value, then ",(0,t.jsx)(n.code,{children:"GH_EMAIL"})," (your email address) and ",(0,t.jsx)(n.code,{children:"GH_NAME"})," (your GitHub username). Make sure to mark them as secret. Alternatively, you can also add a file named ",(0,t.jsx)(n.code,{children:"azure-pipelines.yml"})," at your repository root."]}),"\n"]}),"\n",(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-yml",metastring:'title="azure-pipelines.yml"',children:'trigger:\n - main\n\npool:\n vmImage: ubuntu-latest\n\nsteps:\n - checkout: self\n persistCredentials: true\n\n - task: NodeTool@0\n inputs:\n versionSpec: \'18\'\n displayName: Install Node.js\n\n - script: |\n git config --global user.name "${GH_NAME}"\n git config --global user.email "${GH_EMAIL}"\n git checkout -b main\n echo "machine github.com login ${GH_NAME} password ${GH_TOKEN}" > ~/.netrc\n yarn install\n GIT_USER="${GH_NAME}" yarn deploy\n env:\n GH_NAME: $(GH_NAME)\n GH_EMAIL: $(GH_EMAIL)\n GH_TOKEN: $(GH_TOKEN)\n displayName: Install and build\n'})}),"\n",(0,t.jsx)(n.h3,{id:"using-drone",children:"Using Drone"}),"\n",(0,t.jsxs)(n.ol,{children:["\n",(0,t.jsxs)(n.li,{children:["Create a new SSH key that will be the ",(0,t.jsx)(n.a,{href:"https://docs.github.com/en/free-pro-team@latest/developers/overview/managing-deploy-keys#deploy-keys",children:"deploy key"})," for your project."]}),"\n",(0,t.jsxs)(n.li,{children:["Name your private and public keys to be specific and so that it does not overwrite your other ",(0,t.jsx)(n.a,{href:"https://docs.github.com/en/free-pro-team@latest/github/authenticating-to-github/generating-a-new-ssh-key-and-adding-it-to-the-ssh-agent",children:"SSH keys"}),"."]}),"\n",(0,t.jsxs)(n.li,{children:["Go to ",(0,t.jsx)(n.code,{children:"https://github.com/USERNAME/REPO/settings/keys"})," and add a new deploy key by pasting in the public key you just generated."]}),"\n",(0,t.jsxs)(n.li,{children:["Open your Drone.io dashboard and log in. The URL looks like ",(0,t.jsx)(n.code,{children:"https://cloud.drone.io/USERNAME/REPO"}),"."]}),"\n",(0,t.jsxs)(n.li,{children:["Click on the repository, click on activate repository, and add a secret called ",(0,t.jsx)(n.code,{children:"git_deploy_private_key"})," with your private key value that you just generated."]}),"\n",(0,t.jsxs)(n.li,{children:["Create a ",(0,t.jsx)(n.code,{children:".drone.yml"})," on the root of your repository with the below text."]}),"\n"]}),"\n",(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-yml",metastring:'title=".drone.yml"',children:'kind: pipeline\ntype: docker\ntrigger:\n event:\n - tag\n- name: Website\n image: node\n commands:\n - mkdir -p $HOME/.ssh\n - ssh-keyscan -t rsa github.com >> $HOME/.ssh/known_hosts\n - echo "$GITHUB_PRIVATE_KEY" > "$HOME/.ssh/id_rsa"\n - chmod 0600 $HOME/.ssh/id_rsa\n - cd website\n - yarn install\n - yarn deploy\n environment:\n USE_SSH: true\n GITHUB_PRIVATE_KEY:\n from_secret: git_deploy_private_key\n'})}),"\n",(0,t.jsx)(n.p,{children:"Now, whenever you push a new tag to GitHub, this trigger will start the drone CI job to publish your website."}),"\n",(0,t.jsx)(n.h2,{id:"deploying-to-flightcontrol",children:"Deploying to Flightcontrol"}),"\n",(0,t.jsxs)(n.p,{children:[(0,t.jsx)(n.a,{href:"https://www.flightcontrol.dev/?ref=docusaurus",children:"Flightcontrol"})," is a service that automatically builds and deploys your web apps to AWS Fargate directly from your Git repository. It gives you full access to inspect and make infrastructure changes without the limitations of a traditional PaaS."]}),"\n",(0,t.jsxs)(n.p,{children:["Get started by following ",(0,t.jsx)(n.a,{href:"https://www.flightcontrol.dev/docs/reference/examples/docusaurus/?ref=docusaurus",children:"Flightcontrol's step-by-step Docusaurus guide"}),"."]}),"\n",(0,t.jsx)(n.h2,{id:"deploying-to-koyeb",children:"Deploying to Koyeb"}),"\n",(0,t.jsxs)(n.p,{children:[(0,t.jsx)(n.a,{href:"https://www.koyeb.com",children:"Koyeb"})," is a developer-friendly serverless platform to deploy apps globally. The platform lets you seamlessly run Docker containers, web apps, and APIs with git-based deployment, native autoscaling, a global edge network, and built-in service mesh and discovery. Check out the ",(0,t.jsx)(n.a,{href:"https://www.koyeb.com/tutorials/deploy-docusaurus-on-koyeb",children:"Koyeb's Docusaurus deployment guide"})," to get started."]}),"\n",(0,t.jsx)(n.h2,{id:"deploying-to-render",children:"Deploying to Render"}),"\n",(0,t.jsxs)(n.p,{children:[(0,t.jsx)(n.a,{href:"https://render.com",children:"Render"})," offers ",(0,t.jsx)(n.a,{href:"https://render.com/docs/static-sites",children:"free static site hosting"})," with fully managed SSL, custom domains, a global CDN, and continuous auto-deploy from your Git repo. Get started in just a few minutes by following ",(0,t.jsx)(n.a,{href:"https://render.com/docs/deploy-docusaurus",children:"Render's guide to deploying Docusaurus"}),"."]}),"\n",(0,t.jsx)(n.h2,{id:"deploying-to-qovery",children:"Deploying to Qovery"}),"\n",(0,t.jsxs)(n.p,{children:[(0,t.jsx)(n.a,{href:"https://www.qovery.com",children:"Qovery"})," is a fully-managed cloud platform that runs on your AWS, Digital Ocean, and Scaleway account where you can host static sites, backend APIs, databases, cron jobs, and all your other apps in one place."]}),"\n",(0,t.jsxs)(n.ol,{children:["\n",(0,t.jsxs)(n.li,{children:["Create a Qovery account. Visit the ",(0,t.jsx)(n.a,{href:"https://console.qovery.com",children:"Qovery dashboard"})," to create an account if you don't already have one."]}),"\n",(0,t.jsxs)(n.li,{children:["Create a project.","\n",(0,t.jsxs)(n.ul,{children:["\n",(0,t.jsxs)(n.li,{children:["Click on ",(0,t.jsx)(n.strong,{children:"Create project"})," and give a name to your project."]}),"\n",(0,t.jsxs)(n.li,{children:["Click on ",(0,t.jsx)(n.strong,{children:"Next"}),"."]}),"\n"]}),"\n"]}),"\n",(0,t.jsxs)(n.li,{children:["Create a new environment.","\n",(0,t.jsxs)(n.ul,{children:["\n",(0,t.jsxs)(n.li,{children:["Click on ",(0,t.jsx)(n.strong,{children:"Create environment"})," and give a name (e.g. staging, production)."]}),"\n"]}),"\n"]}),"\n",(0,t.jsxs)(n.li,{children:["Add an application.","\n",(0,t.jsxs)(n.ul,{children:["\n",(0,t.jsxs)(n.li,{children:["Click on ",(0,t.jsx)(n.strong,{children:"Create an application"}),", give a name and select your GitHub or GitLab repository where your Docusaurus app is located."]}),"\n",(0,t.jsx)(n.li,{children:"Define the main branch name and the root application path."}),"\n",(0,t.jsxs)(n.li,{children:["Click on ",(0,t.jsx)(n.strong,{children:"Create"}),". After the application is created:"]}),"\n",(0,t.jsxs)(n.li,{children:["Navigate to your application ",(0,t.jsx)(n.strong,{children:"Settings"})]}),"\n",(0,t.jsxs)(n.li,{children:["Select ",(0,t.jsx)(n.strong,{children:"Port"})]}),"\n",(0,t.jsx)(n.li,{children:"Add port used by your Docusaurus application"}),"\n"]}),"\n"]}),"\n",(0,t.jsxs)(n.li,{children:["Deploy","\n",(0,t.jsxs)(n.ul,{children:["\n",(0,t.jsxs)(n.li,{children:["All you have to do now is to navigate to your application and click on ",(0,t.jsx)(n.strong,{children:"Deploy"}),"."]}),"\n"]}),"\n"]}),"\n"]}),"\n",(0,t.jsx)(n.p,{children:(0,t.jsx)(n.img,{src:"https://hub.qovery.com/img/heroku/heroku-1.png",alt:"Deploy the app"})}),"\n",(0,t.jsxs)(n.p,{children:["That's it. Watch the status and wait till the app is deployed. To open the application in your browser, click on ",(0,t.jsx)(n.strong,{children:"Action"})," and ",(0,t.jsx)(n.strong,{children:"Open"})," in your application overview."]}),"\n",(0,t.jsx)(n.h2,{id:"deploying-to-hostman",children:"Deploying to Hostman"}),"\n",(0,t.jsxs)(n.p,{children:[(0,t.jsx)(n.a,{href:"https://hostman.com/",children:"Hostman"})," allows you to host static websites for free. Hostman automates everything, you just need to connect your repository and follow these easy steps:"]}),"\n",(0,t.jsxs)(n.ol,{children:["\n",(0,t.jsxs)(n.li,{children:["\n",(0,t.jsx)(n.p,{children:"Create a service."}),"\n",(0,t.jsxs)(n.ul,{children:["\n",(0,t.jsxs)(n.li,{children:["To deploy a Docusaurus static website, click ",(0,t.jsx)(n.strong,{children:"Create"})," in the top-left corner of your ",(0,t.jsx)(n.a,{href:"https://dashboard.hostman.com/",children:"Dashboard"})," and choose ",(0,t.jsx)(n.strong,{children:"Front-end app or static website"}),"."]}),"\n"]}),"\n"]}),"\n",(0,t.jsxs)(n.li,{children:["\n",(0,t.jsx)(n.p,{children:"Select the project to deploy."}),"\n",(0,t.jsxs)(n.ul,{children:["\n",(0,t.jsxs)(n.li,{children:["\n",(0,t.jsx)(n.p,{children:"If you are logged in to Hostman with your GitHub, GitLab, or Bitbucket account, you will see the repository with your projects, including the private ones."}),"\n"]}),"\n",(0,t.jsxs)(n.li,{children:["\n",(0,t.jsxs)(n.p,{children:["Choose the project you want to deploy. It must contain the directory with the project's files (e.g. ",(0,t.jsx)(n.code,{children:"website"}),")."]}),"\n"]}),"\n",(0,t.jsxs)(n.li,{children:["\n",(0,t.jsxs)(n.p,{children:["To access a different repository, click ",(0,t.jsx)(n.strong,{children:"Connect another repository"}),"."]}),"\n"]}),"\n",(0,t.jsxs)(n.li,{children:["\n",(0,t.jsx)(n.p,{children:"If you didn't use your Git account credentials to log in, you'll be able to access the necessary account now, and then select the project."}),"\n"]}),"\n"]}),"\n"]}),"\n",(0,t.jsxs)(n.li,{children:["\n",(0,t.jsx)(n.p,{children:"Configure the build settings."}),"\n",(0,t.jsxs)(n.ul,{children:["\n",(0,t.jsxs)(n.li,{children:["\n",(0,t.jsxs)(n.p,{children:["Next, the ",(0,t.jsx)(n.strong,{children:"Website customization"})," window will appear. Choose the ",(0,t.jsx)(n.strong,{children:"Static website"})," option from the list of frameworks."]}),"\n"]}),"\n",(0,t.jsxs)(n.li,{children:["\n",(0,t.jsxs)(n.p,{children:["The ",(0,t.jsx)(n.strong,{children:"Directory with app"})," points at the directory that will contain the project's files after the build. If you selected the repository with the contents of the website (or ",(0,t.jsx)(n.code,{children:"my_website"}),") directory during Step 2, you can leave it empty."]}),"\n"]}),"\n",(0,t.jsxs)(n.li,{children:["\n",(0,t.jsx)(n.p,{children:"The standard build command for Docusaurus is:"}),"\n",(0,t.jsxs)(r.Z,{groupId:"npm2yarn",children:[(0,t.jsx)(l.Z,{value:"npm",children:(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-bash",children:"npm run build\n"})})}),(0,t.jsx)(l.Z,{value:"yarn",label:"Yarn",children:(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-bash",children:"yarn build\n"})})}),(0,t.jsx)(l.Z,{value:"pnpm",label:"pnpm",children:(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-bash",children:"pnpm run build\n"})})}),(0,t.jsx)(l.Z,{value:"bun",label:"Bun",children:(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-bash",children:"bun run build\n"})})})]}),"\n"]}),"\n",(0,t.jsxs)(n.li,{children:["\n",(0,t.jsxs)(n.p,{children:["You can modify the build command if needed. You can enter multiple commands separated by ",(0,t.jsx)(n.code,{children:"&&"}),"."]}),"\n"]}),"\n"]}),"\n"]}),"\n",(0,t.jsxs)(n.li,{children:["\n",(0,t.jsx)(n.p,{children:"Deploy."}),"\n",(0,t.jsxs)(n.ul,{children:["\n",(0,t.jsxs)(n.li,{children:["\n",(0,t.jsxs)(n.p,{children:["Click ",(0,t.jsx)(n.strong,{children:"Deploy"})," to start the build process."]}),"\n"]}),"\n",(0,t.jsxs)(n.li,{children:["\n",(0,t.jsx)(n.p,{children:"Once it starts, you will enter the deployment log. If there are any issues with the code, you will get warning or error messages in the log specifying the cause of the problem. Usually, the log contains all the debugging data you'll need."}),"\n"]}),"\n",(0,t.jsxs)(n.li,{children:["\n",(0,t.jsx)(n.p,{children:"When the deployment is complete, you will receive an email notification and also see a log entry. All done! Your project is up and ready."}),"\n"]}),"\n"]}),"\n"]}),"\n"]}),"\n",(0,t.jsx)(n.h2,{id:"deploying-to-surge",children:"Deploying to Surge"}),"\n",(0,t.jsxs)(n.p,{children:["Surge is a ",(0,t.jsx)(n.a,{href:"https://surge.sh/help/getting-started-with-surge",children:"static web hosting platform"})," that you can use to deploy your Docusaurus project from the command line in seconds. Deploying your project to Surge is easy and free (including custom domains and SSL certs)."]}),"\n",(0,t.jsx)(n.p,{children:"Deploy your app in a matter of seconds using Surge with the following steps:"}),"\n",(0,t.jsxs)(n.ol,{children:["\n",(0,t.jsxs)(n.li,{children:["First, install Surge using npm by running the following command:","\n",(0,t.jsxs)(r.Z,{groupId:"npm2yarn",children:[(0,t.jsx)(l.Z,{value:"npm",children:(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-bash",children:"npm install -g surge\n"})})}),(0,t.jsx)(l.Z,{value:"yarn",label:"Yarn",children:(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-bash",children:"yarn global add surge\n"})})}),(0,t.jsx)(l.Z,{value:"pnpm",label:"pnpm",children:(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-bash",children:"pnpm add -g surge\n"})})}),(0,t.jsx)(l.Z,{value:"bun",label:"Bun",children:(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-bash",children:"bun add --global surge\n"})})})]}),"\n"]}),"\n",(0,t.jsxs)(n.li,{children:["To build the static files of your site for production in the root directory of your project, run:","\n",(0,t.jsxs)(r.Z,{groupId:"npm2yarn",children:[(0,t.jsx)(l.Z,{value:"npm",children:(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-bash",children:"npm run build\n"})})}),(0,t.jsx)(l.Z,{value:"yarn",label:"Yarn",children:(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-bash",children:"yarn build\n"})})}),(0,t.jsx)(l.Z,{value:"pnpm",label:"pnpm",children:(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-bash",children:"pnpm run build\n"})})}),(0,t.jsx)(l.Z,{value:"bun",label:"Bun",children:(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-bash",children:"bun run build\n"})})})]}),"\n"]}),"\n",(0,t.jsxs)(n.li,{children:["Then, run this command inside the root directory of your project:","\n",(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-bash",children:"surge build/\n"})}),"\n"]}),"\n"]}),"\n",(0,t.jsx)(n.p,{children:"First-time users of Surge would be prompted to create an account from the command line (which happens only once)."}),"\n",(0,t.jsxs)(n.p,{children:["Confirm that the site you want to publish is in the ",(0,t.jsx)(n.code,{children:"build"})," directory. A randomly generated subdomain ",(0,t.jsx)(n.code,{children:"*.surge.sh subdomain"})," is always given (which can be edited)."]}),"\n",(0,t.jsx)(n.h3,{id:"using-your-domain",children:"Using your domain"}),"\n",(0,t.jsx)(n.p,{children:"If you have a domain name you can deploy your site using the command:"}),"\n",(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-bash",children:"surge build/ your-domain.com\n"})}),"\n",(0,t.jsxs)(n.p,{children:["Your site is now deployed for free at ",(0,t.jsx)(n.code,{children:"subdomain.surge.sh"})," or ",(0,t.jsx)(n.code,{children:"your-domain.com"})," depending on the method you chose."]}),"\n",(0,t.jsx)(n.h3,{id:"setting-up-cname-file",children:"Setting up CNAME file"}),"\n",(0,t.jsx)(n.p,{children:"Store your domain in a CNAME file for future deployments with the following command:"}),"\n",(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-bash",children:"echo subdomain.surge.sh > CNAME\n"})}),"\n",(0,t.jsxs)(n.p,{children:["You can deploy any other changes in the future with the command ",(0,t.jsx)(n.code,{children:"surge"}),"."]}),"\n",(0,t.jsx)(n.h2,{id:"deploying-to-stormkit",children:"Deploying to Stormkit"}),"\n",(0,t.jsxs)(n.p,{children:["You can deploy your Docusaurus project to ",(0,t.jsx)(n.a,{href:"https://www.stormkit.io",children:"Stormkit"}),", a deployment platform for static websites, single-page applications (SPAs), and serverless functions. For detailed instructions, refer to this ",(0,t.jsx)(n.a,{href:"https://www.stormkit.io/blog/how-to-deploy-docusarous",children:"guide"}),"."]}),"\n",(0,t.jsx)(n.h2,{id:"deploying-to-quantcdn",children:"Deploying to QuantCDN"}),"\n",(0,t.jsxs)(n.ol,{children:["\n",(0,t.jsxs)(n.li,{children:["Install ",(0,t.jsx)(n.a,{href:"https://docs.quantcdn.io/docs/cli/get-started",children:"Quant CLI"})]}),"\n",(0,t.jsxs)(n.li,{children:["Create a QuantCDN account by ",(0,t.jsx)(n.a,{href:"https://dashboard.quantcdn.io/register",children:"signing up"})]}),"\n",(0,t.jsxs)(n.li,{children:["Initialize your project with ",(0,t.jsx)(n.code,{children:"quant init"})," and fill in your credentials:","\n",(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-bash",children:"quant init\n"})}),"\n"]}),"\n",(0,t.jsxs)(n.li,{children:["Deploy your site.","\n",(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-bash",children:"quant deploy\n"})}),"\n"]}),"\n"]}),"\n",(0,t.jsxs)(n.p,{children:["See ",(0,t.jsx)(n.a,{href:"https://docs.quantcdn.io/docs/cli/continuous-integration",children:"docs"})," and ",(0,t.jsx)(n.a,{href:"https://www.quantcdn.io/blog",children:"blog"})," for more examples and use cases for deploying to QuantCDN."]}),"\n",(0,t.jsx)(n.h2,{id:"deploying-to-layer0",children:"Deploying to Layer0"}),"\n",(0,t.jsxs)(n.p,{children:[(0,t.jsx)(n.a,{href:"https://www.layer0.co",children:"Layer0"})," is an all-in-one platform to develop, deploy, preview, experiment on, monitor, and run your headless frontend. It is focused on large, dynamic websites and best-in-class performance through EdgeJS (a JavaScript-based Content Delivery Network), predictive prefetching, and performance monitoring. Layer0 offers a free tier. Get started in just a few minutes by following ",(0,t.jsx)(n.a,{href:"https://docs.layer0.co/guides/docusaurus",children:"Layer0's guide to deploying Docusaurus"}),"."]}),"\n",(0,t.jsx)(n.h2,{id:"deploying-to-cloudflare-pages",children:"Deploying to Cloudflare Pages"}),"\n",(0,t.jsxs)(n.p,{children:[(0,t.jsx)(n.a,{href:"https://pages.cloudflare.com/",children:"Cloudflare Pages"})," is a Jamstack platform for frontend developers to collaborate and deploy websites. Get started within a few minutes by following ",(0,t.jsx)(n.a,{href:"https://developers.cloudflare.com/pages/framework-guides/deploy-a-docusaurus-site/",children:"this page"}),"."]}),"\n",(0,t.jsx)(n.h2,{id:"deploying-to-azure-static-web-apps",children:"Deploying to Azure Static Web Apps"}),"\n",(0,t.jsxs)(n.p,{children:[(0,t.jsx)(n.a,{href:"https://docs.microsoft.com/en-us/azure/static-web-apps/overview",children:"Azure Static Web Apps"})," is a service that automatically builds and deploys full-stack web apps to Azure directly from the code repository, simplifying the developer experience for CI/CD. Static Web Apps separates the web application's static assets from its dynamic (API) endpoints. Static assets are served from globally-distributed content servers, making it faster for clients to retrieve files using servers nearby. Dynamic APIs are scaled with serverless architectures using an event-driven functions-based approach that is more cost-effective and scales on demand. Get started in a few minutes by following ",(0,t.jsx)(n.a,{href:"https://dev.to/azure/11-share-content-with-docusaurus-azure-static-web-apps-30hc",children:"this step-by-step guide"}),"."]}),"\n",(0,t.jsx)(n.h2,{id:"deploying-to-kinsta",children:"Deploying to Kinsta"}),"\n",(0,t.jsxs)(n.p,{children:[(0,t.jsx)(n.a,{href:"https://kinsta.com/static-site-hosting",children:"Kinsta Static Site Hosting"})," lets you deploy up to 100 static sites for free, custom domains with SSL, 100 GB monthly bandwidth, and 260+ Cloudflare CDN locations."]}),"\n",(0,t.jsxs)(n.p,{children:["Get started in just a few clicks by following our ",(0,t.jsx)(n.a,{href:"https://kinsta.com/docs/docusaurus-example/",children:"Docusaurus on Kinsta"})," article."]})]})}function p(e={}){let{wrapper:n}={...(0,o.a)(),...e.components};return n?(0,t.jsx)(n,{...e,children:(0,t.jsx)(u,{...e})}):u(e)}},58636:function(e,n,s){s.d(n,{Z:()=>o});var i=s(85893);s(67294);var t=s(90496);function o(e){let{children:n,hidden:s,className:o}=e;return(0,i.jsx)("div",{role:"tabpanel",className:(0,t.Z)("tabItem_pnkT",o),hidden:s,children:n})}},15398:function(e,n,s){s.d(n,{Z:()=>x});var i=s(85893),t=s(67294),o=s(90496),r=s(54947),l=s(3620),a=s(844),c=s(97486),d=s(32263),h=s(16971);function u(e){return t.Children.toArray(e).filter(e=>"\n"!==e).map(e=>{if(!e||(0,t.isValidElement)(e)&&function(e){let{props:n}=e;return!!n&&"object"==typeof n&&"value"in n}(e))return e;throw Error(`Docusaurus error: Bad child <${"string"==typeof e.type?e.type:e.type.name}>: all children of the component should be , and every should have a unique "value" prop.`)})?.filter(Boolean)??[]}function p(e){let{value:n,tabValues:s}=e;return s.some(e=>e.value===n)}var g=s(71607);function y(e){let{className:n,block:s,selectedValue:t,selectValue:l,tabValues:a}=e,c=[],{blockElementScrollPositionUntilNextRender:d}=(0,r.o5)(),h=e=>{let n=e.currentTarget,s=a[c.indexOf(n)].value;s!==t&&(d(n),l(s))},u=e=>{let n=null;switch(e.key){case"Enter":h(e);break;case"ArrowRight":{let s=c.indexOf(e.currentTarget)+1;n=c[s]??c[0];break}case"ArrowLeft":{let s=c.indexOf(e.currentTarget)-1;n=c[s]??c[c.length-1]}}n?.focus()};return(0,i.jsx)("ul",{role:"tablist","aria-orientation":"horizontal",className:(0,o.Z)("tabs",{"tabs--block":s},n),children:a.map(e=>{let{value:n,label:s,attributes:r}=e;return(0,i.jsx)("li",{role:"tab",tabIndex:t===n?0:-1,"aria-selected":t===n,ref:e=>{c.push(e)},onKeyDown:u,onClick:h,...r,className:(0,o.Z)("tabs__item","tabItem_AQgk",r?.className,{"tabs__item--active":t===n}),children:s??n},n)})})}function m(e){let{lazy:n,children:s,selectedValue:r}=e,l=(Array.isArray(s)?s:[s]).filter(Boolean);if(n){let e=l.find(e=>e.props.value===r);return e?(0,t.cloneElement)(e,{className:(0,o.Z)("margin-top--md",e.props.className)}):null}return(0,i.jsx)("div",{className:"margin-top--md",children:l.map((e,n)=>(0,t.cloneElement)(e,{key:n,hidden:e.props.value!==r}))})}function j(e){let n=function(e){let{defaultValue:n,queryString:s=!1,groupId:i}=e,o=function(e){let{values:n,children:s}=e;return(0,t.useMemo)(()=>{let e=n??u(s).map(e=>{let{props:{value:n,label:s,attributes:i,default:t}}=e;return{value:n,label:s,attributes:i,default:t}}),i=(0,d.lx)(e,(e,n)=>e.value===n.value);if(i.length>0)throw Error(`Docusaurus error: Duplicate values "${i.map(e=>e.value).join(", ")}" found in . Every value needs to be unique.`);return e},[n,s])}(e),[r,g]=(0,t.useState)(()=>(function(e){let{defaultValue:n,tabValues:s}=e;if(0===s.length)throw Error("Docusaurus error: the component requires at least one children component");if(n){if(!p({value:n,tabValues:s}))throw Error(`Docusaurus error: The has a defaultValue "${n}" but none of its children has the corresponding value. Available values are: ${s.map(e=>e.value).join(", ")}. If you intend to show no default tab, use defaultValue={null} instead.`);return n}let i=s.find(e=>e.default)??s[0];if(!i)throw Error("Unexpected error: 0 tabValues");return i.value})({defaultValue:n,tabValues:o})),[y,m]=function(e){let{queryString:n=!1,groupId:s}=e,i=(0,l.k6)(),o=function(e){let{queryString:n=!1,groupId:s}=e;if("string"==typeof n)return n;if(!1===n)return null;if(!0===n&&!s)throw Error('Docusaurus error: The component groupId prop is required if queryString=true, because this value is used as the search param name. You can also provide an explicit value such as queryString="my-search-param".');return s??null}({queryString:n,groupId:s});return[(0,c._X)(o),(0,t.useCallback)(e=>{if(!o)return;let n=new URLSearchParams(i.location.search);n.set(o,e),i.replace({...i.location,search:n.toString()})},[o,i])]}({queryString:s,groupId:i}),[j,x]=function(e){let{groupId:n}=e,s=n?`docusaurus.tab.${n}`:null,[i,o]=(0,h.Nk)(s);return[i,(0,t.useCallback)(e=>{s&&o.set(e)},[s,o])]}({groupId:i}),f=(()=>{let e=y??j;return p({value:e,tabValues:o})?e:null})();return(0,a.Z)(()=>{f&&g(f)},[f]),{selectedValue:r,selectValue:(0,t.useCallback)(e=>{if(!p({value:e,tabValues:o}))throw Error(`Can't select invalid tab value=${e}`);g(e),m(e),x(e)},[m,x,o]),tabValues:o}}(e);return(0,i.jsxs)("div",{className:(0,o.Z)("tabs-container","tabList_Qoir"),children:[(0,i.jsx)(y,{...n,...e}),(0,i.jsx)(m,{...n,...e})]})}function x(e){let n=(0,g.Z)();return(0,i.jsx)(j,{...e,children:u(e.children)},String(n))}},80980:function(e,n,s){s.d(n,{Z:()=>l,a:()=>r});var i=s(67294);let t={},o=i.createContext(t);function r(e){let n=i.useContext(o);return i.useMemo(function(){return"function"==typeof e?e(n):{...n,...e}},[n,e])}function l(e){let n;return n=e.disableParentContext?"function"==typeof e.components?e.components(t):e.components||t:r(e.components),i.createElement(o.Provider,{value:n},e.children)}}}]); \ No newline at end of file diff --git a/assets/js/06c6ffc3.b5f2a48e.js b/assets/js/06c6ffc3.b5f2a48e.js deleted file mode 100644 index e25bcf0c2c..0000000000 --- a/assets/js/06c6ffc3.b5f2a48e.js +++ /dev/null @@ -1 +0,0 @@ -"use strict";(self.webpackChunkwebsite=self.webpackChunkwebsite||[]).push([["79557"],{26933:function(e,n,s){s.r(n),s.d(n,{frontMatter:()=>a,default:()=>p,contentTitle:()=>c,assets:()=>d,toc:()=>h,metadata:()=>i});var i=JSON.parse('{"id":"deployment","title":"Deployment","description":"Deploy your Docusaurus app for production on a range of static site hosting services.","source":"@site/docs/deployment.mdx","sourceDirName":".","slug":"/deployment","permalink":"/docs/deployment","draft":false,"unlisted":false,"editUrl":"https://github.com/facebook/docusaurus/edit/main/website/docs/deployment.mdx","tags":[],"version":"current","lastUpdatedBy":"Ben McCann","lastUpdatedAt":1744155424000,"frontMatter":{"description":"Deploy your Docusaurus app for production on a range of static site hosting services."},"sidebar":"docs","previous":{"title":"Using Plugins","permalink":"/docs/using-plugins"},"next":{"title":"i18n - Introduction","permalink":"/docs/i18n/introduction"}}'),t=s(85893),o=s(80980),r=s(15398),l=s(58636);let a={description:"Deploy your Docusaurus app for production on a range of static site hosting services."},c="Deployment",d={},h=[{value:"Configuration",id:"configuration",level:2},{value:"Testing your Build Locally",id:"testing-build-locally",level:2},{value:"Trailing slash configuration",id:"trailing-slashes",level:2},{value:"Using environment variables",id:"using-environment-variables",level:2},{value:"Choosing a hosting provider",id:"choosing-a-hosting-provider",level:2},{value:"Self-Hosting",id:"self-hosting",level:2},{value:"Deploying to Netlify",id:"deploying-to-netlify",level:2},{value:"Deploying to Vercel",id:"deploying-to-vercel",level:2},{value:"Deploying to GitHub Pages",id:"deploying-to-github-pages",level:2},{value:"Overview",id:"github-pages-overview",level:3},{value:" docusaurus.config.js
settings",id:"docusaurusconfigjs-settings",level:3},{value:"Environment settings",id:"environment-settings",level:3},{value:"Deploy",id:"deploy",level:3},{value:"Triggering deployment with GitHub Actions",id:"triggering-deployment-with-github-actions",level:3},{value:"Triggering deployment with Travis CI",id:"triggering-deployment-with-travis-ci",level:3},{value:"Triggering deployment with Buddy",id:"triggering-deployment-with-buddy",level:3},{value:"Using Azure Pipelines",id:"using-azure-pipelines",level:3},{value:"Using Drone",id:"using-drone",level:3},{value:"Deploying to Flightcontrol",id:"deploying-to-flightcontrol",level:2},{value:"Deploying to Koyeb",id:"deploying-to-koyeb",level:2},{value:"Deploying to Render",id:"deploying-to-render",level:2},{value:"Deploying to Qovery",id:"deploying-to-qovery",level:2},{value:"Deploying to Hostman",id:"deploying-to-hostman",level:2},{value:"Deploying to Surge",id:"deploying-to-surge",level:2},{value:"Using your domain",id:"using-your-domain",level:3},{value:"Setting up CNAME file",id:"setting-up-cname-file",level:3},{value:"Deploying to Stormkit",id:"deploying-to-stormkit",level:2},{value:"Deploying to QuantCDN",id:"deploying-to-quantcdn",level:2},{value:"Deploying to Layer0",id:"deploying-to-layer0",level:2},{value:"Deploying to Cloudflare Pages",id:"deploying-to-cloudflare-pages",level:2},{value:"Deploying to Azure Static Web Apps",id:"deploying-to-azure-static-web-apps",level:2},{value:"Deploying to Kinsta",id:"deploying-to-kinsta",level:2}];function u(e){let n={a:"a",admonition:"admonition",code:"code",em:"em",h1:"h1",h2:"h2",h3:"h3",header:"header",img:"img",li:"li",ol:"ol",p:"p",pre:"pre",strong:"strong",table:"table",tbody:"tbody",td:"td",th:"th",thead:"thead",tr:"tr",ul:"ul",...(0,o.a)(),...e.components},{Details:s}=n;return s||function(e,n){throw Error("Expected "+(n?"component":"object")+" `"+e+"` to be defined: you likely forgot to import, pass, or provide it.")}("Details",!0),(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(n.header,{children:(0,t.jsx)(n.h1,{id:"deployment",children:"Deployment"})}),"\n",(0,t.jsx)(n.p,{children:"To build the static files of your website for production, run:"}),"\n",(0,t.jsxs)(r.Z,{groupId:"npm2yarn",children:[(0,t.jsx)(l.Z,{value:"npm",children:(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-bash",children:"npm run build\n"})})}),(0,t.jsx)(l.Z,{value:"yarn",label:"Yarn",children:(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-bash",children:"yarn build\n"})})}),(0,t.jsx)(l.Z,{value:"pnpm",label:"pnpm",children:(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-bash",children:"pnpm run build\n"})})}),(0,t.jsx)(l.Z,{value:"bun",label:"Bun",children:(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-bash",children:"bun run build\n"})})})]}),"\n",(0,t.jsxs)(n.p,{children:["Once it finishes, the static files will be generated within the ",(0,t.jsx)(n.code,{children:"build"})," directory."]}),"\n",(0,t.jsxs)(n.admonition,{type:"note",children:[(0,t.jsxs)(n.p,{children:["The only responsibility of Docusaurus is to build your site and emit static files in ",(0,t.jsx)(n.code,{children:"build"}),"."]}),(0,t.jsx)(n.p,{children:"It is now up to you to choose how to host those static files."})]}),"\n",(0,t.jsxs)(n.p,{children:["You can deploy your site to static site hosting services such as ",(0,t.jsx)(n.a,{href:"https://vercel.com/",children:"Vercel"}),", ",(0,t.jsx)(n.a,{href:"https://pages.github.com/",children:"GitHub Pages"}),", ",(0,t.jsx)(n.a,{href:"https://www.netlify.com/",children:"Netlify"}),", ",(0,t.jsx)(n.a,{href:"https://render.com/docs/static-sites",children:"Render"}),", and ",(0,t.jsx)(n.a,{href:"https://surge.sh/help/getting-started-with-surge",children:"Surge"}),"."]}),"\n",(0,t.jsx)(n.p,{children:"A Docusaurus site is statically rendered, and it can generally work without JavaScript!"}),"\n",(0,t.jsx)(n.h2,{id:"configuration",children:"Configuration"}),"\n",(0,t.jsxs)(n.p,{children:["The following parameters are required in ",(0,t.jsx)(n.code,{children:"docusaurus.config.js"})," to optimize routing and serve files from the correct location:"]}),"\n",(0,t.jsxs)(n.table,{children:[(0,t.jsx)(n.thead,{children:(0,t.jsxs)(n.tr,{children:[(0,t.jsx)(n.th,{children:"Name"}),(0,t.jsx)(n.th,{children:"Description"})]})}),(0,t.jsxs)(n.tbody,{children:[(0,t.jsxs)(n.tr,{children:[(0,t.jsx)(n.td,{children:(0,t.jsx)(n.code,{children:"url"})}),(0,t.jsxs)(n.td,{children:["URL for your site. For a site deployed at ",(0,t.jsx)(n.code,{children:"https://my-org.com/my-project/"}),", ",(0,t.jsx)(n.code,{children:"url"})," is ",(0,t.jsx)(n.code,{children:"https://my-org.com/"}),"."]})]}),(0,t.jsxs)(n.tr,{children:[(0,t.jsx)(n.td,{children:(0,t.jsx)(n.code,{children:"baseUrl"})}),(0,t.jsxs)(n.td,{children:["Base URL for your project, with a trailing slash. For a site deployed at ",(0,t.jsx)(n.code,{children:"https://my-org.com/my-project/"}),", ",(0,t.jsx)(n.code,{children:"baseUrl"})," is ",(0,t.jsx)(n.code,{children:"/my-project/"}),"."]})]})]})]}),"\n",(0,t.jsx)(n.h2,{id:"testing-build-locally",children:"Testing your Build Locally"}),"\n",(0,t.jsxs)(n.p,{children:["It is important to test your build locally before deploying it for production. Docusaurus provides a ",(0,t.jsx)(n.a,{href:"/docs/cli#docusaurus-serve-sitedir",children:(0,t.jsx)(n.code,{children:"docusaurus serve"})})," command for that:"]}),"\n",(0,t.jsxs)(r.Z,{groupId:"npm2yarn",children:[(0,t.jsx)(l.Z,{value:"npm",children:(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-bash",children:"npm run serve\n"})})}),(0,t.jsx)(l.Z,{value:"yarn",label:"Yarn",children:(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-bash",children:"yarn serve\n"})})}),(0,t.jsx)(l.Z,{value:"pnpm",label:"pnpm",children:(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-bash",children:"pnpm run serve\n"})})}),(0,t.jsx)(l.Z,{value:"bun",label:"Bun",children:(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-bash",children:"bun run serve\n"})})})]}),"\n",(0,t.jsxs)(n.p,{children:["By default, this will load your site at ",(0,t.jsx)(n.a,{href:"http://localhost:3000/",children:(0,t.jsx)(n.code,{children:"http://localhost:3000/"})}),"."]}),"\n",(0,t.jsx)(n.h2,{id:"trailing-slashes",children:"Trailing slash configuration"}),"\n",(0,t.jsxs)(n.p,{children:["Docusaurus has a ",(0,t.jsxs)(n.a,{href:"/docs/api/docusaurus-config#trailingSlash",children:[(0,t.jsx)(n.code,{children:"trailingSlash"})," config"]})," to allow customizing URLs/links and emitted filename patterns."]}),"\n",(0,t.jsxs)(n.p,{children:["The default value generally works fine. Unfortunately, each static hosting provider has a ",(0,t.jsx)(n.strong,{children:"different behavior"}),", and deploying the exact same site to various hosts can lead to distinct results. Depending on your host, it can be useful to change this config."]}),"\n",(0,t.jsx)(n.admonition,{type:"tip",children:(0,t.jsxs)(n.p,{children:["Use ",(0,t.jsx)(n.a,{href:"https://github.com/slorber/trailing-slash-guide",children:"slorber/trailing-slash-guide"})," to understand better the behavior of your host and configure ",(0,t.jsx)(n.code,{children:"trailingSlash"})," appropriately."]})}),"\n",(0,t.jsx)(n.h2,{id:"using-environment-variables",children:"Using environment variables"}),"\n",(0,t.jsxs)(n.p,{children:["Putting potentially sensitive information in the environment is common practice. However, in a typical Docusaurus website, the ",(0,t.jsx)(n.code,{children:"docusaurus.config.js"})," file is the only interface to the Node.js environment (see ",(0,t.jsx)(n.a,{href:"/docs/advanced/architecture",children:"our architecture overview"}),"), while everything else (MDX pages, React components, etc.) are client side and do not have direct access to the ",(0,t.jsx)(n.code,{children:"process"})," global variable. In this case, you can consider using ",(0,t.jsx)(n.a,{href:"/docs/api/docusaurus-config#customFields",children:(0,t.jsx)(n.code,{children:"customFields"})})," to pass environment variables to the client side."]}),"\n",(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-js",metastring:'title="docusaurus.config.js"',children:"// If you are using dotenv (https://www.npmjs.com/package/dotenv)\nimport 'dotenv/config';\n\nexport default {\n title: '...',\n url: process.env.URL, // You can use environment variables to control site specifics as well\n // highlight-start\n customFields: {\n // Put your custom environment here\n teamEmail: process.env.EMAIL,\n },\n // highlight-end\n};\n"})}),"\n",(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-jsx",metastring:'title="home.jsx"',children:"import useDocusaurusContext from '@docusaurus/useDocusaurusContext';\n\nexport default function Home() {\n const {\n siteConfig: {customFields},\n } = useDocusaurusContext();\n returnContact us through {customFields.teamEmail}!;\n}\n"})}),"\n",(0,t.jsx)(n.h2,{id:"choosing-a-hosting-provider",children:"Choosing a hosting provider"}),"\n",(0,t.jsx)(n.p,{children:"There are a few common hosting options:"}),"\n",(0,t.jsxs)(n.ul,{children:["\n",(0,t.jsxs)(n.li,{children:[(0,t.jsx)(n.a,{href:"#self-hosting",children:"Self hosting"})," with an HTTP server like Apache2 or Nginx."]}),"\n",(0,t.jsxs)(n.li,{children:["Jamstack providers (e.g. ",(0,t.jsx)(n.a,{href:"#deploying-to-netlify",children:"Netlify"})," and ",(0,t.jsx)(n.a,{href:"#deploying-to-vercel",children:"Vercel"}),"). We will use them as references, but the same reasoning can apply to other providers."]}),"\n",(0,t.jsxs)(n.li,{children:[(0,t.jsx)(n.a,{href:"#deploying-to-github-pages",children:"GitHub Pages"})," (by definition, it is also Jamstack, but we compare it separately)."]}),"\n"]}),"\n",(0,t.jsx)(n.p,{children:"If you are unsure of which one to choose, ask the following questions:"}),"\n",(0,t.jsxs)(s,{children:[(0,t.jsx)("summary",{children:(0,t.jsx)(n.p,{children:"How many resources (money, person-hours, etc.) am I willing to invest in this?"})}),(0,t.jsxs)(n.ul,{children:["\n",(0,t.jsx)(n.li,{children:"\uD83D\uDD34 Self-hosting requires experience in networking as well as Linux and web server administration. It's the most difficult option, and would require the most time to manage successfully. Expense-wise, cloud services are almost never free, and purchasing/deploying an onsite server can be even more costly."}),"\n",(0,t.jsx)(n.li,{children:"\uD83D\uDFE2 Jamstack providers can help you set up a working website in almost no time and offer features like server-side redirects that are easily configurable. Many providers offer generous build-time quotas even for free plans that you would almost never exceed. However, free plans have limits, and you would need to pay once you hit those limits. Check the pricing page of your provider for details."}),"\n",(0,t.jsxs)(n.li,{children:["\uD83D\uDFE1 The GitHub Pages deployment workflow can be tedious to set up. (Evidence: see the length of ",(0,t.jsx)(n.a,{href:"#deploying-to-github-pages",children:"Deploying to GitHub Pages"}),"!) However, this service (including build and deployment) is always free for public repositories, and we have detailed instructions to help you make it work."]}),"\n"]})]}),"\n",(0,t.jsxs)(s,{children:[(0,t.jsx)("summary",{children:"How much server-side customization do I need?"}),(0,t.jsxs)(n.ul,{children:["\n",(0,t.jsx)(n.li,{children:"\uD83D\uDFE2 With self-hosting, you have access to the entire server's configuration. You can configure the virtual host to serve different content based on the request URL, you can do complicated server-side redirects, you can implement authentication, and so on. If you need a lot of server-side features, self-host your website."}),"\n",(0,t.jsx)(n.li,{children:"\uD83D\uDFE1 Jamstack usually offers some server-side configuration (e.g. URL formatting (trailing slashes), server-side redirects, etc.)."}),"\n",(0,t.jsx)(n.li,{children:"\uD83D\uDD34 GitHub Pages doesn't expose server-side configuration besides enforcing HTTPS and setting CNAME records."}),"\n"]})]}),"\n",(0,t.jsxs)(s,{children:[(0,t.jsx)("summary",{children:"Do I need collaboration-friendly deployment workflows?"}),(0,t.jsxs)(n.ul,{children:["\n",(0,t.jsx)(n.li,{children:"\uD83D\uDFE1 Self-hosted services can leverage continuous deployment functionality like Netlify, but more heavy-lifting is involved. Usually, you would designate a specific person to manage the deployment, and the workflow wouldn't be very git-based as opposed to the other two options."}),"\n",(0,t.jsx)(n.li,{children:"\uD83D\uDFE2 Netlify and Vercel have deploy previews for every pull request, which is useful for a team to review work before merging to production. You can also manage a team with different member access to the deployment."}),"\n",(0,t.jsx)(n.li,{children:"\uD83D\uDFE1 GitHub Pages cannot do deploy previews in a non-convoluted way. One repo can only be associated with one site deployment. On the other hand, you can control who has write access to the site's deployment."}),"\n"]})]}),"\n",(0,t.jsx)(n.p,{children:"There isn't a silver bullet. You need to weigh your needs and resources before making a choice."}),"\n",(0,t.jsx)(n.h2,{id:"self-hosting",children:"Self-Hosting"}),"\n",(0,t.jsxs)(n.p,{children:["Docusaurus can be self-hosted using ",(0,t.jsx)(n.a,{href:"/docs/cli#docusaurus-serve-sitedir",children:(0,t.jsx)(n.code,{children:"docusaurus serve"})}),". Change port using ",(0,t.jsx)(n.code,{children:"--port"})," and ",(0,t.jsx)(n.code,{children:"--host"})," to change host."]}),"\n",(0,t.jsxs)(r.Z,{groupId:"npm2yarn",children:[(0,t.jsx)(l.Z,{value:"npm",children:(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-bash",children:"npm run serve -- --build --port 80 --host 0.0.0.0\n"})})}),(0,t.jsx)(l.Z,{value:"yarn",label:"Yarn",children:(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-bash",children:"yarn serve --build --port 80 --host 0.0.0.0\n"})})}),(0,t.jsx)(l.Z,{value:"pnpm",label:"pnpm",children:(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-bash",children:"pnpm run serve --build --port 80 --host 0.0.0.0\n"})})}),(0,t.jsx)(l.Z,{value:"bun",label:"Bun",children:(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-bash",children:"bun run serve --build --port 80 --host 0.0.0.0\n"})})})]}),"\n",(0,t.jsx)(n.admonition,{type:"warning",children:(0,t.jsx)(n.p,{children:"It is not the best option, compared to a static hosting provider / CDN."})}),"\n",(0,t.jsxs)(n.admonition,{type:"warning",children:[(0,t.jsx)(n.p,{children:"In the following sections, we will introduce a few common hosting providers and how they should be configured to deploy Docusaurus sites most efficiently. Docusaurus is not affiliated with any of these services, and this information is provided for convenience only. Some of the write-ups are provided by third-parties, and recent API changes may not be reflected on our side. If you see outdated content, PRs are welcome."}),(0,t.jsx)(n.p,{children:"Because we can only provide this content on a best-effort basis only, we have stopped accepting PRs adding new hosting options. You can, however, publish your writeup on a separate site (e.g. your blog, or the provider's official website), and ask us to include a link to your writeup."})]}),"\n",(0,t.jsx)(n.h2,{id:"deploying-to-netlify",children:"Deploying to Netlify"}),"\n",(0,t.jsxs)(n.p,{children:["To deploy your Docusaurus sites to ",(0,t.jsx)(n.a,{href:"https://www.netlify.com/",children:"Netlify"}),", first make sure the following options are properly configured:"]}),"\n",(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-js",metastring:'title="docusaurus.config.js"',children:"export default {\n // highlight-start\n url: 'https://docusaurus-2.netlify.app', // Url to your site with no trailing slash\n baseUrl: '/', // Base directory of your site relative to your repo\n // highlight-end\n // ...\n};\n"})}),"\n",(0,t.jsxs)(n.p,{children:["Then, ",(0,t.jsx)(n.a,{href:"https://app.netlify.com/start",children:"create your site with Netlify"}),"."]}),"\n",(0,t.jsx)(n.p,{children:"While you set up the site, specify the build commands and directories as follows:"}),"\n",(0,t.jsxs)(n.ul,{children:["\n",(0,t.jsxs)(n.li,{children:["build command: ",(0,t.jsx)(n.code,{children:"npm run build"})]}),"\n",(0,t.jsxs)(n.li,{children:["publish directory: ",(0,t.jsx)(n.code,{children:"build"})]}),"\n"]}),"\n",(0,t.jsx)(n.p,{children:'If you did not configure these build options, you may still go to "Site settings" -> "Build & deploy" after your site is created.'}),"\n",(0,t.jsxs)(n.p,{children:["Once properly configured with the above options, your site should deploy and automatically redeploy upon merging to your deploy branch, which defaults to ",(0,t.jsx)(n.code,{children:"main"}),"."]}),"\n",(0,t.jsxs)(n.admonition,{type:"warning",children:[(0,t.jsxs)(n.p,{children:["Some Docusaurus sites put the ",(0,t.jsx)(n.code,{children:"docs"})," folder outside of ",(0,t.jsx)(n.code,{children:"website"})," (most likely former Docusaurus v1 sites):"]}),(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-bash",children:"repo # git root\n\u251C\u2500\u2500 docs # MD files\n\u2514\u2500\u2500 website # Docusaurus root\n"})}),(0,t.jsxs)(n.p,{children:["If you decide to use the ",(0,t.jsx)(n.code,{children:"website"})," folder as Netlify's base directory, Netlify will not trigger builds when you update the ",(0,t.jsx)(n.code,{children:"docs"})," folder, and you need to configure a ",(0,t.jsxs)(n.a,{href:"https://docs.netlify.com/configure-builds/common-configurations/ignore-builds/",children:["custom ",(0,t.jsx)(n.code,{children:"ignore"})," command"]}),":"]}),(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-toml",metastring:'title="website/netlify.toml"',children:'[build]\n ignore = "git diff --quiet $CACHED_COMMIT_REF $COMMIT_REF . ../docs/"\n'})})]}),"\n",(0,t.jsxs)(n.admonition,{type:"warning",children:[(0,t.jsx)(n.p,{children:"By default, Netlify adds trailing slashes to Docusaurus URLs."}),(0,t.jsxs)(n.p,{children:["It is recommended to disable the Netlify setting ",(0,t.jsx)(n.code,{children:"Post Processing > Asset Optimization > Pretty Urls"})," to prevent lowercase URLs, unnecessary redirects, and 404 errors."]}),(0,t.jsxs)(n.p,{children:[(0,t.jsx)(n.strong,{children:"Be very careful"}),": the ",(0,t.jsx)(n.code,{children:"Disable asset optimization"})," global checkbox is broken and does not really disable the ",(0,t.jsx)(n.code,{children:"Pretty URLs"})," setting in practice. Please make sure to ",(0,t.jsx)(n.strong,{children:"uncheck it independently"}),"."]}),(0,t.jsxs)(n.p,{children:["If you want to keep the ",(0,t.jsx)(n.code,{children:"Pretty Urls"})," Netlify setting on, adjust the ",(0,t.jsx)(n.code,{children:"trailingSlash"})," Docusaurus config appropriately."]}),(0,t.jsxs)(n.p,{children:["Refer to ",(0,t.jsx)(n.a,{href:"https://github.com/slorber/trailing-slash-guide",children:"slorber/trailing-slash-guide"})," for more information."]})]}),"\n",(0,t.jsx)(n.h2,{id:"deploying-to-vercel",children:"Deploying to Vercel"}),"\n",(0,t.jsxs)(n.p,{children:["Deploying your Docusaurus project to ",(0,t.jsx)(n.a,{href:"https://vercel.com/",children:"Vercel"})," will provide you with ",(0,t.jsx)(n.a,{href:"https://vercel.com/",children:"various benefits"})," in the areas of performance and ease of use."]}),"\n",(0,t.jsxs)(n.p,{children:["To deploy your Docusaurus project with a ",(0,t.jsx)(n.a,{href:"https://vercel.com/docs/concepts/git",children:"Vercel for Git Integration"}),", make sure it has been pushed to a Git repository."]}),"\n",(0,t.jsxs)(n.p,{children:["Import the project into Vercel using the ",(0,t.jsx)(n.a,{href:"https://vercel.com/import/git",children:"Import Flow"}),". During the import, you will find all relevant options preconfigured for you; however, you can choose to change any of these ",(0,t.jsx)(n.a,{href:"https://vercel.com/docs/build-step#build-&-development-settings",children:"options"}),"."]}),"\n",(0,t.jsxs)(n.p,{children:["After your project has been imported, all subsequent pushes to branches will generate ",(0,t.jsx)(n.a,{href:"https://vercel.com/docs/platform/deployments#preview",children:"Preview Deployments"}),", and all changes made to the ",(0,t.jsx)(n.a,{href:"https://vercel.com/docs/git-integrations#production-branch",children:"Production Branch"}),' (usually "main" or "master") will result in a ',(0,t.jsx)(n.a,{href:"https://vercel.com/docs/platform/deployments#production",children:"Production Deployment"}),"."]}),"\n",(0,t.jsx)(n.h2,{id:"deploying-to-github-pages",children:"Deploying to GitHub Pages"}),"\n",(0,t.jsxs)(n.p,{children:["Docusaurus provides an easy way to publish to ",(0,t.jsx)(n.a,{href:"https://pages.github.com/",children:"GitHub Pages"}),", which comes free with every GitHub repository."]}),"\n",(0,t.jsx)(n.h3,{id:"github-pages-overview",children:"Overview"}),"\n",(0,t.jsxs)(n.p,{children:["Usually, there are two repositories (at least two branches) involved in a publishing process: the branch containing the source files, and the branch containing the build output to be served with GitHub Pages. In the following tutorial, they will be referred to as ",(0,t.jsx)(n.strong,{children:'"source"'})," and ",(0,t.jsx)(n.strong,{children:'"deployment"'}),", respectively."]}),"\n",(0,t.jsxs)(n.p,{children:["Each GitHub repository is associated with a GitHub Pages service. If the deployment repository is called ",(0,t.jsx)(n.code,{children:"my-org/my-project"})," (where ",(0,t.jsx)(n.code,{children:"my-org"})," is the organization name or username), the deployed site will appear at ",(0,t.jsx)(n.code,{children:"https://my-org.github.io/my-project/"}),". If the deployment repository is called ",(0,t.jsx)(n.code,{children:"my-org/my-org.github.io"})," (the ",(0,t.jsx)(n.em,{children:"organization GitHub Pages repo"}),"), the site will appear at ",(0,t.jsx)(n.code,{children:"https://my-org.github.io/"}),"."]}),"\n",(0,t.jsxs)(n.admonition,{type:"info",children:[(0,t.jsxs)(n.p,{children:["In case you want to use your custom domain for GitHub Pages, create a ",(0,t.jsx)(n.code,{children:"CNAME"})," file in the ",(0,t.jsx)(n.code,{children:"static"})," directory. Anything within the ",(0,t.jsx)(n.code,{children:"static"})," directory will be copied to the root of the ",(0,t.jsx)(n.code,{children:"build"})," directory for deployment. When using a custom domain, you should be able to move back from ",(0,t.jsx)(n.code,{children:"baseUrl: '/projectName/'"})," to ",(0,t.jsx)(n.code,{children:"baseUrl: '/'"}),", and also set your ",(0,t.jsx)(n.code,{children:"url"})," to your custom domain."]}),(0,t.jsxs)(n.p,{children:["You may refer to GitHub Pages' documentation ",(0,t.jsx)(n.a,{href:"https://help.github.com/en/articles/user-organization-and-project-pages",children:"User, Organization, and Project Pages"})," for more details."]})]}),"\n",(0,t.jsxs)(n.p,{children:["GitHub Pages picks up deploy-ready files (the output from ",(0,t.jsx)(n.code,{children:"docusaurus build"}),") from the default branch (",(0,t.jsx)(n.code,{children:"master"})," / ",(0,t.jsx)(n.code,{children:"main"}),", usually) or the ",(0,t.jsx)(n.code,{children:"gh-pages"})," branch, and either from the root or the ",(0,t.jsx)(n.code,{children:"/docs"})," folder. You can configure that through ",(0,t.jsx)(n.code,{children:"Settings > Pages"}),' in your repository. This branch will be called the "deployment branch".']}),"\n",(0,t.jsxs)(n.p,{children:["We provide a ",(0,t.jsx)(n.code,{children:"docusaurus deploy"})," command that helps you deploy your site from the source branch to the deployment branch in one command: clone, build, and commit."]}),"\n",(0,t.jsxs)(n.h3,{id:"docusaurusconfigjs-settings",children:[(0,t.jsx)(n.code,{children:"docusaurus.config.js"})," settings"]}),"\n",(0,t.jsxs)(n.p,{children:["First, modify your ",(0,t.jsx)(n.code,{children:"docusaurus.config.js"})," and add the following params:"]}),"\n",(0,t.jsxs)(n.table,{children:[(0,t.jsx)(n.thead,{children:(0,t.jsxs)(n.tr,{children:[(0,t.jsx)(n.th,{children:"Name"}),(0,t.jsx)(n.th,{children:"Description"})]})}),(0,t.jsxs)(n.tbody,{children:[(0,t.jsxs)(n.tr,{children:[(0,t.jsx)(n.td,{children:(0,t.jsx)(n.code,{children:"organizationName"})}),(0,t.jsx)(n.td,{children:"The GitHub user or organization that owns the deployment repository."})]}),(0,t.jsxs)(n.tr,{children:[(0,t.jsx)(n.td,{children:(0,t.jsx)(n.code,{children:"projectName"})}),(0,t.jsx)(n.td,{children:"The name of the deployment repository."})]}),(0,t.jsxs)(n.tr,{children:[(0,t.jsx)(n.td,{children:(0,t.jsx)(n.code,{children:"deploymentBranch"})}),(0,t.jsxs)(n.td,{children:["The name of the deployment branch. It defaults to ",(0,t.jsx)(n.code,{children:"'gh-pages'"})," for non-organization GitHub Pages repos (",(0,t.jsx)(n.code,{children:"projectName"})," not ending in ",(0,t.jsx)(n.code,{children:".github.io"}),"). Otherwise, it needs to be explicit as a config field or environment variable."]})]})]})]}),"\n",(0,t.jsxs)(n.p,{children:["These fields also have their environment variable counterparts which have a higher priority: ",(0,t.jsx)(n.code,{children:"ORGANIZATION_NAME"}),", ",(0,t.jsx)(n.code,{children:"PROJECT_NAME"}),", and ",(0,t.jsx)(n.code,{children:"DEPLOYMENT_BRANCH"}),"."]}),"\n",(0,t.jsx)(n.admonition,{type:"warning",children:(0,t.jsxs)(n.p,{children:["GitHub Pages adds a trailing slash to Docusaurus URLs by default. It is recommended to set a ",(0,t.jsx)(n.code,{children:"trailingSlash"})," config (",(0,t.jsx)(n.code,{children:"true"})," or ",(0,t.jsx)(n.code,{children:"false"}),", not ",(0,t.jsx)(n.code,{children:"undefined"}),")."]})}),"\n",(0,t.jsx)(n.p,{children:"Example:"}),"\n",(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-js",metastring:'title="docusaurus.config.js"',children:"export default {\n // ...\n url: 'https://endiliey.github.io', // Your website URL\n baseUrl: '/',\n // highlight-start\n projectName: 'endiliey.github.io',\n organizationName: 'endiliey',\n trailingSlash: false,\n // highlight-end\n // ...\n};\n"})}),"\n",(0,t.jsx)(n.admonition,{type:"warning",children:(0,t.jsxs)(n.p,{children:["By default, GitHub Pages runs published files through ",(0,t.jsx)(n.a,{href:"https://jekyllrb.com/",children:"Jekyll"}),". Since Jekyll will discard any files that begin with ",(0,t.jsx)(n.code,{children:"_"}),", it is recommended that you disable Jekyll by adding an empty file named ",(0,t.jsx)(n.code,{children:".nojekyll"})," file to your ",(0,t.jsx)(n.code,{children:"static"})," directory."]})}),"\n",(0,t.jsx)(n.h3,{id:"environment-settings",children:"Environment settings"}),"\n",(0,t.jsxs)(n.table,{children:[(0,t.jsx)(n.thead,{children:(0,t.jsxs)(n.tr,{children:[(0,t.jsx)(n.th,{children:"Name"}),(0,t.jsx)(n.th,{children:"Description"})]})}),(0,t.jsxs)(n.tbody,{children:[(0,t.jsxs)(n.tr,{children:[(0,t.jsx)(n.td,{children:(0,t.jsx)(n.code,{children:"USE_SSH"})}),(0,t.jsxs)(n.td,{children:["Set to ",(0,t.jsx)(n.code,{children:"true"})," to use SSH instead of the default HTTPS for the connection to the GitHub repo. If the source repo URL is an SSH URL (e.g. ",(0,t.jsx)(n.code,{children:"git@github.com:facebook/docusaurus.git"}),"), ",(0,t.jsx)(n.code,{children:"USE_SSH"})," is inferred to be ",(0,t.jsx)(n.code,{children:"true"}),"."]})]}),(0,t.jsxs)(n.tr,{children:[(0,t.jsx)(n.td,{children:(0,t.jsx)(n.code,{children:"GIT_USER"})}),(0,t.jsxs)(n.td,{children:["The username for a GitHub account that ",(0,t.jsx)(n.strong,{children:"has push access to the deployment repo"}),". For your own repositories, this will usually be your GitHub username. Required if not using SSH, and ignored otherwise."]})]}),(0,t.jsxs)(n.tr,{children:[(0,t.jsx)(n.td,{children:(0,t.jsx)(n.code,{children:"GIT_PASS"})}),(0,t.jsxs)(n.td,{children:["Personal access token of the git user (specified by ",(0,t.jsx)(n.code,{children:"GIT_USER"}),"), to facilitate non-interactive deployment (e.g. continuous deployment)"]})]}),(0,t.jsxs)(n.tr,{children:[(0,t.jsx)(n.td,{children:(0,t.jsx)(n.code,{children:"CURRENT_BRANCH"})}),(0,t.jsxs)(n.td,{children:["The source branch. Usually, the branch will be ",(0,t.jsx)(n.code,{children:"main"})," or ",(0,t.jsx)(n.code,{children:"master"}),", but it could be any branch except for ",(0,t.jsx)(n.code,{children:"gh-pages"}),". If nothing is set for this variable, then the current branch from which ",(0,t.jsx)(n.code,{children:"docusaurus deploy"})," is invoked will be used."]})]}),(0,t.jsxs)(n.tr,{children:[(0,t.jsx)(n.td,{children:(0,t.jsx)(n.code,{children:"GIT_USER_NAME"})}),(0,t.jsxs)(n.td,{children:["The ",(0,t.jsx)(n.code,{children:"git config user.name"})," value to use when pushing to the deployment repo"]})]}),(0,t.jsxs)(n.tr,{children:[(0,t.jsx)(n.td,{children:(0,t.jsx)(n.code,{children:"GIT_USER_EMAIL"})}),(0,t.jsxs)(n.td,{children:["The ",(0,t.jsx)(n.code,{children:"git config user.email"})," value to use when pushing to the deployment repo"]})]})]})]}),"\n",(0,t.jsx)(n.p,{children:"GitHub enterprise installations should work in the same manner as github.com; you only need to set the organization's GitHub Enterprise host as an environment variable:"}),"\n",(0,t.jsxs)(n.table,{children:[(0,t.jsx)(n.thead,{children:(0,t.jsxs)(n.tr,{children:[(0,t.jsx)(n.th,{children:"Name"}),(0,t.jsx)(n.th,{children:"Description"})]})}),(0,t.jsxs)(n.tbody,{children:[(0,t.jsxs)(n.tr,{children:[(0,t.jsx)(n.td,{children:(0,t.jsx)(n.code,{children:"GITHUB_HOST"})}),(0,t.jsx)(n.td,{children:"The domain name of your GitHub enterprise site."})]}),(0,t.jsxs)(n.tr,{children:[(0,t.jsx)(n.td,{children:(0,t.jsx)(n.code,{children:"GITHUB_PORT"})}),(0,t.jsx)(n.td,{children:"The port of your GitHub enterprise site."})]})]})]}),"\n",(0,t.jsx)(n.h3,{id:"deploy",children:"Deploy"}),"\n",(0,t.jsx)(n.p,{children:"Finally, to deploy your site to GitHub Pages, run:"}),"\n",(0,t.jsxs)(r.Z,{children:[(0,t.jsx)(l.Z,{value:"bash",label:"Bash",children:(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-bash",children:"GIT_USER=yarn deploy\n"})})}),(0,t.jsx)(l.Z,{value:"windows",label:"Windows",children:(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-batch",children:'cmd /C "set "GIT_USER= " && yarn deploy"\n'})})}),(0,t.jsx)(l.Z,{value:"powershell",label:"PowerShell",children:(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-powershell",children:"cmd /C 'set \"GIT_USER= \" && yarn deploy'\n"})})})]}),"\n",(0,t.jsxs)(n.admonition,{type:"warning",children:[(0,t.jsxs)(n.p,{children:["Beginning in August 2021, GitHub requires every command-line sign-in to use the ",(0,t.jsx)(n.strong,{children:"personal access token"})," instead of the password. When GitHub prompts for your password, enter the PAT instead. See the ",(0,t.jsx)(n.a,{href:"https://docs.github.com/en/authentication/keeping-your-account-and-data-secure/creating-a-personal-access-token",children:"GitHub documentation"})," for more information."]}),(0,t.jsxs)(n.p,{children:["Alternatively, you can use SSH (",(0,t.jsx)(n.code,{children:"USE_SSH=true"}),") to log in."]})]}),"\n",(0,t.jsx)(n.h3,{id:"triggering-deployment-with-github-actions",children:"Triggering deployment with GitHub Actions"}),"\n",(0,t.jsxs)(n.p,{children:[(0,t.jsx)(n.a,{href:"https://help.github.com/en/actions",children:"GitHub Actions"})," allow you to automate, customize, and execute your software development workflows right in your repository."]}),"\n",(0,t.jsxs)(n.p,{children:["The workflow examples below assume your website source resides in the ",(0,t.jsx)(n.code,{children:"main"})," branch of your repository (the ",(0,t.jsx)(n.em,{children:"source branch"})," is ",(0,t.jsx)(n.code,{children:"main"}),"), and your ",(0,t.jsx)(n.a,{href:"https://help.github.com/en/github/working-with-github-pages/configuring-a-publishing-source-for-your-github-pages-site",children:"publishing source"})," is configured for ",(0,t.jsx)(n.a,{href:"https://docs.github.com/en/pages/getting-started-with-github-pages/configuring-a-publishing-source-for-your-github-pages-site#publishing-with-a-custom-github-actions-workflow",children:"publishing with a custom GitHub Actions Workflow"}),"."]}),"\n",(0,t.jsx)(n.p,{children:"Our goal is that:"}),"\n",(0,t.jsxs)(n.ol,{children:["\n",(0,t.jsxs)(n.li,{children:["When a new pull request is made to ",(0,t.jsx)(n.code,{children:"main"}),", there's an action that ensures the site builds successfully, without actually deploying. This job will be called ",(0,t.jsx)(n.code,{children:"test-deploy"}),"."]}),"\n",(0,t.jsxs)(n.li,{children:["When a pull request is merged to the ",(0,t.jsx)(n.code,{children:"main"})," branch or someone pushes to the ",(0,t.jsx)(n.code,{children:"main"})," branch directly, it will be built and deployed to GitHub Pages. This job will be called ",(0,t.jsx)(n.code,{children:"deploy"}),"."]}),"\n"]}),"\n",(0,t.jsx)(n.p,{children:"Here are two approaches to deploying your docs with GitHub Actions. Based on the location of your deployment repository, choose the relevant tab below:"}),"\n",(0,t.jsxs)(n.ul,{children:["\n",(0,t.jsxs)(n.li,{children:["Source repo and deployment repo are the ",(0,t.jsx)(n.strong,{children:"same"})," repository."]}),"\n",(0,t.jsxs)(n.li,{children:["The deployment repo is a ",(0,t.jsx)(n.strong,{children:"remote"})," repository, different from the source. Instructions for this scenario assume ",(0,t.jsx)(n.a,{href:"https://help.github.com/en/github/working-with-github-pages/configuring-a-publishing-source-for-your-github-pages-site",children:"publishing source"})," is the ",(0,t.jsx)(n.code,{children:"gh-pages"})," branch."]}),"\n"]}),"\n",(0,t.jsxs)(r.Z,{children:[(0,t.jsxs)(l.Z,{value:"same",label:"Same",children:[(0,t.jsxs)(n.p,{children:["While you can have both jobs defined in the same workflow file, the original ",(0,t.jsx)(n.code,{children:"deploy"})," workflow will always be listed as skipped in the PR check suite status, which is not indicative of the actual status and provides no value to the review process. We therefore propose to manage them as separate workflows instead."]}),(0,t.jsxs)(s,{children:[(0,t.jsx)("summary",{children:"GitHub action files"}),(0,t.jsx)(n.p,{children:"Add these two workflow files:"}),(0,t.jsxs)(n.admonition,{title:"Tweak the parameters for your setup",type:"warning",children:[(0,t.jsxs)(n.p,{children:["These files assume you are using Yarn. If you use npm, change ",(0,t.jsx)(n.code,{children:"cache: yarn"}),", ",(0,t.jsx)(n.code,{children:"yarn install --frozen-lockfile"}),", ",(0,t.jsx)(n.code,{children:"yarn build"})," to ",(0,t.jsx)(n.code,{children:"cache: npm"}),", ",(0,t.jsx)(n.code,{children:"npm ci"}),", ",(0,t.jsx)(n.code,{children:"npm run build"})," accordingly."]}),(0,t.jsxs)(n.p,{children:["If your Docusaurus project is not at the root of your repo, you may need to configure a ",(0,t.jsx)(n.a,{href:"https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#example-set-the-default-shell-and-working-directory",children:"default working directory"}),", and adjust the paths accordingly."]})]}),(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-yml",metastring:'title=".github/workflows/deploy.yml"',children:"name: Deploy to GitHub Pages\n\non:\n push:\n branches:\n - main\n # Review gh actions docs if you want to further define triggers, paths, etc\n # https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#on\n\njobs:\n build:\n name: Build Docusaurus\n runs-on: ubuntu-latest\n steps:\n - uses: actions/checkout@v4\n with:\n fetch-depth: 0\n - uses: actions/setup-node@v4\n with:\n node-version: 18\n cache: yarn\n\n - name: Install dependencies\n run: yarn install --frozen-lockfile\n - name: Build website\n run: yarn build\n\n - name: Upload Build Artifact\n uses: actions/upload-pages-artifact@v3\n with:\n path: build\n\n deploy:\n name: Deploy to GitHub Pages\n needs: build\n\n # Grant GITHUB_TOKEN the permissions required to make a Pages deployment\n permissions:\n pages: write # to deploy to Pages\n id-token: write # to verify the deployment originates from an appropriate source\n\n # Deploy to the github-pages environment\n environment:\n name: github-pages\n url: ${{ steps.deployment.outputs.page_url }}\n\n runs-on: ubuntu-latest\n steps:\n - name: Deploy to GitHub Pages\n id: deployment\n uses: actions/deploy-pages@v4\n"})}),(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-yml",metastring:'title=".github/workflows/test-deploy.yml"',children:"name: Test deployment\n\non:\n pull_request:\n branches:\n - main\n # Review gh actions docs if you want to further define triggers, paths, etc\n # https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#on\n\njobs:\n test-deploy:\n name: Test deployment\n runs-on: ubuntu-latest\n steps:\n - uses: actions/checkout@v4\n with:\n fetch-depth: 0\n - uses: actions/setup-node@v4\n with:\n node-version: 18\n cache: yarn\n\n - name: Install dependencies\n run: yarn install --frozen-lockfile\n - name: Test build website\n run: yarn build\n"})})]})]}),(0,t.jsxs)(l.Z,{value:"remote",label:"Remote",children:[(0,t.jsx)(n.p,{children:"A cross-repo publish is more difficult to set up because you need to push to another repo with permission checks. We will be using SSH to do the authentication."}),(0,t.jsxs)(n.ol,{children:["\n",(0,t.jsxs)(n.li,{children:["Generate a new ",(0,t.jsx)(n.a,{href:"https://help.github.com/en/github/authenticating-to-github/generating-a-new-ssh-key-and-adding-it-to-the-ssh-agent",children:"SSH key"}),". Since this SSH key will be used in CI, make sure to not enter any passphrase."]}),"\n",(0,t.jsxs)(n.li,{children:["By default, your public key should have been created in ",(0,t.jsx)(n.code,{children:"~/.ssh/id_rsa.pub"}),"; otherwise, use the name you've provided in the previous step to add your key to ",(0,t.jsx)(n.a,{href:"https://developer.github.com/v3/guides/managing-deploy-keys/",children:"GitHub deploy keys"}),"."]}),"\n",(0,t.jsxs)(n.li,{children:["Copy the key to clipboard with ",(0,t.jsx)(n.code,{children:"pbcopy < ~/.ssh/id_rsa.pub"})," and paste it as a ",(0,t.jsx)(n.a,{href:"https://developer.github.com/v3/guides/managing-deploy-keys/#deploy-keys",children:"deploy key"})," in the deployment repository. Copy the file content if the command line doesn't work for you. Check the box for ",(0,t.jsx)(n.code,{children:"Allow write access"})," before saving your deployment key."]}),"\n",(0,t.jsxs)(n.li,{children:["You'll need your private key as a ",(0,t.jsx)(n.a,{href:"https://help.github.com/en/actions/configuring-and-managing-workflows/creating-and-storing-encrypted-secrets",children:"GitHub secret"})," to allow Docusaurus to run the deployment for you."]}),"\n",(0,t.jsxs)(n.li,{children:["Copy your private key with ",(0,t.jsx)(n.code,{children:"pbcopy < ~/.ssh/id_rsa"})," and paste a GitHub secret with the name ",(0,t.jsx)(n.code,{children:"GH_PAGES_DEPLOY"})," on your source repository. Copy the file content if the command line doesn't work for you. Save your secret."]}),"\n",(0,t.jsxs)(n.li,{children:["Create your ",(0,t.jsx)(n.a,{href:"https://docs.github.com/en/actions/use-cases-and-examples/creating-an-example-workflow",children:"documentation workflow"})," in the ",(0,t.jsx)(n.code,{children:".github/workflows/"})," directory. In this example it's the ",(0,t.jsx)(n.code,{children:"deploy.yml"})," file."]}),"\n"]}),(0,t.jsx)(n.p,{children:"At this point, you should have:"}),(0,t.jsxs)(n.ul,{children:["\n",(0,t.jsx)(n.li,{children:"the source repo with the GitHub workflow set with the private SSH key as the GitHub Secret, and"}),"\n",(0,t.jsx)(n.li,{children:"your deployment repo set with the public SSH key in GitHub Deploy Keys."}),"\n"]}),(0,t.jsxs)(s,{children:[(0,t.jsx)("summary",{children:"GitHub action file"}),(0,t.jsxs)(n.admonition,{type:"warning",children:[(0,t.jsxs)(n.p,{children:["Please make sure that you replace ",(0,t.jsx)(n.code,{children:"actions@github.com"})," with your GitHub email and ",(0,t.jsx)(n.code,{children:"gh-actions"})," with your name."]}),(0,t.jsxs)(n.p,{children:["This file assumes you are using Yarn. If you use npm, change ",(0,t.jsx)(n.code,{children:"cache: yarn"}),", ",(0,t.jsx)(n.code,{children:"yarn install --frozen-lockfile"}),", ",(0,t.jsx)(n.code,{children:"yarn build"})," to ",(0,t.jsx)(n.code,{children:"cache: npm"}),", ",(0,t.jsx)(n.code,{children:"npm ci"}),", ",(0,t.jsx)(n.code,{children:"npm run build"})," accordingly."]})]}),(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-yml",metastring:'title=".github/workflows/deploy.yml"',children:"name: Deploy to GitHub Pages\n\non:\n pull_request:\n branches: [main]\n push:\n branches: [main]\n\npermissions:\n contents: write\n\njobs:\n test-deploy:\n if: github.event_name != 'push'\n runs-on: ubuntu-latest\n steps:\n - uses: actions/checkout@v4\n with:\n fetch-depth: 0\n - uses: actions/setup-node@v4\n with:\n node-version: 18\n cache: yarn\n - name: Install dependencies\n run: yarn install --frozen-lockfile\n - name: Test build website\n run: yarn build\n deploy:\n if: github.event_name != 'pull_request'\n runs-on: ubuntu-latest\n steps:\n - uses: actions/checkout@v4\n with:\n fetch-depth: 0\n - uses: actions/setup-node@v4\n with:\n node-version: 18\n cache: yarn\n - uses: webfactory/ssh-agent@v0.5.0\n with:\n ssh-private-key: ${{ secrets.GH_PAGES_DEPLOY }}\n - name: Deploy to GitHub Pages\n env:\n USE_SSH: true\n run: |\n git config --global user.email \"actions@github.com\"\n git config --global user.name \"gh-actions\"\n yarn install --frozen-lockfile\n yarn deploy\n"})})]})]})]}),"\n",(0,t.jsxs)(s,{children:[(0,t.jsx)("summary",{children:"Site not deployed properly?"}),(0,t.jsx)(n.p,{children:"After pushing to main, if you don't see your site published at the desired location (for example, it says \"There isn't a GitHub Pages site here\", or it's showing your repo's README.md file), try the following:"}),(0,t.jsxs)(n.ul,{children:["\n",(0,t.jsx)(n.li,{children:"Wait about three minutes and refresh. It may take a few minutes for GitHub pages to pick up the new files."}),"\n",(0,t.jsx)(n.li,{children:"Check your repo's landing page for a little green tick next to the last commit's title, indicating the CI has passed. If you see a cross, it means the build or deployment failed, and you should check the log for more debugging information."}),"\n",(0,t.jsxs)(n.li,{children:['Click on the tick and make sure you see a "Deploy to GitHub Pages" workflow. Names like "pages build and deployment / deploy" are GitHub\'s default workflows, indicating your custom deployment workflow failed to be triggered at all. Make sure the YAML files are placed under the ',(0,t.jsx)(n.code,{children:".github/workflows"}),' folder, and that the trigger condition is set correctly (e.g., if your default branch is "master" instead of "main", you need to change the ',(0,t.jsx)(n.code,{children:"on.push"})," property)."]}),"\n",(0,t.jsxs)(n.li,{children:['Under your repo\'s Settings > Pages, make sure the "Source" (which is the source for the ',(0,t.jsx)(n.em,{children:"deployment"}),' files, not "source" as in our terminology) is set to "gh-pages" + "/ (root)", since we are using ',(0,t.jsx)(n.code,{children:"gh-pages"})," as the deployment branch."]}),"\n"]}),(0,t.jsx)(n.p,{children:"If you are using a custom domain:"}),(0,t.jsxs)(n.ul,{children:["\n",(0,t.jsxs)(n.li,{children:["Verify that you have the correct DNS records set up if you're using a custom domain. See ",(0,t.jsx)(n.a,{href:"https://docs.github.com/en/pages/configuring-a-custom-domain-for-your-github-pages-site/about-custom-domains-and-github-pages",children:"GitHub pages documentation on configuring custom domains"}),". Also, please be aware that it may take up to 24 hours for DNS changes to propagate through the internet."]}),"\n"]})]}),"\n",(0,t.jsx)(n.h3,{id:"triggering-deployment-with-travis-ci",children:"Triggering deployment with Travis CI"}),"\n",(0,t.jsxs)(n.p,{children:["Continuous integration (CI) services are typically used to perform routine tasks whenever new commits are checked in to source control. These tasks can be any combination of running unit tests and integration tests, automating builds, publishing packages to npm, and deploying changes to your website. All you need to do to automate the deployment of your website is to invoke the ",(0,t.jsx)(n.code,{children:"yarn deploy"})," script whenever your website is updated. The following section covers how to do just that using ",(0,t.jsx)(n.a,{href:"https://travis-ci.com/",children:"Travis CI"}),", a popular continuous integration service provider."]}),"\n",(0,t.jsxs)(n.ol,{children:["\n",(0,t.jsxs)(n.li,{children:["Go to ",(0,t.jsx)(n.a,{href:"https://github.com/settings/tokens",children:"https://github.com/settings/tokens"})," and generate a new ",(0,t.jsx)(n.a,{href:"https://help.github.com/articles/creating-a-personal-access-token-for-the-command-line/",children:"personal access token"}),". When creating the token, grant it the ",(0,t.jsx)(n.code,{children:"repo"})," scope so that it has the permissions it needs."]}),"\n",(0,t.jsxs)(n.li,{children:["Using your GitHub account, ",(0,t.jsx)(n.a,{href:"https://github.com/marketplace/travis-ci",children:"add the Travis CI app"})," to the repository you want to activate."]}),"\n",(0,t.jsxs)(n.li,{children:["Open your Travis CI dashboard. The URL looks like ",(0,t.jsx)(n.code,{children:"https://travis-ci.com/USERNAME/REPO"}),", and navigate to the ",(0,t.jsx)(n.code,{children:"More options > Setting > Environment Variables"})," section of your repository."]}),"\n",(0,t.jsxs)(n.li,{children:["Create a new environment variable named ",(0,t.jsx)(n.code,{children:"GH_TOKEN"})," with your newly generated token as its value, then ",(0,t.jsx)(n.code,{children:"GH_EMAIL"})," (your email address) and ",(0,t.jsx)(n.code,{children:"GH_NAME"})," (your GitHub username)."]}),"\n",(0,t.jsxs)(n.li,{children:["Create a ",(0,t.jsx)(n.code,{children:".travis.yml"})," on the root of your repository with the following:"]}),"\n"]}),"\n",(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-yml",metastring:'title=".travis.yml"',children:'language: node_js\nnode_js:\n - 18\nbranches:\n only:\n - main\ncache:\n yarn: true\nscript:\n - git config --global user.name "${GH_NAME}"\n - git config --global user.email "${GH_EMAIL}"\n - echo "machine github.com login ${GH_NAME} password ${GH_TOKEN}" > ~/.netrc\n - yarn install\n - GIT_USER="${GH_NAME}" yarn deploy\n'})}),"\n",(0,t.jsxs)(n.p,{children:["Now, whenever a new commit lands in ",(0,t.jsx)(n.code,{children:"main"}),", Travis CI will run your suite of tests and if everything passes, your website will be deployed via the ",(0,t.jsx)(n.code,{children:"yarn deploy"})," script."]}),"\n",(0,t.jsx)(n.h3,{id:"triggering-deployment-with-buddy",children:"Triggering deployment with Buddy"}),"\n",(0,t.jsxs)(n.p,{children:[(0,t.jsx)(n.a,{href:"https://buddy.works/",children:"Buddy"})," is an easy-to-use CI/CD tool that allows you to automate the deployment of your portal to different environments, including GitHub Pages."]}),"\n",(0,t.jsx)(n.p,{children:"Follow these steps to create a pipeline that automatically deploys a new version of your website whenever you push changes to the selected branch of your project:"}),"\n",(0,t.jsxs)(n.ol,{children:["\n",(0,t.jsxs)(n.li,{children:["Go to ",(0,t.jsx)(n.a,{href:"https://github.com/settings/tokens",children:"https://github.com/settings/tokens"})," and generate a new ",(0,t.jsx)(n.a,{href:"https://help.github.com/articles/creating-a-personal-access-token-for-the-command-line/",children:"personal access token"}),". When creating the token, grant it the ",(0,t.jsx)(n.code,{children:"repo"})," scope so that it has the permissions it needs."]}),"\n",(0,t.jsx)(n.li,{children:"Sign in to your Buddy account and create a new project."}),"\n",(0,t.jsx)(n.li,{children:"Choose GitHub as your git hosting provider and select the repository with the code of your website."}),"\n",(0,t.jsxs)(n.li,{children:["Using the left navigation panel, switch to the ",(0,t.jsx)(n.code,{children:"Pipelines"})," view."]}),"\n",(0,t.jsxs)(n.li,{children:["Create a new pipeline. Define its name, set the trigger mode to ",(0,t.jsx)(n.code,{children:"On push"}),", and select the branch that triggers the pipeline execution."]}),"\n",(0,t.jsxs)(n.li,{children:["Add a ",(0,t.jsx)(n.code,{children:"Node.js"})," action."]}),"\n",(0,t.jsx)(n.li,{children:"Add these commands in the action's terminal:"}),"\n"]}),"\n",(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-bash",children:'GIT_USER= \ngit config --global user.email " "\ngit config --global user.name " "\nyarn deploy\n'})}),"\n",(0,t.jsxs)(n.p,{children:["After creating this simple pipeline, each new commit pushed to the branch you selected deploys your website to GitHub Pages using ",(0,t.jsx)(n.code,{children:"yarn deploy"}),". Read ",(0,t.jsx)(n.a,{href:"https://buddy.works/guides/react-docusaurus",children:"this guide"})," to learn more about setting up a CI/CD pipeline for Docusaurus."]}),"\n",(0,t.jsx)(n.h3,{id:"using-azure-pipelines",children:"Using Azure Pipelines"}),"\n",(0,t.jsxs)(n.ol,{children:["\n",(0,t.jsxs)(n.li,{children:["Sign Up at ",(0,t.jsx)(n.a,{href:"https://azure.microsoft.com/en-us/services/devops/pipelines/",children:"Azure Pipelines"})," if you haven't already."]}),"\n",(0,t.jsx)(n.li,{children:"Create an organization. Within the organization, create a project and connect your repository from GitHub."}),"\n",(0,t.jsxs)(n.li,{children:["Go to ",(0,t.jsx)(n.a,{href:"https://github.com/settings/tokens",children:"https://github.com/settings/tokens"})," and generate a new ",(0,t.jsx)(n.a,{href:"https://help.github.com/articles/creating-a-personal-access-token-for-the-command-line/",children:"personal access token"})," with the ",(0,t.jsx)(n.code,{children:"repo"})," scope."]}),"\n",(0,t.jsxs)(n.li,{children:["In the project page (which looks like ",(0,t.jsx)(n.code,{children:"https://dev.azure.com/ORG_NAME/REPO_NAME/_build"}),"), create a new pipeline with the following text. Also, click on edit and add a new environment variable named ",(0,t.jsx)(n.code,{children:"GH_TOKEN"})," with your newly generated token as its value, then ",(0,t.jsx)(n.code,{children:"GH_EMAIL"})," (your email address) and ",(0,t.jsx)(n.code,{children:"GH_NAME"})," (your GitHub username). Make sure to mark them as secret. Alternatively, you can also add a file named ",(0,t.jsx)(n.code,{children:"azure-pipelines.yml"})," at your repository root."]}),"\n"]}),"\n",(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-yml",metastring:'title="azure-pipelines.yml"',children:'trigger:\n - main\n\npool:\n vmImage: ubuntu-latest\n\nsteps:\n - checkout: self\n persistCredentials: true\n\n - task: NodeTool@0\n inputs:\n versionSpec: \'18\'\n displayName: Install Node.js\n\n - script: |\n git config --global user.name "${GH_NAME}"\n git config --global user.email "${GH_EMAIL}"\n git checkout -b main\n echo "machine github.com login ${GH_NAME} password ${GH_TOKEN}" > ~/.netrc\n yarn install\n GIT_USER="${GH_NAME}" yarn deploy\n env:\n GH_NAME: $(GH_NAME)\n GH_EMAIL: $(GH_EMAIL)\n GH_TOKEN: $(GH_TOKEN)\n displayName: Install and build\n'})}),"\n",(0,t.jsx)(n.h3,{id:"using-drone",children:"Using Drone"}),"\n",(0,t.jsxs)(n.ol,{children:["\n",(0,t.jsxs)(n.li,{children:["Create a new SSH key that will be the ",(0,t.jsx)(n.a,{href:"https://docs.github.com/en/free-pro-team@latest/developers/overview/managing-deploy-keys#deploy-keys",children:"deploy key"})," for your project."]}),"\n",(0,t.jsxs)(n.li,{children:["Name your private and public keys to be specific and so that it does not overwrite your other ",(0,t.jsx)(n.a,{href:"https://docs.github.com/en/free-pro-team@latest/github/authenticating-to-github/generating-a-new-ssh-key-and-adding-it-to-the-ssh-agent",children:"SSH keys"}),"."]}),"\n",(0,t.jsxs)(n.li,{children:["Go to ",(0,t.jsx)(n.code,{children:"https://github.com/USERNAME/REPO/settings/keys"})," and add a new deploy key by pasting in the public key you just generated."]}),"\n",(0,t.jsxs)(n.li,{children:["Open your Drone.io dashboard and log in. The URL looks like ",(0,t.jsx)(n.code,{children:"https://cloud.drone.io/USERNAME/REPO"}),"."]}),"\n",(0,t.jsxs)(n.li,{children:["Click on the repository, click on activate repository, and add a secret called ",(0,t.jsx)(n.code,{children:"git_deploy_private_key"})," with your private key value that you just generated."]}),"\n",(0,t.jsxs)(n.li,{children:["Create a ",(0,t.jsx)(n.code,{children:".drone.yml"})," on the root of your repository with the below text."]}),"\n"]}),"\n",(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-yml",metastring:'title=".drone.yml"',children:'kind: pipeline\ntype: docker\ntrigger:\n event:\n - tag\n- name: Website\n image: node\n commands:\n - mkdir -p $HOME/.ssh\n - ssh-keyscan -t rsa github.com >> $HOME/.ssh/known_hosts\n - echo "$GITHUB_PRIVATE_KEY" > "$HOME/.ssh/id_rsa"\n - chmod 0600 $HOME/.ssh/id_rsa\n - cd website\n - yarn install\n - yarn deploy\n environment:\n USE_SSH: true\n GITHUB_PRIVATE_KEY:\n from_secret: git_deploy_private_key\n'})}),"\n",(0,t.jsx)(n.p,{children:"Now, whenever you push a new tag to GitHub, this trigger will start the drone CI job to publish your website."}),"\n",(0,t.jsx)(n.h2,{id:"deploying-to-flightcontrol",children:"Deploying to Flightcontrol"}),"\n",(0,t.jsxs)(n.p,{children:[(0,t.jsx)(n.a,{href:"https://www.flightcontrol.dev/?ref=docusaurus",children:"Flightcontrol"})," is a service that automatically builds and deploys your web apps to AWS Fargate directly from your Git repository. It gives you full access to inspect and make infrastructure changes without the limitations of a traditional PaaS."]}),"\n",(0,t.jsxs)(n.p,{children:["Get started by following ",(0,t.jsx)(n.a,{href:"https://www.flightcontrol.dev/docs/reference/examples/docusaurus/?ref=docusaurus",children:"Flightcontrol's step-by-step Docusaurus guide"}),"."]}),"\n",(0,t.jsx)(n.h2,{id:"deploying-to-koyeb",children:"Deploying to Koyeb"}),"\n",(0,t.jsxs)(n.p,{children:[(0,t.jsx)(n.a,{href:"https://www.koyeb.com",children:"Koyeb"})," is a developer-friendly serverless platform to deploy apps globally. The platform lets you seamlessly run Docker containers, web apps, and APIs with git-based deployment, native autoscaling, a global edge network, and built-in service mesh and discovery. Check out the ",(0,t.jsx)(n.a,{href:"https://www.koyeb.com/tutorials/deploy-docusaurus-on-koyeb",children:"Koyeb's Docusaurus deployment guide"})," to get started."]}),"\n",(0,t.jsx)(n.h2,{id:"deploying-to-render",children:"Deploying to Render"}),"\n",(0,t.jsxs)(n.p,{children:[(0,t.jsx)(n.a,{href:"https://render.com",children:"Render"})," offers ",(0,t.jsx)(n.a,{href:"https://render.com/docs/static-sites",children:"free static site hosting"})," with fully managed SSL, custom domains, a global CDN, and continuous auto-deploy from your Git repo. Get started in just a few minutes by following ",(0,t.jsx)(n.a,{href:"https://render.com/docs/deploy-docusaurus",children:"Render's guide to deploying Docusaurus"}),"."]}),"\n",(0,t.jsx)(n.h2,{id:"deploying-to-qovery",children:"Deploying to Qovery"}),"\n",(0,t.jsxs)(n.p,{children:[(0,t.jsx)(n.a,{href:"https://www.qovery.com",children:"Qovery"})," is a fully-managed cloud platform that runs on your AWS, Digital Ocean, and Scaleway account where you can host static sites, backend APIs, databases, cron jobs, and all your other apps in one place."]}),"\n",(0,t.jsxs)(n.ol,{children:["\n",(0,t.jsxs)(n.li,{children:["Create a Qovery account. Visit the ",(0,t.jsx)(n.a,{href:"https://console.qovery.com",children:"Qovery dashboard"})," to create an account if you don't already have one."]}),"\n",(0,t.jsxs)(n.li,{children:["Create a project.","\n",(0,t.jsxs)(n.ul,{children:["\n",(0,t.jsxs)(n.li,{children:["Click on ",(0,t.jsx)(n.strong,{children:"Create project"})," and give a name to your project."]}),"\n",(0,t.jsxs)(n.li,{children:["Click on ",(0,t.jsx)(n.strong,{children:"Next"}),"."]}),"\n"]}),"\n"]}),"\n",(0,t.jsxs)(n.li,{children:["Create a new environment.","\n",(0,t.jsxs)(n.ul,{children:["\n",(0,t.jsxs)(n.li,{children:["Click on ",(0,t.jsx)(n.strong,{children:"Create environment"})," and give a name (e.g. staging, production)."]}),"\n"]}),"\n"]}),"\n",(0,t.jsxs)(n.li,{children:["Add an application.","\n",(0,t.jsxs)(n.ul,{children:["\n",(0,t.jsxs)(n.li,{children:["Click on ",(0,t.jsx)(n.strong,{children:"Create an application"}),", give a name and select your GitHub or GitLab repository where your Docusaurus app is located."]}),"\n",(0,t.jsx)(n.li,{children:"Define the main branch name and the root application path."}),"\n",(0,t.jsxs)(n.li,{children:["Click on ",(0,t.jsx)(n.strong,{children:"Create"}),". After the application is created:"]}),"\n",(0,t.jsxs)(n.li,{children:["Navigate to your application ",(0,t.jsx)(n.strong,{children:"Settings"})]}),"\n",(0,t.jsxs)(n.li,{children:["Select ",(0,t.jsx)(n.strong,{children:"Port"})]}),"\n",(0,t.jsx)(n.li,{children:"Add port used by your Docusaurus application"}),"\n"]}),"\n"]}),"\n",(0,t.jsxs)(n.li,{children:["Deploy","\n",(0,t.jsxs)(n.ul,{children:["\n",(0,t.jsxs)(n.li,{children:["All you have to do now is to navigate to your application and click on ",(0,t.jsx)(n.strong,{children:"Deploy"}),"."]}),"\n"]}),"\n"]}),"\n"]}),"\n",(0,t.jsx)(n.p,{children:(0,t.jsx)(n.img,{src:"https://hub.qovery.com/img/heroku/heroku-1.png",alt:"Deploy the app"})}),"\n",(0,t.jsxs)(n.p,{children:["That's it. Watch the status and wait till the app is deployed. To open the application in your browser, click on ",(0,t.jsx)(n.strong,{children:"Action"})," and ",(0,t.jsx)(n.strong,{children:"Open"})," in your application overview."]}),"\n",(0,t.jsx)(n.h2,{id:"deploying-to-hostman",children:"Deploying to Hostman"}),"\n",(0,t.jsxs)(n.p,{children:[(0,t.jsx)(n.a,{href:"https://hostman.com/",children:"Hostman"})," allows you to host static websites for free. Hostman automates everything, you just need to connect your repository and follow these easy steps:"]}),"\n",(0,t.jsxs)(n.ol,{children:["\n",(0,t.jsxs)(n.li,{children:["\n",(0,t.jsx)(n.p,{children:"Create a service."}),"\n",(0,t.jsxs)(n.ul,{children:["\n",(0,t.jsxs)(n.li,{children:["To deploy a Docusaurus static website, click ",(0,t.jsx)(n.strong,{children:"Create"})," in the top-left corner of your ",(0,t.jsx)(n.a,{href:"https://dashboard.hostman.com/",children:"Dashboard"})," and choose ",(0,t.jsx)(n.strong,{children:"Front-end app or static website"}),"."]}),"\n"]}),"\n"]}),"\n",(0,t.jsxs)(n.li,{children:["\n",(0,t.jsx)(n.p,{children:"Select the project to deploy."}),"\n",(0,t.jsxs)(n.ul,{children:["\n",(0,t.jsxs)(n.li,{children:["\n",(0,t.jsx)(n.p,{children:"If you are logged in to Hostman with your GitHub, GitLab, or Bitbucket account, you will see the repository with your projects, including the private ones."}),"\n"]}),"\n",(0,t.jsxs)(n.li,{children:["\n",(0,t.jsxs)(n.p,{children:["Choose the project you want to deploy. It must contain the directory with the project's files (e.g. ",(0,t.jsx)(n.code,{children:"website"}),")."]}),"\n"]}),"\n",(0,t.jsxs)(n.li,{children:["\n",(0,t.jsxs)(n.p,{children:["To access a different repository, click ",(0,t.jsx)(n.strong,{children:"Connect another repository"}),"."]}),"\n"]}),"\n",(0,t.jsxs)(n.li,{children:["\n",(0,t.jsx)(n.p,{children:"If you didn't use your Git account credentials to log in, you'll be able to access the necessary account now, and then select the project."}),"\n"]}),"\n"]}),"\n"]}),"\n",(0,t.jsxs)(n.li,{children:["\n",(0,t.jsx)(n.p,{children:"Configure the build settings."}),"\n",(0,t.jsxs)(n.ul,{children:["\n",(0,t.jsxs)(n.li,{children:["\n",(0,t.jsxs)(n.p,{children:["Next, the ",(0,t.jsx)(n.strong,{children:"Website customization"})," window will appear. Choose the ",(0,t.jsx)(n.strong,{children:"Static website"})," option from the list of frameworks."]}),"\n"]}),"\n",(0,t.jsxs)(n.li,{children:["\n",(0,t.jsxs)(n.p,{children:["The ",(0,t.jsx)(n.strong,{children:"Directory with app"})," points at the directory that will contain the project's files after the build. If you selected the repository with the contents of the website (or ",(0,t.jsx)(n.code,{children:"my_website"}),") directory during Step 2, you can leave it empty."]}),"\n"]}),"\n",(0,t.jsxs)(n.li,{children:["\n",(0,t.jsx)(n.p,{children:"The standard build command for Docusaurus is:"}),"\n",(0,t.jsxs)(r.Z,{groupId:"npm2yarn",children:[(0,t.jsx)(l.Z,{value:"npm",children:(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-bash",children:"npm run build\n"})})}),(0,t.jsx)(l.Z,{value:"yarn",label:"Yarn",children:(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-bash",children:"yarn build\n"})})}),(0,t.jsx)(l.Z,{value:"pnpm",label:"pnpm",children:(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-bash",children:"pnpm run build\n"})})}),(0,t.jsx)(l.Z,{value:"bun",label:"Bun",children:(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-bash",children:"bun run build\n"})})})]}),"\n"]}),"\n",(0,t.jsxs)(n.li,{children:["\n",(0,t.jsxs)(n.p,{children:["You can modify the build command if needed. You can enter multiple commands separated by ",(0,t.jsx)(n.code,{children:"&&"}),"."]}),"\n"]}),"\n"]}),"\n"]}),"\n",(0,t.jsxs)(n.li,{children:["\n",(0,t.jsx)(n.p,{children:"Deploy."}),"\n",(0,t.jsxs)(n.ul,{children:["\n",(0,t.jsxs)(n.li,{children:["\n",(0,t.jsxs)(n.p,{children:["Click ",(0,t.jsx)(n.strong,{children:"Deploy"})," to start the build process."]}),"\n"]}),"\n",(0,t.jsxs)(n.li,{children:["\n",(0,t.jsx)(n.p,{children:"Once it starts, you will enter the deployment log. If there are any issues with the code, you will get warning or error messages in the log specifying the cause of the problem. Usually, the log contains all the debugging data you'll need."}),"\n"]}),"\n",(0,t.jsxs)(n.li,{children:["\n",(0,t.jsx)(n.p,{children:"When the deployment is complete, you will receive an email notification and also see a log entry. All done! Your project is up and ready."}),"\n"]}),"\n"]}),"\n"]}),"\n"]}),"\n",(0,t.jsx)(n.h2,{id:"deploying-to-surge",children:"Deploying to Surge"}),"\n",(0,t.jsxs)(n.p,{children:["Surge is a ",(0,t.jsx)(n.a,{href:"https://surge.sh/help/getting-started-with-surge",children:"static web hosting platform"})," that you can use to deploy your Docusaurus project from the command line in seconds. Deploying your project to Surge is easy and free (including custom domains and SSL certs)."]}),"\n",(0,t.jsx)(n.p,{children:"Deploy your app in a matter of seconds using Surge with the following steps:"}),"\n",(0,t.jsxs)(n.ol,{children:["\n",(0,t.jsxs)(n.li,{children:["First, install Surge using npm by running the following command:","\n",(0,t.jsxs)(r.Z,{groupId:"npm2yarn",children:[(0,t.jsx)(l.Z,{value:"npm",children:(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-bash",children:"npm install -g surge\n"})})}),(0,t.jsx)(l.Z,{value:"yarn",label:"Yarn",children:(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-bash",children:"yarn global add surge\n"})})}),(0,t.jsx)(l.Z,{value:"pnpm",label:"pnpm",children:(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-bash",children:"pnpm add -g surge\n"})})}),(0,t.jsx)(l.Z,{value:"bun",label:"Bun",children:(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-bash",children:"bun add --global surge\n"})})})]}),"\n"]}),"\n",(0,t.jsxs)(n.li,{children:["To build the static files of your site for production in the root directory of your project, run:","\n",(0,t.jsxs)(r.Z,{groupId:"npm2yarn",children:[(0,t.jsx)(l.Z,{value:"npm",children:(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-bash",children:"npm run build\n"})})}),(0,t.jsx)(l.Z,{value:"yarn",label:"Yarn",children:(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-bash",children:"yarn build\n"})})}),(0,t.jsx)(l.Z,{value:"pnpm",label:"pnpm",children:(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-bash",children:"pnpm run build\n"})})}),(0,t.jsx)(l.Z,{value:"bun",label:"Bun",children:(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-bash",children:"bun run build\n"})})})]}),"\n"]}),"\n",(0,t.jsxs)(n.li,{children:["Then, run this command inside the root directory of your project:","\n",(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-bash",children:"surge build/\n"})}),"\n"]}),"\n"]}),"\n",(0,t.jsx)(n.p,{children:"First-time users of Surge would be prompted to create an account from the command line (which happens only once)."}),"\n",(0,t.jsxs)(n.p,{children:["Confirm that the site you want to publish is in the ",(0,t.jsx)(n.code,{children:"build"})," directory. A randomly generated subdomain ",(0,t.jsx)(n.code,{children:"*.surge.sh subdomain"})," is always given (which can be edited)."]}),"\n",(0,t.jsx)(n.h3,{id:"using-your-domain",children:"Using your domain"}),"\n",(0,t.jsx)(n.p,{children:"If you have a domain name you can deploy your site using the command:"}),"\n",(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-bash",children:"surge build/ your-domain.com\n"})}),"\n",(0,t.jsxs)(n.p,{children:["Your site is now deployed for free at ",(0,t.jsx)(n.code,{children:"subdomain.surge.sh"})," or ",(0,t.jsx)(n.code,{children:"your-domain.com"})," depending on the method you chose."]}),"\n",(0,t.jsx)(n.h3,{id:"setting-up-cname-file",children:"Setting up CNAME file"}),"\n",(0,t.jsx)(n.p,{children:"Store your domain in a CNAME file for future deployments with the following command:"}),"\n",(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-bash",children:"echo subdomain.surge.sh > CNAME\n"})}),"\n",(0,t.jsxs)(n.p,{children:["You can deploy any other changes in the future with the command ",(0,t.jsx)(n.code,{children:"surge"}),"."]}),"\n",(0,t.jsx)(n.h2,{id:"deploying-to-stormkit",children:"Deploying to Stormkit"}),"\n",(0,t.jsxs)(n.p,{children:["You can deploy your Docusaurus project to ",(0,t.jsx)(n.a,{href:"https://www.stormkit.io",children:"Stormkit"}),", a deployment platform for static websites, single-page applications (SPAs), and serverless functions. For detailed instructions, refer to this ",(0,t.jsx)(n.a,{href:"https://www.stormkit.io/blog/how-to-deploy-docusarous",children:"guide"}),"."]}),"\n",(0,t.jsx)(n.h2,{id:"deploying-to-quantcdn",children:"Deploying to QuantCDN"}),"\n",(0,t.jsxs)(n.ol,{children:["\n",(0,t.jsxs)(n.li,{children:["Install ",(0,t.jsx)(n.a,{href:"https://docs.quantcdn.io/docs/cli/get-started",children:"Quant CLI"})]}),"\n",(0,t.jsxs)(n.li,{children:["Create a QuantCDN account by ",(0,t.jsx)(n.a,{href:"https://dashboard.quantcdn.io/register",children:"signing up"})]}),"\n",(0,t.jsxs)(n.li,{children:["Initialize your project with ",(0,t.jsx)(n.code,{children:"quant init"})," and fill in your credentials:","\n",(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-bash",children:"quant init\n"})}),"\n"]}),"\n",(0,t.jsxs)(n.li,{children:["Deploy your site.","\n",(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-bash",children:"quant deploy\n"})}),"\n"]}),"\n"]}),"\n",(0,t.jsxs)(n.p,{children:["See ",(0,t.jsx)(n.a,{href:"https://docs.quantcdn.io/docs/cli/continuous-integration",children:"docs"})," and ",(0,t.jsx)(n.a,{href:"https://www.quantcdn.io/blog",children:"blog"})," for more examples and use cases for deploying to QuantCDN."]}),"\n",(0,t.jsx)(n.h2,{id:"deploying-to-layer0",children:"Deploying to Layer0"}),"\n",(0,t.jsxs)(n.p,{children:[(0,t.jsx)(n.a,{href:"https://www.layer0.co",children:"Layer0"})," is an all-in-one platform to develop, deploy, preview, experiment on, monitor, and run your headless frontend. It is focused on large, dynamic websites and best-in-class performance through EdgeJS (a JavaScript-based Content Delivery Network), predictive prefetching, and performance monitoring. Layer0 offers a free tier. Get started in just a few minutes by following ",(0,t.jsx)(n.a,{href:"https://docs.layer0.co/guides/docusaurus",children:"Layer0's guide to deploying Docusaurus"}),"."]}),"\n",(0,t.jsx)(n.h2,{id:"deploying-to-cloudflare-pages",children:"Deploying to Cloudflare Pages"}),"\n",(0,t.jsxs)(n.p,{children:[(0,t.jsx)(n.a,{href:"https://pages.cloudflare.com/",children:"Cloudflare Pages"})," is a Jamstack platform for frontend developers to collaborate and deploy websites. Get started within a few minutes by following ",(0,t.jsx)(n.a,{href:"https://developers.cloudflare.com/pages/framework-guides/deploy-a-docusaurus-site/",children:"this page"}),"."]}),"\n",(0,t.jsx)(n.h2,{id:"deploying-to-azure-static-web-apps",children:"Deploying to Azure Static Web Apps"}),"\n",(0,t.jsxs)(n.p,{children:[(0,t.jsx)(n.a,{href:"https://docs.microsoft.com/en-us/azure/static-web-apps/overview",children:"Azure Static Web Apps"})," is a service that automatically builds and deploys full-stack web apps to Azure directly from the code repository, simplifying the developer experience for CI/CD. Static Web Apps separates the web application's static assets from its dynamic (API) endpoints. Static assets are served from globally-distributed content servers, making it faster for clients to retrieve files using servers nearby. Dynamic APIs are scaled with serverless architectures using an event-driven functions-based approach that is more cost-effective and scales on demand. Get started in a few minutes by following ",(0,t.jsx)(n.a,{href:"https://dev.to/azure/11-share-content-with-docusaurus-azure-static-web-apps-30hc",children:"this step-by-step guide"}),"."]}),"\n",(0,t.jsx)(n.h2,{id:"deploying-to-kinsta",children:"Deploying to Kinsta"}),"\n",(0,t.jsxs)(n.p,{children:[(0,t.jsx)(n.a,{href:"https://kinsta.com/static-site-hosting",children:"Kinsta Static Site Hosting"})," lets you deploy up to 100 static sites for free, custom domains with SSL, 100 GB monthly bandwidth, and 260+ Cloudflare CDN locations."]}),"\n",(0,t.jsxs)(n.p,{children:["Get started in just a few clicks by following our ",(0,t.jsx)(n.a,{href:"https://kinsta.com/docs/docusaurus-example/",children:"Docusaurus on Kinsta"})," article."]})]})}function p(e={}){let{wrapper:n}={...(0,o.a)(),...e.components};return n?(0,t.jsx)(n,{...e,children:(0,t.jsx)(u,{...e})}):u(e)}},58636:function(e,n,s){s.d(n,{Z:()=>o});var i=s(85893);s(67294);var t=s(90496);function o(e){let{children:n,hidden:s,className:o}=e;return(0,i.jsx)("div",{role:"tabpanel",className:(0,t.Z)("tabItem_pnkT",o),hidden:s,children:n})}},15398:function(e,n,s){s.d(n,{Z:()=>x});var i=s(85893),t=s(67294),o=s(90496),r=s(54947),l=s(3620),a=s(844),c=s(97486),d=s(32263),h=s(16971);function u(e){return t.Children.toArray(e).filter(e=>"\n"!==e).map(e=>{if(!e||(0,t.isValidElement)(e)&&function(e){let{props:n}=e;return!!n&&"object"==typeof n&&"value"in n}(e))return e;throw Error(`Docusaurus error: Bad child <${"string"==typeof e.type?e.type:e.type.name}>: all children of the component should be , and every should have a unique "value" prop.`)})?.filter(Boolean)??[]}function p(e){let{value:n,tabValues:s}=e;return s.some(e=>e.value===n)}var g=s(71607);function y(e){let{className:n,block:s,selectedValue:t,selectValue:l,tabValues:a}=e,c=[],{blockElementScrollPositionUntilNextRender:d}=(0,r.o5)(),h=e=>{let n=e.currentTarget,s=a[c.indexOf(n)].value;s!==t&&(d(n),l(s))},u=e=>{let n=null;switch(e.key){case"Enter":h(e);break;case"ArrowRight":{let s=c.indexOf(e.currentTarget)+1;n=c[s]??c[0];break}case"ArrowLeft":{let s=c.indexOf(e.currentTarget)-1;n=c[s]??c[c.length-1]}}n?.focus()};return(0,i.jsx)("ul",{role:"tablist","aria-orientation":"horizontal",className:(0,o.Z)("tabs",{"tabs--block":s},n),children:a.map(e=>{let{value:n,label:s,attributes:r}=e;return(0,i.jsx)("li",{role:"tab",tabIndex:t===n?0:-1,"aria-selected":t===n,ref:e=>{c.push(e)},onKeyDown:u,onClick:h,...r,className:(0,o.Z)("tabs__item","tabItem_AQgk",r?.className,{"tabs__item--active":t===n}),children:s??n},n)})})}function m(e){let{lazy:n,children:s,selectedValue:r}=e,l=(Array.isArray(s)?s:[s]).filter(Boolean);if(n){let e=l.find(e=>e.props.value===r);return e?(0,t.cloneElement)(e,{className:(0,o.Z)("margin-top--md",e.props.className)}):null}return(0,i.jsx)("div",{className:"margin-top--md",children:l.map((e,n)=>(0,t.cloneElement)(e,{key:n,hidden:e.props.value!==r}))})}function j(e){let n=function(e){let{defaultValue:n,queryString:s=!1,groupId:i}=e,o=function(e){let{values:n,children:s}=e;return(0,t.useMemo)(()=>{let e=n??u(s).map(e=>{let{props:{value:n,label:s,attributes:i,default:t}}=e;return{value:n,label:s,attributes:i,default:t}}),i=(0,d.lx)(e,(e,n)=>e.value===n.value);if(i.length>0)throw Error(`Docusaurus error: Duplicate values "${i.map(e=>e.value).join(", ")}" found in . Every value needs to be unique.`);return e},[n,s])}(e),[r,g]=(0,t.useState)(()=>(function(e){let{defaultValue:n,tabValues:s}=e;if(0===s.length)throw Error("Docusaurus error: the component requires at least one children component");if(n){if(!p({value:n,tabValues:s}))throw Error(`Docusaurus error: The has a defaultValue "${n}" but none of its children has the corresponding value. Available values are: ${s.map(e=>e.value).join(", ")}. If you intend to show no default tab, use defaultValue={null} instead.`);return n}let i=s.find(e=>e.default)??s[0];if(!i)throw Error("Unexpected error: 0 tabValues");return i.value})({defaultValue:n,tabValues:o})),[y,m]=function(e){let{queryString:n=!1,groupId:s}=e,i=(0,l.k6)(),o=function(e){let{queryString:n=!1,groupId:s}=e;if("string"==typeof n)return n;if(!1===n)return null;if(!0===n&&!s)throw Error('Docusaurus error: The component groupId prop is required if queryString=true, because this value is used as the search param name. You can also provide an explicit value such as queryString="my-search-param".');return s??null}({queryString:n,groupId:s});return[(0,c._X)(o),(0,t.useCallback)(e=>{if(!o)return;let n=new URLSearchParams(i.location.search);n.set(o,e),i.replace({...i.location,search:n.toString()})},[o,i])]}({queryString:s,groupId:i}),[j,x]=function(e){let{groupId:n}=e,s=n?`docusaurus.tab.${n}`:null,[i,o]=(0,h.Nk)(s);return[i,(0,t.useCallback)(e=>{s&&o.set(e)},[s,o])]}({groupId:i}),f=(()=>{let e=y??j;return p({value:e,tabValues:o})?e:null})();return(0,a.Z)(()=>{f&&g(f)},[f]),{selectedValue:r,selectValue:(0,t.useCallback)(e=>{if(!p({value:e,tabValues:o}))throw Error(`Can't select invalid tab value=${e}`);g(e),m(e),x(e)},[m,x,o]),tabValues:o}}(e);return(0,i.jsxs)("div",{className:(0,o.Z)("tabs-container","tabList_Qoir"),children:[(0,i.jsx)(y,{...n,...e}),(0,i.jsx)(m,{...n,...e})]})}function x(e){let n=(0,g.Z)();return(0,i.jsx)(j,{...e,children:u(e.children)},String(n))}},80980:function(e,n,s){s.d(n,{Z:()=>l,a:()=>r});var i=s(67294);let t={},o=i.createContext(t);function r(e){let n=i.useContext(o);return i.useMemo(function(){return"function"==typeof e?e(n):{...n,...e}},[n,e])}function l(e){let n;return n=e.disableParentContext?"function"==typeof e.components?e.components(t):e.components||t:r(e.components),i.createElement(o.Provider,{value:n},e.children)}}}]); \ No newline at end of file diff --git a/assets/js/072728dc.14b969c2.js b/assets/js/072728dc.14b969c2.js deleted file mode 100644 index 0afadf7d9c..0000000000 --- a/assets/js/072728dc.14b969c2.js +++ /dev/null @@ -1 +0,0 @@ -"use strict";(self.webpackChunkwebsite=self.webpackChunkwebsite||[]).push([["99417"],{48497:function(e,s,t){t.r(s),t.d(s,{frontMatter:()=>l,default:()=>x,contentTitle:()=>d,assets:()=>u,toc:()=>r,metadata:()=>n});var n=JSON.parse('{"id":"toc/toc-3-_","title":"toc-3-_","description":"","source":"@site/_dogfooding/_docs tests/toc/toc-3-_.mdx","sourceDirName":"toc","slug":"/toc/toc-3-_","permalink":"/tests/docs/toc/toc-3-_","draft":false,"unlisted":false,"tags":[],"version":"current","lastUpdatedBy":"Ben McCann","lastUpdatedAt":1744155424000,"frontMatter":{"toc_min_heading_level":3},"sidebar":"sidebar","previous":{"title":"toc-3-5","permalink":"/tests/docs/toc/toc-3-5"},"next":{"title":"toc-4-5","permalink":"/tests/docs/toc/toc-4-5"}}'),i=t(85893),c=t(80980),o=t(2630);let l={toc_min_heading_level:3},d=void 0,u={},r=[...o.d$];function h(e){return(0,i.jsx)(o.ZP,{})}function x(e={}){let{wrapper:s}={...(0,c.a)(),...e.components};return s?(0,i.jsx)(s,{...e,children:(0,i.jsx)(h,{...e})}):h(e)}x.displayName="MDXContent(_dogfooding/_docs tests/toc/toc-3-_.mdx)"},2630:function(e,s,t){t.d(s,{ZP:()=>l,d$:()=>c});var n=t(85893),i=t(80980);let c=[{value:"section 1",id:"section-1",level:2},{value:"subsection 1-1",id:"subsection-1-1",level:3},{value:"subsection 1-1-1",id:"subsection-1-1-1",level:4},{value:"subsection 1-1-1-1",id:"subsection-1-1-1-1",level:5},{value:"subsection 1-1-1-1-1",id:"subsection-1-1-1-1-1",level:6},{value:"subsection 1-1-1-1-2",id:"subsection-1-1-1-1-2",level:6},{value:"subsection 1-1-1-2",id:"subsection-1-1-1-2",level:5},{value:"subsection 1-1-2",id:"subsection-1-1-2",level:4},{value:"subsection 1-2",id:"subsection-1-2",level:3},{value:"subsection 1-3",id:"subsection-1-3",level:3},{value:"section 2",id:"section-2",level:2},{value:"subsection 2-1",id:"subsection-2-1",level:3},{value:"subsection 2-1",id:"subsection-2-1-1",level:3},{value:"section 3",id:"section-3",level:2},{value:"subsection 3-1",id:"subsection-3-1",level:3},{value:"subsection 3-2",id:"subsection-3-2",level:3}];function o(e){let s={h1:"h1",h2:"h2",h3:"h3",h4:"h4",h5:"h5",h6:"h6",header:"header",p:"p",...(0,i.a)(),...e.components};return(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(s.header,{children:(0,n.jsx)(s.h1,{id:"title",children:"title"})}),"\n",(0,n.jsx)(s.p,{children:"some text"}),"\n",(0,n.jsx)(s.h2,{id:"section-1",children:"section 1"}),"\n",(0,n.jsx)(s.p,{children:"some text"}),"\n",(0,n.jsx)(s.h3,{id:"subsection-1-1",children:"subsection 1-1"}),"\n",(0,n.jsx)(s.p,{children:"some text"}),"\n",(0,n.jsx)(s.h4,{id:"subsection-1-1-1",children:"subsection 1-1-1"}),"\n",(0,n.jsx)(s.p,{children:"some text"}),"\n",(0,n.jsx)(s.h5,{id:"subsection-1-1-1-1",children:"subsection 1-1-1-1"}),"\n",(0,n.jsx)(s.p,{children:"some text"}),"\n",(0,n.jsx)(s.h6,{id:"subsection-1-1-1-1-1",children:"subsection 1-1-1-1-1"}),"\n",(0,n.jsx)(s.p,{children:"some text"}),"\n",(0,n.jsx)(s.h6,{id:"subsection-1-1-1-1-2",children:"subsection 1-1-1-1-2"}),"\n",(0,n.jsx)(s.p,{children:"some text"}),"\n",(0,n.jsx)(s.h5,{id:"subsection-1-1-1-2",children:"subsection 1-1-1-2"}),"\n",(0,n.jsx)(s.p,{children:"some text"}),"\n",(0,n.jsx)(s.h4,{id:"subsection-1-1-2",children:"subsection 1-1-2"}),"\n",(0,n.jsx)(s.p,{children:"some text"}),"\n",(0,n.jsx)(s.h3,{id:"subsection-1-2",children:"subsection 1-2"}),"\n",(0,n.jsx)(s.p,{children:"some text"}),"\n",(0,n.jsx)(s.h3,{id:"subsection-1-3",children:"subsection 1-3"}),"\n",(0,n.jsx)(s.p,{children:"some text"}),"\n",(0,n.jsx)(s.h2,{id:"section-2",children:"section 2"}),"\n",(0,n.jsx)(s.p,{children:"some text"}),"\n",(0,n.jsx)(s.h3,{id:"subsection-2-1",children:"subsection 2-1"}),"\n",(0,n.jsx)(s.p,{children:"some text"}),"\n",(0,n.jsx)(s.h3,{id:"subsection-2-1-1",children:"subsection 2-1"}),"\n",(0,n.jsx)(s.p,{children:"some text"}),"\n",(0,n.jsx)(s.h2,{id:"section-3",children:"section 3"}),"\n",(0,n.jsx)(s.p,{children:"some text"}),"\n",(0,n.jsx)(s.h3,{id:"subsection-3-1",children:"subsection 3-1"}),"\n",(0,n.jsx)(s.p,{children:"some text"}),"\n",(0,n.jsx)(s.h3,{id:"subsection-3-2",children:"subsection 3-2"}),"\n",(0,n.jsx)(s.p,{children:"some text"})]})}function l(e={}){let{wrapper:s}={...(0,i.a)(),...e.components};return s?(0,n.jsx)(s,{...e,children:(0,n.jsx)(o,{...e})}):o(e)}},80980:function(e,s,t){t.d(s,{Z:()=>l,a:()=>o});var n=t(67294);let i={},c=n.createContext(i);function o(e){let s=n.useContext(c);return n.useMemo(function(){return"function"==typeof e?e(s):{...s,...e}},[s,e])}function l(e){let s;return s=e.disableParentContext?"function"==typeof e.components?e.components(i):e.components||i:o(e.components),n.createElement(c.Provider,{value:s},e.children)}}}]); \ No newline at end of file diff --git a/assets/js/072728dc.4f025acf.js b/assets/js/072728dc.4f025acf.js new file mode 100644 index 0000000000..8faefe0f1b --- /dev/null +++ b/assets/js/072728dc.4f025acf.js @@ -0,0 +1 @@ +"use strict";(self.webpackChunkwebsite=self.webpackChunkwebsite||[]).push([["99417"],{48497:function(e,s,t){t.r(s),t.d(s,{frontMatter:()=>l,default:()=>x,contentTitle:()=>d,assets:()=>u,toc:()=>r,metadata:()=>n});var n=JSON.parse('{"id":"toc/toc-3-_","title":"toc-3-_","description":"","source":"@site/_dogfooding/_docs tests/toc/toc-3-_.mdx","sourceDirName":"toc","slug":"/toc/toc-3-_","permalink":"/tests/docs/toc/toc-3-_","draft":false,"unlisted":false,"tags":[],"version":"current","lastUpdatedBy":"S\xe9bastien Lorber","lastUpdatedAt":1744293302000,"frontMatter":{"toc_min_heading_level":3},"sidebar":"sidebar","previous":{"title":"toc-3-5","permalink":"/tests/docs/toc/toc-3-5"},"next":{"title":"toc-4-5","permalink":"/tests/docs/toc/toc-4-5"}}'),i=t(85893),c=t(80980),o=t(2630);let l={toc_min_heading_level:3},d=void 0,u={},r=[...o.d$];function h(e){return(0,i.jsx)(o.ZP,{})}function x(e={}){let{wrapper:s}={...(0,c.a)(),...e.components};return s?(0,i.jsx)(s,{...e,children:(0,i.jsx)(h,{...e})}):h(e)}x.displayName="MDXContent(_dogfooding/_docs tests/toc/toc-3-_.mdx)"},2630:function(e,s,t){t.d(s,{ZP:()=>l,d$:()=>c});var n=t(85893),i=t(80980);let c=[{value:"section 1",id:"section-1",level:2},{value:"subsection 1-1",id:"subsection-1-1",level:3},{value:"subsection 1-1-1",id:"subsection-1-1-1",level:4},{value:"subsection 1-1-1-1",id:"subsection-1-1-1-1",level:5},{value:"subsection 1-1-1-1-1",id:"subsection-1-1-1-1-1",level:6},{value:"subsection 1-1-1-1-2",id:"subsection-1-1-1-1-2",level:6},{value:"subsection 1-1-1-2",id:"subsection-1-1-1-2",level:5},{value:"subsection 1-1-2",id:"subsection-1-1-2",level:4},{value:"subsection 1-2",id:"subsection-1-2",level:3},{value:"subsection 1-3",id:"subsection-1-3",level:3},{value:"section 2",id:"section-2",level:2},{value:"subsection 2-1",id:"subsection-2-1",level:3},{value:"subsection 2-1",id:"subsection-2-1-1",level:3},{value:"section 3",id:"section-3",level:2},{value:"subsection 3-1",id:"subsection-3-1",level:3},{value:"subsection 3-2",id:"subsection-3-2",level:3}];function o(e){let s={h1:"h1",h2:"h2",h3:"h3",h4:"h4",h5:"h5",h6:"h6",header:"header",p:"p",...(0,i.a)(),...e.components};return(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(s.header,{children:(0,n.jsx)(s.h1,{id:"title",children:"title"})}),"\n",(0,n.jsx)(s.p,{children:"some text"}),"\n",(0,n.jsx)(s.h2,{id:"section-1",children:"section 1"}),"\n",(0,n.jsx)(s.p,{children:"some text"}),"\n",(0,n.jsx)(s.h3,{id:"subsection-1-1",children:"subsection 1-1"}),"\n",(0,n.jsx)(s.p,{children:"some text"}),"\n",(0,n.jsx)(s.h4,{id:"subsection-1-1-1",children:"subsection 1-1-1"}),"\n",(0,n.jsx)(s.p,{children:"some text"}),"\n",(0,n.jsx)(s.h5,{id:"subsection-1-1-1-1",children:"subsection 1-1-1-1"}),"\n",(0,n.jsx)(s.p,{children:"some text"}),"\n",(0,n.jsx)(s.h6,{id:"subsection-1-1-1-1-1",children:"subsection 1-1-1-1-1"}),"\n",(0,n.jsx)(s.p,{children:"some text"}),"\n",(0,n.jsx)(s.h6,{id:"subsection-1-1-1-1-2",children:"subsection 1-1-1-1-2"}),"\n",(0,n.jsx)(s.p,{children:"some text"}),"\n",(0,n.jsx)(s.h5,{id:"subsection-1-1-1-2",children:"subsection 1-1-1-2"}),"\n",(0,n.jsx)(s.p,{children:"some text"}),"\n",(0,n.jsx)(s.h4,{id:"subsection-1-1-2",children:"subsection 1-1-2"}),"\n",(0,n.jsx)(s.p,{children:"some text"}),"\n",(0,n.jsx)(s.h3,{id:"subsection-1-2",children:"subsection 1-2"}),"\n",(0,n.jsx)(s.p,{children:"some text"}),"\n",(0,n.jsx)(s.h3,{id:"subsection-1-3",children:"subsection 1-3"}),"\n",(0,n.jsx)(s.p,{children:"some text"}),"\n",(0,n.jsx)(s.h2,{id:"section-2",children:"section 2"}),"\n",(0,n.jsx)(s.p,{children:"some text"}),"\n",(0,n.jsx)(s.h3,{id:"subsection-2-1",children:"subsection 2-1"}),"\n",(0,n.jsx)(s.p,{children:"some text"}),"\n",(0,n.jsx)(s.h3,{id:"subsection-2-1-1",children:"subsection 2-1"}),"\n",(0,n.jsx)(s.p,{children:"some text"}),"\n",(0,n.jsx)(s.h2,{id:"section-3",children:"section 3"}),"\n",(0,n.jsx)(s.p,{children:"some text"}),"\n",(0,n.jsx)(s.h3,{id:"subsection-3-1",children:"subsection 3-1"}),"\n",(0,n.jsx)(s.p,{children:"some text"}),"\n",(0,n.jsx)(s.h3,{id:"subsection-3-2",children:"subsection 3-2"}),"\n",(0,n.jsx)(s.p,{children:"some text"})]})}function l(e={}){let{wrapper:s}={...(0,i.a)(),...e.components};return s?(0,n.jsx)(s,{...e,children:(0,n.jsx)(o,{...e})}):o(e)}},80980:function(e,s,t){t.d(s,{Z:()=>l,a:()=>o});var n=t(67294);let i={},c=n.createContext(i);function o(e){let s=n.useContext(c);return n.useMemo(function(){return"function"==typeof e?e(s):{...s,...e}},[s,e])}function l(e){let s;return s=e.disableParentContext?"function"==typeof e.components?e.components(i):e.components||i:o(e.components),n.createElement(c.Provider,{value:s},e.children)}}}]); \ No newline at end of file diff --git a/assets/js/07d8cde9.03ae3e87.js b/assets/js/07d8cde9.03ae3e87.js deleted file mode 100644 index 0a11f28ca5..0000000000 --- a/assets/js/07d8cde9.03ae3e87.js +++ /dev/null @@ -1 +0,0 @@ -"use strict";(self.webpackChunkwebsite=self.webpackChunkwebsite||[]).push([["80812"],{78929:function(e,s,i){i.r(s),i.d(s,{frontMatter:()=>a,default:()=>u,contentTitle:()=>l,assets:()=>r,toc:()=>o,metadata:()=>n});var n=JSON.parse('{"id":"api/misc/create-docusaurus","title":"\uD83D\uDCE6 create-docusaurus","description":"A scaffolding utility to help you instantly set up a functional Docusaurus app.","source":"@site/docs/api/misc/create-docusaurus.mdx","sourceDirName":"api/misc","slug":"/api/misc/create-docusaurus","permalink":"/docs/api/misc/create-docusaurus","draft":false,"unlisted":false,"editUrl":"https://github.com/facebook/docusaurus/edit/main/website/docs/api/misc/create-docusaurus.mdx","tags":[],"version":"current","lastUpdatedBy":"Ben McCann","lastUpdatedAt":1744155424000,"sidebarPosition":0,"frontMatter":{"sidebar_position":0,"slug":"/api/misc/create-docusaurus"},"sidebar":"api","previous":{"title":"\uD83D\uDCE6 theme-mermaid","permalink":"/docs/api/themes/@docusaurus/theme-mermaid"},"next":{"title":"\uD83D\uDCE6 eslint-plugin","permalink":"/docs/api/misc/@docusaurus/eslint-plugin"}}'),t=i(85893),c=i(80980);let a={sidebar_position:0,slug:"/api/misc/create-docusaurus"},l="\uD83D\uDCE6 create-docusaurus",r={},o=[{value:"Usage",id:"usage",level:2},{value:"Options",id:"options",level:2},{value:" -t, --typescript
",id:"typescript",level:3},{value:"-g, --git-strategy
",id:"git-strategy",level:3},{value:"-p, --package-manager
",id:"package-manager",level:3},{value:"-s, --skip-install
",id:"skip-install",level:3}];function d(e){let s={admonition:"admonition",code:"code",h1:"h1",h2:"h2",h3:"h3",header:"header",li:"li",p:"p",pre:"pre",ul:"ul",...(0,c.a)(),...e.components};return(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(s.header,{children:(0,t.jsx)(s.h1,{id:"-create-docusaurus",children:"\uD83D\uDCE6 create-docusaurus"})}),"\n",(0,t.jsx)(s.p,{children:"A scaffolding utility to help you instantly set up a functional Docusaurus app."}),"\n",(0,t.jsx)(s.h2,{id:"usage",children:"Usage"}),"\n",(0,t.jsx)(s.pre,{children:(0,t.jsx)(s.code,{className:"language-bash",children:"npx create-docusaurus@latest [name] [template] [rootDir]\n"})}),"\n",(0,t.jsxs)(s.p,{children:["The ",(0,t.jsx)(s.code,{children:"name"})," argument will be used as the site's path as well as the ",(0,t.jsx)(s.code,{children:"name"})," field in the created app's package.json. It can be an absolute path, or a path relative to ",(0,t.jsx)(s.code,{children:"rootDir"}),"."]}),"\n",(0,t.jsxs)(s.p,{children:["The ",(0,t.jsx)(s.code,{children:"template"})," argument can be one of the following:"]}),"\n",(0,t.jsxs)(s.ul,{children:["\n",(0,t.jsxs)(s.li,{children:[(0,t.jsx)(s.code,{children:"classic"}),": Uses the classic template (recommended)"]}),"\n",(0,t.jsxs)(s.li,{children:[(0,t.jsx)(s.code,{children:"facebook"}),": Uses the Facebook/Meta template, which contains some Meta-specific setup"]}),"\n",(0,t.jsxs)(s.li,{children:["A git repo URL (beginning with ",(0,t.jsx)(s.code,{children:"https://"})," or ",(0,t.jsx)(s.code,{children:"git@"}),"), which can be cloned to the destination"]}),"\n",(0,t.jsx)(s.li,{children:"A local file path relative to CWD, which contains the files to be copied to destination"}),"\n"]}),"\n",(0,t.jsxs)(s.p,{children:["The ",(0,t.jsx)(s.code,{children:"rootDir"})," will be used to resolve the absolute path to the site directory. The default is CWD."]}),"\n",(0,t.jsx)(s.admonition,{type:"warning",children:(0,t.jsx)(s.p,{children:"This command should be preferably used in an interactive shell so all features are available."})}),"\n",(0,t.jsx)(s.h2,{id:"options",children:"Options"}),"\n",(0,t.jsx)(s.h3,{id:"typescript",children:(0,t.jsx)(s.code,{children:"-t, --typescript"})}),"\n",(0,t.jsxs)(s.p,{children:["Used when the template argument is a recognized name. Currently, only ",(0,t.jsx)(s.code,{children:"classic"})," provides a TypeScript variant."]}),"\n",(0,t.jsx)(s.h3,{id:"git-strategy",children:(0,t.jsx)(s.code,{children:"-g, --git-strategy"})}),"\n",(0,t.jsx)(s.p,{children:"Used when the template argument is a git repo. It needs to be one of:"}),"\n",(0,t.jsxs)(s.ul,{children:["\n",(0,t.jsxs)(s.li,{children:[(0,t.jsx)(s.code,{children:"deep"}),": preserves full git history"]}),"\n",(0,t.jsxs)(s.li,{children:[(0,t.jsx)(s.code,{children:"shallow"}),": clones with ",(0,t.jsx)(s.code,{children:"--depth=1"})]}),"\n",(0,t.jsxs)(s.li,{children:[(0,t.jsx)(s.code,{children:"copy"}),": does a shallow clone, but does not create a git repo"]}),"\n",(0,t.jsxs)(s.li,{children:[(0,t.jsx)(s.code,{children:"custom"}),": enter your custom git clone command. We will prompt you for it. You can write something like ",(0,t.jsx)(s.code,{children:"git clone --depth 10"}),", and we will append the repository URL and destination directory."]}),"\n"]}),"\n",(0,t.jsx)(s.h3,{id:"package-manager",children:(0,t.jsx)(s.code,{children:"-p, --package-manager"})}),"\n",(0,t.jsxs)(s.p,{children:["Value should be one of ",(0,t.jsx)(s.code,{children:"npm"}),", ",(0,t.jsx)(s.code,{children:"yarn"}),", ",(0,t.jsx)(s.code,{children:"pnpm"}),", or ",(0,t.jsx)(s.code,{children:"bun"}),". If it's not explicitly provided, Docusaurus will infer one based on:"]}),"\n",(0,t.jsxs)(s.ul,{children:["\n",(0,t.jsx)(s.li,{children:"The lockfile already present in the CWD (e.g. if you are setting up website in an existing project)"}),"\n",(0,t.jsxs)(s.li,{children:["The command used to invoke ",(0,t.jsx)(s.code,{children:"create-docusaurus"})," (e.g. ",(0,t.jsx)(s.code,{children:"npm init"}),", ",(0,t.jsx)(s.code,{children:"npx"}),", ",(0,t.jsx)(s.code,{children:"yarn create"}),", ",(0,t.jsx)(s.code,{children:"bunx"}),", etc.)"]}),"\n",(0,t.jsx)(s.li,{children:"Interactive prompting, in case all heuristics are not present"}),"\n"]}),"\n",(0,t.jsx)(s.h3,{id:"skip-install",children:(0,t.jsx)(s.code,{children:"-s, --skip-install"})}),"\n",(0,t.jsxs)(s.p,{children:["If provided, Docusaurus will not automatically install dependencies after creating the app. The ",(0,t.jsx)(s.code,{children:"--package-manager"})," option is only useful when you are actually installing dependencies."]})]})}function u(e={}){let{wrapper:s}={...(0,c.a)(),...e.components};return s?(0,t.jsx)(s,{...e,children:(0,t.jsx)(d,{...e})}):d(e)}},80980:function(e,s,i){i.d(s,{Z:()=>l,a:()=>a});var n=i(67294);let t={},c=n.createContext(t);function a(e){let s=n.useContext(c);return n.useMemo(function(){return"function"==typeof e?e(s):{...s,...e}},[s,e])}function l(e){let s;return s=e.disableParentContext?"function"==typeof e.components?e.components(t):e.components||t:a(e.components),n.createElement(c.Provider,{value:s},e.children)}}}]); \ No newline at end of file diff --git a/assets/js/07d8cde9.1b277895.js b/assets/js/07d8cde9.1b277895.js new file mode 100644 index 0000000000..b85231ec9e --- /dev/null +++ b/assets/js/07d8cde9.1b277895.js @@ -0,0 +1 @@ +"use strict";(self.webpackChunkwebsite=self.webpackChunkwebsite||[]).push([["80812"],{78929:function(e,s,i){i.r(s),i.d(s,{frontMatter:()=>a,default:()=>u,contentTitle:()=>l,assets:()=>r,toc:()=>o,metadata:()=>n});var n=JSON.parse('{"id":"api/misc/create-docusaurus","title":"\uD83D\uDCE6 create-docusaurus","description":"A scaffolding utility to help you instantly set up a functional Docusaurus app.","source":"@site/docs/api/misc/create-docusaurus.mdx","sourceDirName":"api/misc","slug":"/api/misc/create-docusaurus","permalink":"/docs/api/misc/create-docusaurus","draft":false,"unlisted":false,"editUrl":"https://github.com/facebook/docusaurus/edit/main/website/docs/api/misc/create-docusaurus.mdx","tags":[],"version":"current","lastUpdatedBy":"S\xe9bastien Lorber","lastUpdatedAt":1744293302000,"sidebarPosition":0,"frontMatter":{"sidebar_position":0,"slug":"/api/misc/create-docusaurus"},"sidebar":"api","previous":{"title":"\uD83D\uDCE6 theme-mermaid","permalink":"/docs/api/themes/@docusaurus/theme-mermaid"},"next":{"title":"\uD83D\uDCE6 eslint-plugin","permalink":"/docs/api/misc/@docusaurus/eslint-plugin"}}'),t=i(85893),c=i(80980);let a={sidebar_position:0,slug:"/api/misc/create-docusaurus"},l="\uD83D\uDCE6 create-docusaurus",r={},o=[{value:"Usage",id:"usage",level:2},{value:"Options",id:"options",level:2},{value:"-t, --typescript
",id:"typescript",level:3},{value:"-g, --git-strategy
",id:"git-strategy",level:3},{value:"-p, --package-manager
",id:"package-manager",level:3},{value:"-s, --skip-install
",id:"skip-install",level:3}];function d(e){let s={admonition:"admonition",code:"code",h1:"h1",h2:"h2",h3:"h3",header:"header",li:"li",p:"p",pre:"pre",ul:"ul",...(0,c.a)(),...e.components};return(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(s.header,{children:(0,t.jsx)(s.h1,{id:"-create-docusaurus",children:"\uD83D\uDCE6 create-docusaurus"})}),"\n",(0,t.jsx)(s.p,{children:"A scaffolding utility to help you instantly set up a functional Docusaurus app."}),"\n",(0,t.jsx)(s.h2,{id:"usage",children:"Usage"}),"\n",(0,t.jsx)(s.pre,{children:(0,t.jsx)(s.code,{className:"language-bash",children:"npx create-docusaurus@latest [name] [template] [rootDir]\n"})}),"\n",(0,t.jsxs)(s.p,{children:["The ",(0,t.jsx)(s.code,{children:"name"})," argument will be used as the site's path as well as the ",(0,t.jsx)(s.code,{children:"name"})," field in the created app's package.json. It can be an absolute path, or a path relative to ",(0,t.jsx)(s.code,{children:"rootDir"}),"."]}),"\n",(0,t.jsxs)(s.p,{children:["The ",(0,t.jsx)(s.code,{children:"template"})," argument can be one of the following:"]}),"\n",(0,t.jsxs)(s.ul,{children:["\n",(0,t.jsxs)(s.li,{children:[(0,t.jsx)(s.code,{children:"classic"}),": Uses the classic template (recommended)"]}),"\n",(0,t.jsxs)(s.li,{children:[(0,t.jsx)(s.code,{children:"facebook"}),": Uses the Facebook/Meta template, which contains some Meta-specific setup"]}),"\n",(0,t.jsxs)(s.li,{children:["A git repo URL (beginning with ",(0,t.jsx)(s.code,{children:"https://"})," or ",(0,t.jsx)(s.code,{children:"git@"}),"), which can be cloned to the destination"]}),"\n",(0,t.jsx)(s.li,{children:"A local file path relative to CWD, which contains the files to be copied to destination"}),"\n"]}),"\n",(0,t.jsxs)(s.p,{children:["The ",(0,t.jsx)(s.code,{children:"rootDir"})," will be used to resolve the absolute path to the site directory. The default is CWD."]}),"\n",(0,t.jsx)(s.admonition,{type:"warning",children:(0,t.jsx)(s.p,{children:"This command should be preferably used in an interactive shell so all features are available."})}),"\n",(0,t.jsx)(s.h2,{id:"options",children:"Options"}),"\n",(0,t.jsx)(s.h3,{id:"typescript",children:(0,t.jsx)(s.code,{children:"-t, --typescript"})}),"\n",(0,t.jsxs)(s.p,{children:["Used when the template argument is a recognized name. Currently, only ",(0,t.jsx)(s.code,{children:"classic"})," provides a TypeScript variant."]}),"\n",(0,t.jsx)(s.h3,{id:"git-strategy",children:(0,t.jsx)(s.code,{children:"-g, --git-strategy"})}),"\n",(0,t.jsx)(s.p,{children:"Used when the template argument is a git repo. It needs to be one of:"}),"\n",(0,t.jsxs)(s.ul,{children:["\n",(0,t.jsxs)(s.li,{children:[(0,t.jsx)(s.code,{children:"deep"}),": preserves full git history"]}),"\n",(0,t.jsxs)(s.li,{children:[(0,t.jsx)(s.code,{children:"shallow"}),": clones with ",(0,t.jsx)(s.code,{children:"--depth=1"})]}),"\n",(0,t.jsxs)(s.li,{children:[(0,t.jsx)(s.code,{children:"copy"}),": does a shallow clone, but does not create a git repo"]}),"\n",(0,t.jsxs)(s.li,{children:[(0,t.jsx)(s.code,{children:"custom"}),": enter your custom git clone command. We will prompt you for it. You can write something like ",(0,t.jsx)(s.code,{children:"git clone --depth 10"}),", and we will append the repository URL and destination directory."]}),"\n"]}),"\n",(0,t.jsx)(s.h3,{id:"package-manager",children:(0,t.jsx)(s.code,{children:"-p, --package-manager"})}),"\n",(0,t.jsxs)(s.p,{children:["Value should be one of ",(0,t.jsx)(s.code,{children:"npm"}),", ",(0,t.jsx)(s.code,{children:"yarn"}),", ",(0,t.jsx)(s.code,{children:"pnpm"}),", or ",(0,t.jsx)(s.code,{children:"bun"}),". If it's not explicitly provided, Docusaurus will infer one based on:"]}),"\n",(0,t.jsxs)(s.ul,{children:["\n",(0,t.jsx)(s.li,{children:"The lockfile already present in the CWD (e.g. if you are setting up website in an existing project)"}),"\n",(0,t.jsxs)(s.li,{children:["The command used to invoke ",(0,t.jsx)(s.code,{children:"create-docusaurus"})," (e.g. ",(0,t.jsx)(s.code,{children:"npm init"}),", ",(0,t.jsx)(s.code,{children:"npx"}),", ",(0,t.jsx)(s.code,{children:"yarn create"}),", ",(0,t.jsx)(s.code,{children:"bunx"}),", etc.)"]}),"\n",(0,t.jsx)(s.li,{children:"Interactive prompting, in case all heuristics are not present"}),"\n"]}),"\n",(0,t.jsx)(s.h3,{id:"skip-install",children:(0,t.jsx)(s.code,{children:"-s, --skip-install"})}),"\n",(0,t.jsxs)(s.p,{children:["If provided, Docusaurus will not automatically install dependencies after creating the app. The ",(0,t.jsx)(s.code,{children:"--package-manager"})," option is only useful when you are actually installing dependencies."]})]})}function u(e={}){let{wrapper:s}={...(0,c.a)(),...e.components};return s?(0,t.jsx)(s,{...e,children:(0,t.jsx)(d,{...e})}):d(e)}},80980:function(e,s,i){i.d(s,{Z:()=>l,a:()=>a});var n=i(67294);let t={},c=n.createContext(t);function a(e){let s=n.useContext(c);return n.useMemo(function(){return"function"==typeof e?e(s):{...s,...e}},[s,e])}function l(e){let s;return s=e.disableParentContext?"function"==typeof e.components?e.components(t):e.components||t:a(e.components),n.createElement(c.Provider,{value:s},e.children)}}}]); \ No newline at end of file diff --git a/assets/js/0938a5e1.c817018a.js b/assets/js/0938a5e1.8577ab75.js similarity index 97% rename from assets/js/0938a5e1.c817018a.js rename to assets/js/0938a5e1.8577ab75.js index 2c6fc1493a..f1ca09d384 100644 --- a/assets/js/0938a5e1.c817018a.js +++ b/assets/js/0938a5e1.8577ab75.js @@ -1 +1 @@ -"use strict";(self.webpackChunkwebsite=self.webpackChunkwebsite||[]).push([["13328"],{73042:function(e,s,n){n.d(s,{Z:()=>a});let a=n.p+"assets/images/social-card-402517ac2205718a22585e627fe1351c.png"},593:function(e,s,n){n.d(s,{Z:()=>a});let a=n.p+"assets/images/social-card-402517ac2205718a22585e627fe1351c.png"},28918:function(e,s,n){n.r(s),n.d(s,{assets:()=>c,contentTitle:()=>l,default:()=>u,frontMatter:()=>o,metadata:()=>a,toc:()=>h});var a=n(12232),r=n(85893),i=n(80980),t=n(14522);let o={title:"Docusaurus 2.2",authors:["slorber"],tags:["release"],image:"./img/social-card.png",date:new Date("2022-10-29T00:00:00.000Z")},l=void 0,c={image:n(73042).Z,authorsImageUrls:[void 0]},h=[{value:"Highlights",id:"highlights",level:2},{value:"Mermaid diagrams",id:"mermaid-diagrams",level:3},{value:"ConfigheadTags
",id:"config-headtags",level:3},{value:"Accessibility",id:"accessibility",level:3},{value:"Developer Experience",id:"developer-experience",level:3},{value:"Translations",id:"translations",level:3},{value:"Other changes",id:"other-changes",level:2}];function d(e){let s={a:"a",admonition:"admonition",code:"code",h2:"h2",h3:"h3",img:"img",li:"li",mermaid:"mermaid",p:"p",pre:"pre",strong:"strong",ul:"ul",...(0,i.a)(),...e.components};return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsxs)(s.p,{children:["We are happy to announce ",(0,r.jsx)(s.strong,{children:"Docusaurus 2.2"}),"."]}),"\n",(0,r.jsxs)(s.p,{children:["The upgrade should be easy: as explained in our ",(0,r.jsx)(s.a,{href:"/community/release-process",children:"release process documentation"}),", minor versions respect ",(0,r.jsx)(s.a,{href:"https://semver.org/",children:"Semantic Versioning"}),"."]}),"\n",(0,r.jsx)(s.p,{children:(0,r.jsx)(s.img,{alt:"Docusaurus 2.2 social card",src:n(593).Z+"",width:"1200",height:"600"})}),"\n","\n",(0,r.jsx)(s.h2,{id:"highlights",children:"Highlights"}),"\n",(0,r.jsx)(s.h3,{id:"mermaid-diagrams",children:"Mermaid diagrams"}),"\n",(0,r.jsxs)(s.p,{children:["In ",(0,r.jsx)(s.a,{href:"https://github.com/facebook/docusaurus/pull/7490",children:"#7490"}),", we added support for Mermaid diagrams. This fills the gap between GitHub Flavored Markdown which also ",(0,r.jsx)(s.a,{href:"https://github.blog/2022-02-14-include-diagrams-markdown-files-mermaid/",children:"added support recently"}),". You can create Mermaid diagrams using Markdown code blocks:"]}),"\n",(0,r.jsx)(s.pre,{children:(0,r.jsx)(s.code,{className:"language-md",children:"```mermaid\nsequenceDiagram\n participant Alice\n participant Bob\n Alice->>John: Hello John, how are you?\n loop Health check\n John->>John: Fight against hypochondria\n end\n Note right of John: Rational thoughts
prevail!\n John--\x3e>Alice: Great!\n John->>Bob: How about you?\n Bob--\x3e>John: Jolly good!\n```\n"})}),"\n","\n",(0,r.jsx)(t.Z,{children:(0,r.jsx)(s.mermaid,{value:"sequenceDiagram\n participant Alice\n participant Bob\n Alice->>John: Hello John, how are you?\n loop Health check\n John->>John: Fight against hypochondria\n end\n Note right of John: Rational thoughts
prevail!\n John--\x3e>Alice: Great!\n John->>Bob: How about you?\n Bob--\x3e>John: Jolly good!"})}),"\n",(0,r.jsxs)(s.p,{children:["Make sure to check the ",(0,r.jsx)(s.a,{href:"/docs/markdown-features/diagrams",children:"documentation"}),", and the ",(0,r.jsx)(s.a,{href:"/tests/pages/diagrams",children:"more advanced examples"})]}),"\n",(0,r.jsxs)(s.h3,{id:"config-headtags",children:["Config ",(0,r.jsx)(s.code,{children:"headTags"})]}),"\n",(0,r.jsxs)(s.p,{children:["In ",(0,r.jsx)(s.a,{href:"https://github.com/facebook/docusaurus/pull/8151",children:"#8151"}),", we added the ability to apply arbitrary HTML ",(0,r.jsx)(s.code,{children:""})," tags to all pages of your site."]}),"\n",(0,r.jsx)(s.pre,{children:(0,r.jsx)(s.code,{className:"language-js",metastring:'title="docusaurus.config.js"',children:"module.exports = {\n headTags: [\n {\n tagName: 'link',\n attributes: {\n rel: 'icon',\n href: '/img/docusaurus.png',\n },\n },\n ],\n};\n"})}),"\n",(0,r.jsx)(s.h3,{id:"accessibility",children:"Accessibility"}),"\n",(0,r.jsx)(s.p,{children:"We did several accessibility improvements:"}),"\n",(0,r.jsxs)(s.ul,{children:["\n",(0,r.jsxs)(s.li,{children:[(0,r.jsx)(s.a,{href:"https://github.com/facebook/docusaurus/pull/8207",children:"#8207"}),": improves keyboard navigation for mobile drawer hamburger button"]}),"\n",(0,r.jsxs)(s.li,{children:[(0,r.jsx)(s.a,{href:"https://github.com/facebook/docusaurus/pull/8161",children:"#8161"}),": improves keyboard navigation for tabs"]}),"\n",(0,r.jsxs)(s.li,{children:[(0,r.jsx)(s.a,{href:"https://github.com/facebook/docusaurus/pull/8204",children:"#8204"}),": makes the skip to content button support progressive enhancement"]}),"\n",(0,r.jsxs)(s.li,{children:[(0,r.jsx)(s.a,{href:"https://github.com/facebook/docusaurus/pull/8174",children:"#8174"}),": improves screen reader announcement when toggling between light/dark mode"]}),"\n"]}),"\n",(0,r.jsx)(s.h3,{id:"developer-experience",children:"Developer Experience"}),"\n",(0,r.jsx)(s.p,{children:"We made validation stricter and improved error messages:"}),"\n",(0,r.jsxs)(s.ul,{children:["\n",(0,r.jsxs)(s.li,{children:[(0,r.jsx)(s.a,{href:"https://github.com/facebook/docusaurus/pull/8234",children:"#8234"}),": in case of doc processing failure, prints the problematic markdown file path in the error message"]}),"\n",(0,r.jsxs)(s.li,{children:[(0,r.jsx)(s.a,{href:"https://github.com/facebook/docusaurus/pull/8192",children:"#8192"})," and ",(0,r.jsx)(s.a,{href:"https://github.com/facebook/docusaurus/pull/8159",children:"#8159"}),": validates ",(0,r.jsx)(s.code,{children:"siteConfig.url"})," more strictly and with better error message"]}),"\n",(0,r.jsxs)(s.li,{children:[(0,r.jsx)(s.a,{href:"https://github.com/facebook/docusaurus/pull/8066",children:"#8066"}),": makes config ",(0,r.jsx)(s.code,{children:"url"})," and ",(0,r.jsx)(s.code,{children:"baseUrl"})," fail-safe and less sensitive to the presence or absence of a leading or trailing slash"]}),"\n"]}),"\n",(0,r.jsx)(s.h3,{id:"translations",children:"Translations"}),"\n",(0,r.jsx)(s.p,{children:"We completed the default theme translation support for multiple languages:"}),"\n",(0,r.jsxs)(s.ul,{children:["\n",(0,r.jsxs)(s.li,{children:["\uD83C\uDDF9\uD83C\uDDF7 ",(0,r.jsx)(s.a,{href:"https://github.com/facebook/docusaurus/pull/8105",children:"#8105"}),": completes Turkish translations"]}),"\n",(0,r.jsxs)(s.li,{children:["\uD83C\uDDF7\uD83C\uDDFA ",(0,r.jsx)(s.a,{href:"https://github.com/facebook/docusaurus/pull/8253",children:"#8253"}),": completes Russian translations"]}),"\n",(0,r.jsxs)(s.li,{children:["\uD83C\uDDEB\uD83C\uDDF7 ",(0,r.jsx)(s.a,{href:"https://github.com/facebook/docusaurus/pull/8243",children:"#8243"}),": completes French translations"]}),"\n",(0,r.jsxs)(s.li,{children:["\uD83C\uDDEF\uD83C\uDDF5 ",(0,r.jsx)(s.a,{href:"https://github.com/facebook/docusaurus/pull/8075",children:"#8075"}),": completes Japanese translations"]}),"\n"]}),"\n",(0,r.jsx)(s.admonition,{type:"tip",children:(0,r.jsxs)(s.p,{children:["Completing theme translations is an ",(0,r.jsx)(s.a,{href:"https://github.com/facebook/docusaurus/issues/3526",children:"ongoing effort"})," and an easy way to contribute to Docusaurus. We add new theme features regularly, for which we often ",(0,r.jsx)(s.a,{href:"https://github.com/facebook/docusaurus/issues/3526",children:"need new translations"}),"."]})}),"\n",(0,r.jsx)(s.h2,{id:"other-changes",children:"Other changes"}),"\n",(0,r.jsx)(s.p,{children:"Other notable changes include:"}),"\n",(0,r.jsxs)(s.ul,{children:["\n",(0,r.jsxs)(s.li,{children:[(0,r.jsx)(s.a,{href:"https://github.com/facebook/docusaurus/pull/8210",children:"#8210"}),": the ",(0,r.jsx)(s.code,{children:"docusaurus swizzle"})," CLI has a new ",(0,r.jsx)(s.code,{children:"--config"})," option"]}),"\n",(0,r.jsxs)(s.li,{children:[(0,r.jsx)(s.a,{href:"https://github.com/facebook/docusaurus/pull/8109",children:"#8109"}),": mobile navigation performance optimizations, prefetch resources earlier"]}),"\n",(0,r.jsxs)(s.li,{children:[(0,r.jsx)(s.a,{href:"https://github.com/facebook/docusaurus/pull/8059",children:"#8059"}),": versions/locales navbar dropdowns preserve hash and querystring on navigation"]}),"\n",(0,r.jsxs)(s.li,{children:[(0,r.jsx)(s.a,{href:"https://github.com/facebook/docusaurus/pull/8227",children:"#8227"}),": the client redirect plugin preserves hash and querystring on redirect"]}),"\n"]}),"\n",(0,r.jsxs)(s.p,{children:["Check the ",(0,r.jsx)(s.strong,{children:(0,r.jsx)(s.a,{href:"/changelog/2.2.0",children:"2.2.0 changelog entry"})})," for an exhaustive list of changes."]})]})}function u(e={}){let{wrapper:s}={...(0,i.a)(),...e.components};return s?(0,r.jsx)(s,{...e,children:(0,r.jsx)(d,{...e})}):d(e)}},14522:function(e,s,n){n.d(s,{Z:()=>o});var a=n(85893);n(67294);var r=n(90496);let i="dot_giz1",t="bar_rrRL";function o(e){let{children:s,minHeight:n,url:o="http://localhost:3000",style:l,bodyStyle:c}=e;return(0,a.jsxs)("div",{className:"browserWindow_my1Q",style:{...l,minHeight:n},children:[(0,a.jsxs)("div",{className:"browserWindowHeader_jXSR",children:[(0,a.jsxs)("div",{className:"buttons_uHc7",children:[(0,a.jsx)("span",{className:i,style:{background:"#f25f58"}}),(0,a.jsx)("span",{className:i,style:{background:"#fbbe3c"}}),(0,a.jsx)("span",{className:i,style:{background:"#58cb42"}})]}),(0,a.jsx)("div",{className:(0,r.Z)("browserWindowAddressBar_Pd8y","text--truncate"),children:o}),(0,a.jsx)("div",{className:"browserWindowMenuIcon_Vhuh",children:(0,a.jsxs)("div",{children:[(0,a.jsx)("span",{className:t}),(0,a.jsx)("span",{className:t}),(0,a.jsx)("span",{className:t})]})})]}),(0,a.jsx)("div",{className:"browserWindowBody_Idgs",style:c,children:s})]})}},80980:function(e,s,n){n.d(s,{Z:()=>o,a:()=>t});var a=n(67294);let r={},i=a.createContext(r);function t(e){let s=a.useContext(i);return a.useMemo(function(){return"function"==typeof e?e(s):{...s,...e}},[s,e])}function o(e){let s;return s=e.disableParentContext?"function"==typeof e.components?e.components(r):e.components||r:t(e.components),a.createElement(i.Provider,{value:s},e.children)}},12232:function(e){e.exports=JSON.parse('{"permalink":"/blog/releases/2.2","editUrl":"https://github.com/facebook/docusaurus/edit/main/website/blog/releases/2.2/index.mdx","source":"@site/blog/releases/2.2/index.mdx","title":"Docusaurus 2.2","description":"We are happy to announce Docusaurus 2.2.","date":"2022-10-29T00:00:00.000Z","tags":[{"inline":false,"label":"Release","permalink":"/blog/tags/release","description":"Blog posts about Docusaurus\' new releases"}],"readingTime":2.2,"hasTruncateMarker":true,"authors":[{"name":"S\xe9bastien Lorber","title":"Docusaurus maintainer, This Week In React editor","url":"https://thisweekinreact.com","page":{"permalink":"/blog/authors/slorber"},"description":"A freelance React and React-Native developer near Paris and Docusaurus maintainer. Also runs ThisWeekInReact.com, a newsletter to stay updated with the React ecosystem.","socials":{"bluesky":"https://bsky.app/profile/sebastienlorber.com","x":"https://x.com/sebastienlorber","linkedin":"https://www.linkedin.com/in/sebastienlorber/","github":"https://github.com/slorber","instagram":"https://www.instagram.com/thisweekinreact","newsletter":"https://thisweekinreact.com"},"imageURL":"https://github.com/slorber.png","key":"slorber"}],"frontMatter":{"title":"Docusaurus 2.2","authors":["slorber"],"tags":["release"],"image":"./img/social-card.png","date":"2022-10-29T00:00:00.000Z"},"unlisted":false,"lastUpdatedAt":1744155424000,"lastUpdatedBy":"Ben McCann","prevItem":{"title":"Docusaurus 2.3","permalink":"/blog/releases/2.3"},"nextItem":{"title":"Docusaurus 2.1","permalink":"/blog/2022/09/01/docusaurus-2.1"}}')}}]); \ No newline at end of file +"use strict";(self.webpackChunkwebsite=self.webpackChunkwebsite||[]).push([["13328"],{73042:function(e,s,n){n.d(s,{Z:()=>a});let a=n.p+"assets/images/social-card-402517ac2205718a22585e627fe1351c.png"},593:function(e,s,n){n.d(s,{Z:()=>a});let a=n.p+"assets/images/social-card-402517ac2205718a22585e627fe1351c.png"},28918:function(e,s,n){n.r(s),n.d(s,{assets:()=>c,contentTitle:()=>l,default:()=>u,frontMatter:()=>o,metadata:()=>a,toc:()=>h});var a=n(12232),r=n(85893),i=n(80980),t=n(14522);let o={title:"Docusaurus 2.2",authors:["slorber"],tags:["release"],image:"./img/social-card.png",date:new Date("2022-10-29T00:00:00.000Z")},l=void 0,c={image:n(73042).Z,authorsImageUrls:[void 0]},h=[{value:"Highlights",id:"highlights",level:2},{value:"Mermaid diagrams",id:"mermaid-diagrams",level:3},{value:"ConfigheadTags
",id:"config-headtags",level:3},{value:"Accessibility",id:"accessibility",level:3},{value:"Developer Experience",id:"developer-experience",level:3},{value:"Translations",id:"translations",level:3},{value:"Other changes",id:"other-changes",level:2}];function d(e){let s={a:"a",admonition:"admonition",code:"code",h2:"h2",h3:"h3",img:"img",li:"li",mermaid:"mermaid",p:"p",pre:"pre",strong:"strong",ul:"ul",...(0,i.a)(),...e.components};return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsxs)(s.p,{children:["We are happy to announce ",(0,r.jsx)(s.strong,{children:"Docusaurus 2.2"}),"."]}),"\n",(0,r.jsxs)(s.p,{children:["The upgrade should be easy: as explained in our ",(0,r.jsx)(s.a,{href:"/community/release-process",children:"release process documentation"}),", minor versions respect ",(0,r.jsx)(s.a,{href:"https://semver.org/",children:"Semantic Versioning"}),"."]}),"\n",(0,r.jsx)(s.p,{children:(0,r.jsx)(s.img,{alt:"Docusaurus 2.2 social card",src:n(593).Z+"",width:"1200",height:"600"})}),"\n","\n",(0,r.jsx)(s.h2,{id:"highlights",children:"Highlights"}),"\n",(0,r.jsx)(s.h3,{id:"mermaid-diagrams",children:"Mermaid diagrams"}),"\n",(0,r.jsxs)(s.p,{children:["In ",(0,r.jsx)(s.a,{href:"https://github.com/facebook/docusaurus/pull/7490",children:"#7490"}),", we added support for Mermaid diagrams. This fills the gap between GitHub Flavored Markdown which also ",(0,r.jsx)(s.a,{href:"https://github.blog/2022-02-14-include-diagrams-markdown-files-mermaid/",children:"added support recently"}),". You can create Mermaid diagrams using Markdown code blocks:"]}),"\n",(0,r.jsx)(s.pre,{children:(0,r.jsx)(s.code,{className:"language-md",children:"```mermaid\nsequenceDiagram\n participant Alice\n participant Bob\n Alice->>John: Hello John, how are you?\n loop Health check\n John->>John: Fight against hypochondria\n end\n Note right of John: Rational thoughts
prevail!\n John--\x3e>Alice: Great!\n John->>Bob: How about you?\n Bob--\x3e>John: Jolly good!\n```\n"})}),"\n","\n",(0,r.jsx)(t.Z,{children:(0,r.jsx)(s.mermaid,{value:"sequenceDiagram\n participant Alice\n participant Bob\n Alice->>John: Hello John, how are you?\n loop Health check\n John->>John: Fight against hypochondria\n end\n Note right of John: Rational thoughts
prevail!\n John--\x3e>Alice: Great!\n John->>Bob: How about you?\n Bob--\x3e>John: Jolly good!"})}),"\n",(0,r.jsxs)(s.p,{children:["Make sure to check the ",(0,r.jsx)(s.a,{href:"/docs/markdown-features/diagrams",children:"documentation"}),", and the ",(0,r.jsx)(s.a,{href:"/tests/pages/diagrams",children:"more advanced examples"})]}),"\n",(0,r.jsxs)(s.h3,{id:"config-headtags",children:["Config ",(0,r.jsx)(s.code,{children:"headTags"})]}),"\n",(0,r.jsxs)(s.p,{children:["In ",(0,r.jsx)(s.a,{href:"https://github.com/facebook/docusaurus/pull/8151",children:"#8151"}),", we added the ability to apply arbitrary HTML ",(0,r.jsx)(s.code,{children:""})," tags to all pages of your site."]}),"\n",(0,r.jsx)(s.pre,{children:(0,r.jsx)(s.code,{className:"language-js",metastring:'title="docusaurus.config.js"',children:"module.exports = {\n headTags: [\n {\n tagName: 'link',\n attributes: {\n rel: 'icon',\n href: '/img/docusaurus.png',\n },\n },\n ],\n};\n"})}),"\n",(0,r.jsx)(s.h3,{id:"accessibility",children:"Accessibility"}),"\n",(0,r.jsx)(s.p,{children:"We did several accessibility improvements:"}),"\n",(0,r.jsxs)(s.ul,{children:["\n",(0,r.jsxs)(s.li,{children:[(0,r.jsx)(s.a,{href:"https://github.com/facebook/docusaurus/pull/8207",children:"#8207"}),": improves keyboard navigation for mobile drawer hamburger button"]}),"\n",(0,r.jsxs)(s.li,{children:[(0,r.jsx)(s.a,{href:"https://github.com/facebook/docusaurus/pull/8161",children:"#8161"}),": improves keyboard navigation for tabs"]}),"\n",(0,r.jsxs)(s.li,{children:[(0,r.jsx)(s.a,{href:"https://github.com/facebook/docusaurus/pull/8204",children:"#8204"}),": makes the skip to content button support progressive enhancement"]}),"\n",(0,r.jsxs)(s.li,{children:[(0,r.jsx)(s.a,{href:"https://github.com/facebook/docusaurus/pull/8174",children:"#8174"}),": improves screen reader announcement when toggling between light/dark mode"]}),"\n"]}),"\n",(0,r.jsx)(s.h3,{id:"developer-experience",children:"Developer Experience"}),"\n",(0,r.jsx)(s.p,{children:"We made validation stricter and improved error messages:"}),"\n",(0,r.jsxs)(s.ul,{children:["\n",(0,r.jsxs)(s.li,{children:[(0,r.jsx)(s.a,{href:"https://github.com/facebook/docusaurus/pull/8234",children:"#8234"}),": in case of doc processing failure, prints the problematic markdown file path in the error message"]}),"\n",(0,r.jsxs)(s.li,{children:[(0,r.jsx)(s.a,{href:"https://github.com/facebook/docusaurus/pull/8192",children:"#8192"})," and ",(0,r.jsx)(s.a,{href:"https://github.com/facebook/docusaurus/pull/8159",children:"#8159"}),": validates ",(0,r.jsx)(s.code,{children:"siteConfig.url"})," more strictly and with better error message"]}),"\n",(0,r.jsxs)(s.li,{children:[(0,r.jsx)(s.a,{href:"https://github.com/facebook/docusaurus/pull/8066",children:"#8066"}),": makes config ",(0,r.jsx)(s.code,{children:"url"})," and ",(0,r.jsx)(s.code,{children:"baseUrl"})," fail-safe and less sensitive to the presence or absence of a leading or trailing slash"]}),"\n"]}),"\n",(0,r.jsx)(s.h3,{id:"translations",children:"Translations"}),"\n",(0,r.jsx)(s.p,{children:"We completed the default theme translation support for multiple languages:"}),"\n",(0,r.jsxs)(s.ul,{children:["\n",(0,r.jsxs)(s.li,{children:["\uD83C\uDDF9\uD83C\uDDF7 ",(0,r.jsx)(s.a,{href:"https://github.com/facebook/docusaurus/pull/8105",children:"#8105"}),": completes Turkish translations"]}),"\n",(0,r.jsxs)(s.li,{children:["\uD83C\uDDF7\uD83C\uDDFA ",(0,r.jsx)(s.a,{href:"https://github.com/facebook/docusaurus/pull/8253",children:"#8253"}),": completes Russian translations"]}),"\n",(0,r.jsxs)(s.li,{children:["\uD83C\uDDEB\uD83C\uDDF7 ",(0,r.jsx)(s.a,{href:"https://github.com/facebook/docusaurus/pull/8243",children:"#8243"}),": completes French translations"]}),"\n",(0,r.jsxs)(s.li,{children:["\uD83C\uDDEF\uD83C\uDDF5 ",(0,r.jsx)(s.a,{href:"https://github.com/facebook/docusaurus/pull/8075",children:"#8075"}),": completes Japanese translations"]}),"\n"]}),"\n",(0,r.jsx)(s.admonition,{type:"tip",children:(0,r.jsxs)(s.p,{children:["Completing theme translations is an ",(0,r.jsx)(s.a,{href:"https://github.com/facebook/docusaurus/issues/3526",children:"ongoing effort"})," and an easy way to contribute to Docusaurus. We add new theme features regularly, for which we often ",(0,r.jsx)(s.a,{href:"https://github.com/facebook/docusaurus/issues/3526",children:"need new translations"}),"."]})}),"\n",(0,r.jsx)(s.h2,{id:"other-changes",children:"Other changes"}),"\n",(0,r.jsx)(s.p,{children:"Other notable changes include:"}),"\n",(0,r.jsxs)(s.ul,{children:["\n",(0,r.jsxs)(s.li,{children:[(0,r.jsx)(s.a,{href:"https://github.com/facebook/docusaurus/pull/8210",children:"#8210"}),": the ",(0,r.jsx)(s.code,{children:"docusaurus swizzle"})," CLI has a new ",(0,r.jsx)(s.code,{children:"--config"})," option"]}),"\n",(0,r.jsxs)(s.li,{children:[(0,r.jsx)(s.a,{href:"https://github.com/facebook/docusaurus/pull/8109",children:"#8109"}),": mobile navigation performance optimizations, prefetch resources earlier"]}),"\n",(0,r.jsxs)(s.li,{children:[(0,r.jsx)(s.a,{href:"https://github.com/facebook/docusaurus/pull/8059",children:"#8059"}),": versions/locales navbar dropdowns preserve hash and querystring on navigation"]}),"\n",(0,r.jsxs)(s.li,{children:[(0,r.jsx)(s.a,{href:"https://github.com/facebook/docusaurus/pull/8227",children:"#8227"}),": the client redirect plugin preserves hash and querystring on redirect"]}),"\n"]}),"\n",(0,r.jsxs)(s.p,{children:["Check the ",(0,r.jsx)(s.strong,{children:(0,r.jsx)(s.a,{href:"/changelog/2.2.0",children:"2.2.0 changelog entry"})})," for an exhaustive list of changes."]})]})}function u(e={}){let{wrapper:s}={...(0,i.a)(),...e.components};return s?(0,r.jsx)(s,{...e,children:(0,r.jsx)(d,{...e})}):d(e)}},14522:function(e,s,n){n.d(s,{Z:()=>o});var a=n(85893);n(67294);var r=n(90496);let i="dot_giz1",t="bar_rrRL";function o(e){let{children:s,minHeight:n,url:o="http://localhost:3000",style:l,bodyStyle:c}=e;return(0,a.jsxs)("div",{className:"browserWindow_my1Q",style:{...l,minHeight:n},children:[(0,a.jsxs)("div",{className:"browserWindowHeader_jXSR",children:[(0,a.jsxs)("div",{className:"buttons_uHc7",children:[(0,a.jsx)("span",{className:i,style:{background:"#f25f58"}}),(0,a.jsx)("span",{className:i,style:{background:"#fbbe3c"}}),(0,a.jsx)("span",{className:i,style:{background:"#58cb42"}})]}),(0,a.jsx)("div",{className:(0,r.Z)("browserWindowAddressBar_Pd8y","text--truncate"),children:o}),(0,a.jsx)("div",{className:"browserWindowMenuIcon_Vhuh",children:(0,a.jsxs)("div",{children:[(0,a.jsx)("span",{className:t}),(0,a.jsx)("span",{className:t}),(0,a.jsx)("span",{className:t})]})})]}),(0,a.jsx)("div",{className:"browserWindowBody_Idgs",style:c,children:s})]})}},80980:function(e,s,n){n.d(s,{Z:()=>o,a:()=>t});var a=n(67294);let r={},i=a.createContext(r);function t(e){let s=a.useContext(i);return a.useMemo(function(){return"function"==typeof e?e(s):{...s,...e}},[s,e])}function o(e){let s;return s=e.disableParentContext?"function"==typeof e.components?e.components(r):e.components||r:t(e.components),a.createElement(i.Provider,{value:s},e.children)}},12232:function(e){e.exports=JSON.parse('{"permalink":"/blog/releases/2.2","editUrl":"https://github.com/facebook/docusaurus/edit/main/website/blog/releases/2.2/index.mdx","source":"@site/blog/releases/2.2/index.mdx","title":"Docusaurus 2.2","description":"We are happy to announce Docusaurus 2.2.","date":"2022-10-29T00:00:00.000Z","tags":[{"inline":false,"label":"Release","permalink":"/blog/tags/release","description":"Blog posts about Docusaurus\' new releases"}],"readingTime":2.2,"hasTruncateMarker":true,"authors":[{"name":"S\xe9bastien Lorber","title":"Docusaurus maintainer, This Week In React editor","url":"https://thisweekinreact.com","page":{"permalink":"/blog/authors/slorber"},"description":"A freelance React and React-Native developer near Paris and Docusaurus maintainer. Also runs ThisWeekInReact.com, a newsletter to stay updated with the React ecosystem.","socials":{"bluesky":"https://bsky.app/profile/sebastienlorber.com","x":"https://x.com/sebastienlorber","linkedin":"https://www.linkedin.com/in/sebastienlorber/","github":"https://github.com/slorber","instagram":"https://www.instagram.com/thisweekinreact","newsletter":"https://thisweekinreact.com"},"imageURL":"https://github.com/slorber.png","key":"slorber"}],"frontMatter":{"title":"Docusaurus 2.2","authors":["slorber"],"tags":["release"],"image":"./img/social-card.png","date":"2022-10-29T00:00:00.000Z"},"unlisted":false,"lastUpdatedAt":1744293302000,"lastUpdatedBy":"S\xe9bastien Lorber","prevItem":{"title":"Docusaurus 2.3","permalink":"/blog/releases/2.3"},"nextItem":{"title":"Docusaurus 2.1","permalink":"/blog/2022/09/01/docusaurus-2.1"}}')}}]); \ No newline at end of file diff --git a/assets/js/0a544fe9.1d948652.js b/assets/js/0a544fe9.bdaeb022.js similarity index 77% rename from assets/js/0a544fe9.1d948652.js rename to assets/js/0a544fe9.bdaeb022.js index c6df909486..d67e93fc74 100644 --- a/assets/js/0a544fe9.1d948652.js +++ b/assets/js/0a544fe9.bdaeb022.js @@ -1,4 +1,4 @@ -"use strict";(self.webpackChunkwebsite=self.webpackChunkwebsite||[]).push([["96766"],{5666:function(e,t,n){n.d(t,{CS:()=>f,iZ:()=>j,ci:()=>y,Ne:()=>k,cH:()=>N,nO:()=>d,wj:()=>i,n4:()=>c});var r=n(85893),a=n(67294),s=n(50923),l=n(3564);function i(){let e=(0,l.Z)(),t=e?.data?.blogMetadata;if(!t)throw Error("useBlogMetadata() can't be called on the current route because the blog metadata could not be found in route context");return t}let o=a.createContext(null);function c(e){let{children:t,content:n,isBlogPostPage:s=!1}=e,l=function(e){let{content:t,isBlogPostPage:n}=e;return(0,a.useMemo)(()=>({metadata:t.metadata,frontMatter:t.frontMatter,assets:t.assets,toc:t.toc,isBlogPostPage:n}),[t,n])}({content:n,isBlogPostPage:s});return(0,r.jsx)(o.Provider,{value:l,children:t})}function d(){let e=(0,a.useContext)(o);if(null===e)throw new s.i6("BlogPostProvider");return e}var u=n(83631),h=n(8156);let m=e=>new Date(e).toISOString();function g(e){let t=e.map(p);return{author:1===t.length?t[0]:t}}function x(e,t,n){return e?{image:function(e){let{imageUrl:t,caption:n}=e;return{"@type":"ImageObject","@id":t,url:t,contentUrl:t,caption:n}}({imageUrl:t(e,{absolute:!0}),caption:`title image for the blog post: ${n}`})}:{}}function f(e){let{siteConfig:t}=(0,h.Z)(),{withBaseUrl:n}=(0,u.Cg)(),{metadata:{blogDescription:r,blogTitle:a,permalink:s}}=e,l=`${t.url}${s}`;return{"@context":"https://schema.org","@type":"Blog","@id":l,mainEntityOfPage:l,headline:a,description:r,blogPost:e.items.map(e=>(function(e,t,n){let{assets:r,frontMatter:a,metadata:s}=e,{date:l,title:i,description:o,lastUpdatedAt:c}=s,d=r.image??a.image,u=a.keywords??[],h=`${t.url}${s.permalink}`,f=c?m(c):void 0;return{"@type":"BlogPosting","@id":h,mainEntityOfPage:h,url:h,headline:i,name:i,description:o,datePublished:l,...f?{dateModified:f}:{},...g(s.authors),...x(d,n,i),...u?{keywords:u}:{}}})(e.content,t,n))}}function j(){let e=i(),{assets:t,metadata:n}=d(),{siteConfig:r}=(0,h.Z)(),{withBaseUrl:a}=(0,u.Cg)(),{date:s,title:l,description:o,frontMatter:c,lastUpdatedAt:f}=n,j=t.image??c.image,p=c.keywords??[],v=f?m(f):void 0,b=`${r.url}${n.permalink}`;return{"@context":"https://schema.org","@type":"BlogPosting","@id":b,mainEntityOfPage:b,url:b,headline:l,name:l,description:o,datePublished:s,...v?{dateModified:v}:{},...g(n.authors),...x(j,a,l),...p?{keywords:p}:{},isPartOf:{"@type":"Blog","@id":`${r.url}${e.blogBasePath}`,name:e.blogTitle}}}function p(e){return{"@type":"Person",...e.name?{name:e.name}:{},...e.title?{description:e.title}:{},...e.url?{url:e.url}:{},...e.email?{email:e.email}:{},...e.imageURL?{image:e.imageURL}:{}}}var v=n(3620),b=n(35363),w=n(32263),Z=n(71208);function N(e){let{pathname:t}=(0,v.TH)();return(0,a.useMemo)(()=>e.filter(e=>!e.unlisted||!!(0,Z.Mg)(e.permalink,t)),[e,t])}function y(e){let t=Object.entries((0,w.vM)(e,e=>`${new Date(e.date).getFullYear()}`));return t.reverse(),t}function k(e){let{items:t,ulClassName:n,liClassName:a,linkClassName:s,linkActiveClassName:l}=e;return(0,r.jsx)("ul",{className:n,children:t.map(e=>(0,r.jsx)("li",{className:a,children:(0,r.jsx)(b.Z,{isNavLink:!0,to:e.permalink,className:s,activeClassName:l,children:e.title})},e.permalink))})}},37796:function(e,t,n){n.d(t,{Z:()=>a});var r=n(85893);function a(e){return(0,r.jsx)("svg",{viewBox:"0 0 14 16",...e,children:(0,r.jsx)("path",{fillRule:"evenodd",d:"M7 2.3c3.14 0 5.7 2.56 5.7 5.7s-2.56 5.7-5.7 5.7A5.71 5.71 0 0 1 1.3 8c0-3.14 2.56-5.7 5.7-5.7zM7 1C3.14 1 0 4.14 0 8s3.14 7 7 7 7-3.14 7-7-3.14-7-7-7zm1 3H6v5h2V4zm0 6H6v2h2v-2z"})})}n(67294)},49356:function(e,t,n){n.d(t,{Z:()=>C});var r=n(85893),a=n(67294),s=n(90496),l=n(77827),i=n(55951);let o={admonition:"admonition_o5H7",admonitionHeading:"admonitionHeading_FzoX",admonitionIcon:"admonitionIcon_rXq6",admonitionContent:"admonitionContent_Knsx"};function c(e){let{type:t,className:n,children:a}=e;return(0,r.jsx)("div",{className:(0,s.Z)(i.k.common.admonition,i.k.common.admonitionType(t),o.admonition,n),children:a})}function d(e){let{icon:t,title:n}=e;return(0,r.jsxs)("div",{className:o.admonitionHeading,children:[(0,r.jsx)("span",{className:o.admonitionIcon,children:t}),n]})}function u(e){let{children:t}=e;return t?(0,r.jsx)("div",{className:o.admonitionContent,children:t}):null}function h(e){let{type:t,icon:n,title:a,children:s,className:l}=e;return(0,r.jsxs)(c,{type:t,className:l,children:[a||n?(0,r.jsx)(d,{title:a,icon:n}):null,(0,r.jsx)(u,{children:s})]})}let m={icon:(0,r.jsx)(function(e){return(0,r.jsx)("svg",{viewBox:"0 0 14 16",...e,children:(0,r.jsx)("path",{fillRule:"evenodd",d:"M6.3 5.69a.942.942 0 0 1-.28-.7c0-.28.09-.52.28-.7.19-.18.42-.28.7-.28.28 0 .52.09.7.28.18.19.28.42.28.7 0 .28-.09.52-.28.7a1 1 0 0 1-.7.3c-.28 0-.52-.11-.7-.3zM8 7.99c-.02-.25-.11-.48-.31-.69-.2-.19-.42-.3-.69-.31H6c-.27.02-.48.13-.69.31-.2.2-.3.44-.31.69h1v3c.02.27.11.5.31.69.2.2.42.31.69.31h1c.27 0 .48-.11.69-.31.2-.19.3-.42.31-.69H8V7.98v.01zM7 2.3c-3.14 0-5.7 2.54-5.7 5.68 0 3.14 2.56 5.7 5.7 5.7s5.7-2.55 5.7-5.7c0-3.15-2.56-5.69-5.7-5.69v.01zM7 .98c3.86 0 7 3.14 7 7s-3.14 7-7 7-7-3.12-7-7 3.14-7 7-7z"})})},{}),title:(0,r.jsx)(l.Z,{id:"theme.admonition.note",description:"The default label used for the Note admonition (:::note)",children:"note"})};function g(e){return(0,r.jsx)(h,{...m,...e,className:(0,s.Z)("alert alert--secondary",e.className),children:e.children})}let x={icon:(0,r.jsx)(function(e){return(0,r.jsx)("svg",{viewBox:"0 0 12 16",...e,children:(0,r.jsx)("path",{fillRule:"evenodd",d:"M6.5 0C3.48 0 1 2.19 1 5c0 .92.55 2.25 1 3 1.34 2.25 1.78 2.78 2 4v1h5v-1c.22-1.22.66-1.75 2-4 .45-.75 1-2.08 1-3 0-2.81-2.48-5-5.5-5zm3.64 7.48c-.25.44-.47.8-.67 1.11-.86 1.41-1.25 2.06-1.45 3.23-.02.05-.02.11-.02.17H5c0-.06 0-.13-.02-.17-.2-1.17-.59-1.83-1.45-3.23-.2-.31-.42-.67-.67-1.11C2.44 6.78 2 5.65 2 5c0-2.2 2.02-4 4.5-4 1.22 0 2.36.42 3.22 1.19C10.55 2.94 11 3.94 11 5c0 .66-.44 1.78-.86 2.48zM4 14h5c-.23 1.14-1.3 2-2.5 2s-2.27-.86-2.5-2z"})})},{}),title:(0,r.jsx)(l.Z,{id:"theme.admonition.tip",description:"The default label used for the Tip admonition (:::tip)",children:"tip"})};function f(e){return(0,r.jsx)(h,{...x,...e,className:(0,s.Z)("alert alert--success",e.className),children:e.children})}var j=n(37796);let p={icon:(0,r.jsx)(j.Z,{}),title:(0,r.jsx)(l.Z,{id:"theme.admonition.info",description:"The default label used for the Info admonition (:::info)",children:"info"})};function v(e){return(0,r.jsx)(h,{...p,...e,className:(0,s.Z)("alert alert--info",e.className),children:e.children})}function b(e){return(0,r.jsx)("svg",{viewBox:"0 0 16 16",...e,children:(0,r.jsx)("path",{fillRule:"evenodd",d:"M8.893 1.5c-.183-.31-.52-.5-.887-.5s-.703.19-.886.5L.138 13.499a.98.98 0 0 0 0 1.001c.193.31.53.501.886.501h13.964c.367 0 .704-.19.877-.5a1.03 1.03 0 0 0 .01-1.002L8.893 1.5zm.133 11.497H6.987v-2.003h2.039v2.003zm0-3.004H6.987V5.987h2.039v4.006z"})})}let w={icon:(0,r.jsx)(b,{}),title:(0,r.jsx)(l.Z,{id:"theme.admonition.warning",description:"The default label used for the Warning admonition (:::warning)",children:"warning"})},Z={icon:(0,r.jsx)(function(e){return(0,r.jsx)("svg",{viewBox:"0 0 12 16",...e,children:(0,r.jsx)("path",{fillRule:"evenodd",d:"M5.05.31c.81 2.17.41 3.38-.52 4.31C3.55 5.67 1.98 6.45.9 7.98c-1.45 2.05-1.7 6.53 3.53 7.7-2.2-1.16-2.67-4.52-.3-6.61-.61 2.03.53 3.33 1.94 2.86 1.39-.47 2.3.53 2.27 1.67-.02.78-.31 1.44-1.13 1.81 3.42-.59 4.78-3.42 4.78-5.56 0-2.84-2.53-3.22-1.25-5.61-1.52.13-2.03 1.13-1.89 2.75.09 1.08-1.02 1.8-1.86 1.33-.67-.41-.66-1.19-.06-1.78C8.18 5.31 8.68 2.45 5.05.32L5.03.3l.02.01z"})})},{}),title:(0,r.jsx)(l.Z,{id:"theme.admonition.danger",description:"The default label used for the Danger admonition (:::danger)",children:"danger"})},N={icon:(0,r.jsx)(b,{}),title:(0,r.jsx)(l.Z,{id:"theme.admonition.caution",description:"The default label used for the Caution admonition (:::caution)",children:"caution"})};var y=n(57922);let k={note:g,tip:f,info:v,warning:function(e){return(0,r.jsx)(h,{...w,...e,className:(0,s.Z)("alert alert--warning",e.className),children:e.children})},danger:function(e){return(0,r.jsx)(h,{...Z,...e,className:(0,s.Z)("alert alert--danger",e.className),children:e.children})},secondary:e=>(0,r.jsx)(g,{title:"secondary",...e}),important:e=>(0,r.jsx)(v,{title:"important",...e}),success:e=>(0,r.jsx)(f,{title:"success",...e}),caution:function(e){return(0,r.jsx)(h,{...N,...e,className:(0,s.Z)("alert alert--warning",e.className),children:e.children})},"my-custom-admonition":function(e){return(0,r.jsxs)("div",{style:{border:"solid red",padding:10},children:[(0,r.jsx)(y.Z,{as:"h5",style:{color:"blue",fontSize:30},children:e.title}),(0,r.jsx)("div",{children:e.children})]})}};function C(e){let t=function(e){let{mdxAdmonitionTitle:t,rest:n}=function(e){let t=a.Children.toArray(e),n=t.find(e=>a.isValidElement(e)&&"mdxAdmonitionTitle"===e.type),s=t.filter(e=>e!==n);return{mdxAdmonitionTitle:n?.props.children,rest:s.length>0?(0,r.jsx)(r.Fragment,{children:s}):null}}(e.children),s=e.title??t;return{...e,...s&&{title:s},children:n}}(e),n=function(e){let t=k[e];return t||(console.warn(`No admonition component found for admonition type "${e}". Using Info as fallback.`),k.info)}(t.type);return(0,r.jsx)(n,{...t})}},68930:function(e,t,n){n.d(t,{Z:()=>p});var r=n(85893),a=n(67294),s=n(90496),l=n(35363);let i=function(e){return(0,r.jsxs)("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",...e,children:[(0,r.jsx)("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),(0,r.jsx)("path",{d:"M3 12a9 9 0 1 0 18 0a9 9 0 0 0 -18 0"}),(0,r.jsx)("path",{d:"M3.6 9h16.8"}),(0,r.jsx)("path",{d:"M3.6 15h16.8"}),(0,r.jsx)("path",{d:"M11.5 3a17 17 0 0 0 0 18"}),(0,r.jsx)("path",{d:"M12.5 3a17 17 0 0 1 0 18"})]})},o="authorSocialLink_hEWM",c={twitter:{Icon:function(e){return(0,r.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 256 209",width:"1em",height:"1em",preserveAspectRatio:"xMidYMid",...e,children:(0,r.jsx)("path",{d:"M256 25.45c-9.42 4.177-19.542 7-30.166 8.27 10.845-6.5 19.172-16.793 23.093-29.057a105.183 105.183 0 0 1-33.351 12.745C205.995 7.201 192.346.822 177.239.822c-29.006 0-52.523 23.516-52.523 52.52 0 4.117.465 8.125 1.36 11.97-43.65-2.191-82.35-23.1-108.255-54.876-4.52 7.757-7.11 16.78-7.11 26.404 0 18.222 9.273 34.297 23.365 43.716a52.312 52.312 0 0 1-23.79-6.57c-.003.22-.003.44-.003.661 0 25.447 18.104 46.675 42.13 51.5a52.592 52.592 0 0 1-23.718.9c6.683 20.866 26.08 36.05 49.062 36.475-17.975 14.086-40.622 22.483-65.228 22.483-4.24 0-8.42-.249-12.529-.734 23.243 14.902 50.85 23.597 80.51 23.597 96.607 0 149.434-80.031 149.434-149.435 0-2.278-.05-4.543-.152-6.795A106.748 106.748 0 0 0 256 25.45",fill:"#55acee"})})},label:"Twitter"},github:{Icon:function(e){return(0,r.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 256 250",preserveAspectRatio:"xMidYMid",style:{"--dark":"#000","--light":"#fff"},...e,className:(0,s.Z)(e.className,"githubSvg_jqE4"),children:(0,r.jsx)("path",{d:"M128.001 0C57.317 0 0 57.307 0 128.001c0 56.554 36.676 104.535 87.535 121.46 6.397 1.185 8.746-2.777 8.746-6.158 0-3.052-.12-13.135-.174-23.83-35.61 7.742-43.124-15.103-43.124-15.103-5.823-14.795-14.213-18.73-14.213-18.73-11.613-7.944.876-7.78.876-7.78 12.853.902 19.621 13.19 19.621 13.19 11.417 19.568 29.945 13.911 37.249 10.64 1.149-8.272 4.466-13.92 8.127-17.116-28.431-3.236-58.318-14.212-58.318-63.258 0-13.975 5-25.394 13.188-34.358-1.329-3.224-5.71-16.242 1.24-33.874 0 0 10.749-3.44 35.21 13.121 10.21-2.836 21.16-4.258 32.038-4.307 10.878.049 21.837 1.47 32.066 4.307 24.431-16.56 35.165-13.12 35.165-13.12 6.967 17.63 2.584 30.65 1.255 33.873 8.207 8.964 13.173 20.383 13.173 34.358 0 49.163-29.944 59.988-58.447 63.157 4.591 3.972 8.682 11.762 8.682 23.704 0 17.126-.148 30.91-.148 35.126 0 3.407 2.304 7.398 8.792 6.14C219.37 232.5 256 184.537 256 128.002 256 57.307 198.691 0 128.001 0Zm-80.06 182.34c-.282.636-1.283.827-2.194.39-.929-.417-1.45-1.284-1.15-1.922.276-.655 1.279-.838 2.205-.399.93.418 1.46 1.293 1.139 1.931Zm6.296 5.618c-.61.566-1.804.303-2.614-.591-.837-.892-.994-2.086-.375-2.66.63-.566 1.787-.301 2.626.591.838.903 1 2.088.363 2.66Zm4.32 7.188c-.785.545-2.067.034-2.86-1.104-.784-1.138-.784-2.503.017-3.05.795-.547 2.058-.055 2.861 1.075.782 1.157.782 2.522-.019 3.08Zm7.304 8.325c-.701.774-2.196.566-3.29-.49-1.119-1.032-1.43-2.496-.726-3.27.71-.776 2.213-.558 3.315.49 1.11 1.03 1.45 2.505.701 3.27Zm9.442 2.81c-.31 1.003-1.75 1.459-3.199 1.033-1.448-.439-2.395-1.613-2.103-2.626.301-1.01 1.747-1.484 3.207-1.028 1.446.436 2.396 1.602 2.095 2.622Zm10.744 1.193c.036 1.055-1.193 1.93-2.715 1.95-1.53.034-2.769-.82-2.786-1.86 0-1.065 1.202-1.932 2.733-1.958 1.522-.03 2.768.818 2.768 1.868Zm10.555-.405c.182 1.03-.875 2.088-2.387 2.37-1.485.271-2.861-.365-3.05-1.386-.184-1.056.893-2.114 2.376-2.387 1.514-.263 2.868.356 3.061 1.403Z"})})},label:"GitHub"},stackoverflow:{Icon:function(e){return(0,r.jsxs)("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 169.61 200",width:"1em",height:"1em",...e,children:[(0,r.jsx)("path",{d:"M140.44 178.38v-48.65h21.61V200H0v-70.27h21.61v48.65z",fill:"#bcbbbb"}),(0,r.jsx)("path",{d:"M124.24 140.54l4.32-16.22-86.97-17.83-3.78 17.83zM49.7 82.16L130.72 120l7.56-16.22-81.02-37.83zm22.68-40l68.06 57.3 11.35-13.51-68.6-57.3-11.35 13.51zM116.14 0l-14.59 10.81 53.48 71.89 14.58-10.81zM37.81 162.16h86.43v-16.21H37.81z",fill:"#f48024"})]})},label:"Stack Overflow"},linkedin:{Icon:function(e){return(0,r.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",preserveAspectRatio:"xMidYMid",viewBox:"0 0 256 256",...e,children:(0,r.jsx)("path",{d:"M218.123 218.127h-37.931v-59.403c0-14.165-.253-32.4-19.728-32.4-19.756 0-22.779 15.434-22.779 31.369v60.43h-37.93V95.967h36.413v16.694h.51a39.907 39.907 0 0 1 35.928-19.733c38.445 0 45.533 25.288 45.533 58.186l-.016 67.013ZM56.955 79.27c-12.157.002-22.014-9.852-22.016-22.009-.002-12.157 9.851-22.014 22.008-22.016 12.157-.003 22.014 9.851 22.016 22.008A22.013 22.013 0 0 1 56.955 79.27m18.966 138.858H37.95V95.967h37.97v122.16ZM237.033.018H18.89C8.58-.098.125 8.161-.001 18.471v219.053c.122 10.315 8.576 18.582 18.89 18.474h218.144c10.336.128 18.823-8.139 18.966-18.474V18.454c-.147-10.33-8.635-18.588-18.966-18.453",fill:"#0A66C2"})})},label:"LinkedIn"},x:{Icon:function(e){return(0,r.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",fill:"none",viewBox:"0 0 1200 1227",style:{"--dark":"#000","--light":"#fff"},...e,className:(0,s.Z)(e.className,"xSvg_Q0g7"),children:(0,r.jsx)("path",{d:"M714.163 519.284 1160.89 0h-105.86L667.137 450.887 357.328 0H0l468.492 681.821L0 1226.37h105.866l409.625-476.152 327.181 476.152H1200L714.137 519.284h.026ZM569.165 687.828l-47.468-67.894-377.686-540.24h162.604l304.797 435.991 47.468 67.894 396.2 566.721H892.476L569.165 687.854v-.026Z"})})},label:"X"},bluesky:{Icon:function(e){return(0,r.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",preserveAspectRatio:"xMidYMid",viewBox:"0 0 256 226",...e,children:(0,r.jsx)("path",{fill:"#1185FE",d:"M55.491 15.172c29.35 22.035 60.917 66.712 72.509 90.686 11.592-23.974 43.159-68.651 72.509-90.686C221.686-.727 256-13.028 256 26.116c0 7.818-4.482 65.674-7.111 75.068-9.138 32.654-42.436 40.983-72.057 35.942 51.775 8.812 64.946 38 36.501 67.187-54.021 55.433-77.644-13.908-83.696-31.676-1.11-3.257-1.63-4.78-1.637-3.485-.008-1.296-.527.228-1.637 3.485-6.052 17.768-29.675 87.11-83.696 31.676-28.445-29.187-15.274-58.375 36.5-67.187-29.62 5.041-62.918-3.288-72.056-35.942C4.482 91.79 0 33.934 0 26.116 0-13.028 34.314-.727 55.491 15.172Z"})})},label:"Bluesky"},instagram:{Icon:function(e){return(0,r.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",preserveAspectRatio:"xMidYMid",viewBox:"0 0 256 256",style:{"--dark":"#000","--light":"#fff"},...e,className:(0,s.Z)(e.className,"instagramSvg_Svcp"),children:(0,r.jsx)("path",{d:"M128 23.064c34.177 0 38.225.13 51.722.745 12.48.57 19.258 2.655 23.769 4.408 5.974 2.322 10.238 5.096 14.717 9.575 4.48 4.479 7.253 8.743 9.575 14.717 1.753 4.511 3.838 11.289 4.408 23.768.615 13.498.745 17.546.745 51.723 0 34.178-.13 38.226-.745 51.723-.57 12.48-2.655 19.257-4.408 23.768-2.322 5.974-5.096 10.239-9.575 14.718-4.479 4.479-8.743 7.253-14.717 9.574-4.511 1.753-11.289 3.839-23.769 4.408-13.495.616-17.543.746-51.722.746-34.18 0-38.228-.13-51.723-.746-12.48-.57-19.257-2.655-23.768-4.408-5.974-2.321-10.239-5.095-14.718-9.574-4.479-4.48-7.253-8.744-9.574-14.718-1.753-4.51-3.839-11.288-4.408-23.768-.616-13.497-.746-17.545-.746-51.723 0-34.177.13-38.225.746-51.722.57-12.48 2.655-19.258 4.408-23.769 2.321-5.974 5.095-10.238 9.574-14.717 4.48-4.48 8.744-7.253 14.718-9.575 4.51-1.753 11.288-3.838 23.768-4.408 13.497-.615 17.545-.745 51.723-.745M128 0C93.237 0 88.878.147 75.226.77c-13.625.622-22.93 2.786-31.071 5.95-8.418 3.271-15.556 7.648-22.672 14.764C14.367 28.6 9.991 35.738 6.72 44.155 3.555 52.297 1.392 61.602.77 75.226.147 88.878 0 93.237 0 128c0 34.763.147 39.122.77 52.774.622 13.625 2.785 22.93 5.95 31.071 3.27 8.417 7.647 15.556 14.763 22.672 7.116 7.116 14.254 11.492 22.672 14.763 8.142 3.165 17.446 5.328 31.07 5.95 13.653.623 18.012.77 52.775.77s39.122-.147 52.774-.77c13.624-.622 22.929-2.785 31.07-5.95 8.418-3.27 15.556-7.647 22.672-14.763 7.116-7.116 11.493-14.254 14.764-22.672 3.164-8.142 5.328-17.446 5.95-31.07.623-13.653.77-18.012.77-52.775s-.147-39.122-.77-52.774c-.622-13.624-2.786-22.929-5.95-31.07-3.271-8.418-7.648-15.556-14.764-22.672C227.4 14.368 220.262 9.99 211.845 6.72c-8.142-3.164-17.447-5.328-31.071-5.95C167.122.147 162.763 0 128 0Zm0 62.27C91.698 62.27 62.27 91.7 62.27 128c0 36.302 29.428 65.73 65.73 65.73 36.301 0 65.73-29.428 65.73-65.73 0-36.301-29.429-65.73-65.73-65.73Zm0 108.397c-23.564 0-42.667-19.103-42.667-42.667S104.436 85.333 128 85.333s42.667 19.103 42.667 42.667-19.103 42.667-42.667 42.667Zm83.686-110.994c0 8.484-6.876 15.36-15.36 15.36-8.483 0-15.36-6.876-15.36-15.36 0-8.483 6.877-15.36 15.36-15.36 8.484 0 15.36 6.877 15.36 15.36Z"})})},label:"Instagram"},threads:{Icon:function(e){return(0,r.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg","aria-label":"Threads",viewBox:"0 0 192 192",width:"1em",fill:"none",height:"1em",style:{"--dark":"#000","--light":"#fff"},...e,className:(0,s.Z)(e.className,"threadsSvg_kngY"),children:(0,r.jsx)("path",{d:"M141.537 88.988a66.667 66.667 0 0 0-2.518-1.143c-1.482-27.307-16.403-42.94-41.457-43.1h-.34c-14.986 0-27.449 6.396-35.12 18.036l13.779 9.452c5.73-8.695 14.724-10.548 21.348-10.548h.229c8.249.053 14.474 2.452 18.503 7.129 2.932 3.405 4.893 8.111 5.864 14.05-7.314-1.243-15.224-1.626-23.68-1.14-23.82 1.371-39.134 15.264-38.105 34.568.522 9.792 5.4 18.216 13.735 23.719 7.047 4.652 16.124 6.927 25.557 6.412 12.458-.683 22.231-5.436 29.049-14.127 5.178-6.6 8.453-15.153 9.899-25.93 5.937 3.583 10.337 8.298 12.767 13.966 4.132 9.635 4.373 25.468-8.546 38.376-11.319 11.308-24.925 16.2-45.488 16.351-22.809-.169-40.06-7.484-51.275-21.742C35.236 139.966 29.808 120.682 29.605 96c.203-24.682 5.63-43.966 16.133-57.317C56.954 24.425 74.204 17.11 97.013 16.94c22.975.17 40.526 7.52 52.171 21.847 5.71 7.026 10.015 15.86 12.853 26.162l16.147-4.308c-3.44-12.68-8.853-23.606-16.219-32.668C147.036 9.607 125.202.195 97.07 0h-.113C68.882.194 47.292 9.642 32.788 28.08 19.882 44.485 13.224 67.315 13.001 95.932L13 96v.067c.224 28.617 6.882 51.447 19.788 67.854C47.292 182.358 68.882 191.806 96.957 192h.113c24.96-.173 42.554-6.708 57.048-21.189 18.963-18.945 18.392-42.692 12.142-57.27-4.484-10.454-13.033-18.945-24.723-24.553ZM98.44 129.507c-10.44.588-21.286-4.098-21.82-14.135-.397-7.442 5.296-15.746 22.461-16.735 1.966-.114 3.895-.169 5.79-.169 6.235 0 12.068.606 17.371 1.765-1.978 24.702-13.58 28.713-23.802 29.274Z"})})},label:"Threads"},mastodon:{Icon:function(e){let t=(0,a.useId)();return(0,r.jsxs)("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 61 65",width:"1em",height:"1em",...e,children:[(0,r.jsx)("path",{fill:`url(#${t})`,d:"M60.754 14.39C59.814 7.406 53.727 1.903 46.512.836 45.294.656 40.682 0 29.997 0h-.08C19.23 0 16.938.656 15.72.836 8.705 1.873 2.299 6.82.745 13.886c-.748 3.48-.828 7.338-.689 10.877.198 5.075.237 10.142.697 15.197a71.482 71.482 0 0 0 1.664 9.968c1.477 6.056 7.458 11.096 13.317 13.152a35.718 35.718 0 0 0 19.484 1.028 28.365 28.365 0 0 0 2.107-.576c1.572-.5 3.413-1.057 4.766-2.038a.154.154 0 0 0 .062-.118v-4.899a.146.146 0 0 0-.055-.111.145.145 0 0 0-.122-.028 54 54 0 0 1-12.644 1.478c-7.328 0-9.298-3.478-9.863-4.925a15.258 15.258 0 0 1-.857-3.882.142.142 0 0 1 .178-.145 52.976 52.976 0 0 0 12.437 1.477c1.007 0 2.012 0 3.02-.026 4.213-.119 8.654-.334 12.8-1.144.103-.02.206-.038.295-.065 6.539-1.255 12.762-5.196 13.394-15.176.024-.393.083-4.115.083-4.523.003-1.386.446-9.829-.065-15.017Z"}),(0,r.jsx)("path",{fill:"#fff",d:"M50.394 22.237v17.35H43.52V22.749c0-3.545-1.478-5.353-4.483-5.353-3.303 0-4.958 2.139-4.958 6.364v9.217h-6.835V23.76c0-4.225-1.657-6.364-4.96-6.364-2.988 0-4.48 1.808-4.48 5.353v16.84H10.93V22.237c0-3.545.905-6.362 2.715-8.45 1.868-2.082 4.317-3.152 7.358-3.152 3.519 0 6.178 1.354 7.951 4.057l1.711 2.871 1.714-2.871c1.773-2.704 4.432-4.056 7.945-4.056 3.038 0 5.487 1.069 7.36 3.152 1.81 2.085 2.712 4.902 2.71 8.449Z"}),(0,r.jsx)("defs",{children:(0,r.jsxs)("linearGradient",{id:t,x1:30.5,x2:30.5,y1:0,y2:65,gradientUnits:"userSpaceOnUse",children:[(0,r.jsx)("stop",{stopColor:"#6364FF"}),(0,r.jsx)("stop",{offset:1,stopColor:"#563ACC"})]})})]})},label:"Mastodon"},youtube:{Icon:function(e){return(0,r.jsxs)("svg",{viewBox:"0 0 256 180",width:"1em",height:"1em",xmlns:"http://www.w3.org/2000/svg",preserveAspectRatio:"xMidYMid",...e,children:[(0,r.jsx)("path",{d:"M250.346 28.075A32.18 32.18 0 0 0 227.69 5.418C207.824 0 127.87 0 127.87 0S47.912.164 28.046 5.582A32.18 32.18 0 0 0 5.39 28.24c-6.009 35.298-8.34 89.084.165 122.97a32.18 32.18 0 0 0 22.656 22.657c19.866 5.418 99.822 5.418 99.822 5.418s79.955 0 99.82-5.418a32.18 32.18 0 0 0 22.657-22.657c6.338-35.348 8.291-89.1-.164-123.134Z",fill:"red"}),(0,r.jsx)("path",{fill:"#FFF",d:"m102.421 128.06 66.328-38.418-66.328-38.418z"})]})},label:"YouTube"},twitch:{Icon:function(e){return(0,r.jsxs)("svg",{xmlns:"http://www.w3.org/2000/svg",x:0,y:0,viewBox:"0 0 2400 2800",width:"1em",height:"1em",...e,children:[(0,r.jsx)("path",{d:"m2200 1300-400 400h-400l-350 350v-350H600V200h1600z",fill:"#fff"}),(0,r.jsxs)("g",{children:[(0,r.jsx)("path",{d:"M500 0 0 500v1800h600v500l500-500h400l900-900V0H500zm1700 1300-400 400h-400l-350 350v-350H600V200h1600v1100z",fill:"#9146ff"}),(0,r.jsx)("path",{d:"M1700 550h200v600h-200zM1150 550h200v600h-200z",fill:"#9146ff"})]})]})},label:"Twitch"}};function d(e){let{platform:t,link:n}=e,{Icon:a,label:d}=c[t]??{Icon:i,label:t};return(0,r.jsx)(l.Z,{className:o,href:n,title:d,children:(0,r.jsx)(a,{className:(0,s.Z)(o)})})}function u(e){let{author:t}=e,n=Object.entries(t.socials??{});return(0,r.jsx)("div",{className:"authorSocials_tPnL",children:n.map(e=>{let[t,n]=e;return(0,r.jsx)(d,{platform:t,link:n},t)})})}var h=n(57922);let m={authorImage:"authorImage_p8ow","author-as-h1":"author-as-h1_Pd3R","author-as-h2":"author-as-h2_UaZL",authorDetails:"authorDetails_dWdF",authorName:"authorName_Y8Hr",authorTitle:"authorTitle_Slpj",authorBlogPostCount:"authorBlogPostCount_FxU_"};function g(e){return e.href?(0,r.jsx)(l.Z,{...e}):(0,r.jsx)(r.Fragment,{children:e.children})}function x(e){let{title:t}=e;return(0,r.jsx)("small",{className:m.authorTitle,title:t,children:t})}function f(e){let{name:t,as:n}=e;return n?(0,r.jsx)(h.Z,{as:n,className:m.authorName,children:t}):(0,r.jsx)("span",{className:m.authorName,children:t})}function j(e){let{count:t}=e;return(0,r.jsx)("span",{className:(0,s.Z)(m.authorBlogPostCount),children:t})}function p(e){let{as:t,author:n,className:a,count:l}=e,{name:i,title:o,url:c,imageURL:d,email:h,page:p}=n,v=p?.permalink||c||h&&`mailto:${h}`||void 0;return(0,r.jsxs)("div",{className:(0,s.Z)("avatar margin-bottom--sm",a,m[`author-as-${t}`]),children:[d&&(0,r.jsx)(g,{href:v,className:"avatar__photo-link",children:(0,r.jsx)("img",{className:(0,s.Z)("avatar__photo",m.authorImage),src:d,alt:i})}),(i||o)&&(0,r.jsxs)("div",{className:(0,s.Z)("avatar__intro",m.authorDetails),children:[(0,r.jsxs)("div",{className:"avatar__name",children:[i&&(0,r.jsx)(g,{href:v,children:(0,r.jsx)(f,{name:i,as:t})}),void 0!==l&&(0,r.jsx)(j,{count:l})]}),!!o&&(0,r.jsx)(x,{title:o}),(0,r.jsx)(u,{author:n})]})]})}},9942:function(e,t,n){n.d(t,{Z:()=>w});var r=n(85893),a=n(67294),s=n(90496),l=n(23944),i=n(28115),o=n(77827),c=n(5666),d=n(26378),u=n(57922);function h(e){let{year:t,yearGroupHeadingClassName:n,children:a}=e;return(0,r.jsxs)("div",{role:"group",children:[(0,r.jsx)(u.Z,{as:"h3",className:n,children:t}),a]})}let m=(0,a.memo)(function(e){let{items:t,yearGroupHeadingClassName:n,ListComponent:a}=e;if(!(0,d.L)().blog.sidebar.groupByYear)return(0,r.jsx)(a,{items:t});{let e=(0,c.ci)(t);return(0,r.jsx)(r.Fragment,{children:e.map(e=>{let[t,s]=e;return(0,r.jsx)(h,{year:t,yearGroupHeadingClassName:n,children:(0,r.jsx)(a,{items:s})},t)})})}}),g=e=>{let{items:t}=e;return(0,r.jsx)(c.Ne,{items:t,ulClassName:(0,s.Z)("sidebarItemList_OSkG","clean-list"),liClassName:"sidebarItem_WJ0y",linkClassName:"sidebarItemLink_Qrfg",linkActiveClassName:"sidebarItemLinkActive_nUeK"})},x=(0,a.memo)(function(e){let{sidebar:t}=e,n=(0,c.cH)(t.items);return(0,r.jsx)("aside",{className:"col col--3",children:(0,r.jsxs)("nav",{className:(0,s.Z)("sidebar_P3nc","thin-scrollbar"),"aria-label":(0,o.I)({id:"theme.blog.sidebar.navAriaLabel",message:"Blog recent posts navigation",description:"The ARIA label for recent posts in the blog sidebar"}),children:[(0,r.jsx)("div",{className:(0,s.Z)("sidebarItemTitle_VrjY","margin-bottom--md"),children:t.title}),(0,r.jsx)(m,{items:n,ListComponent:g,yearGroupHeadingClassName:"yearGroupHeading_lECJ"})]})})});var f=n(44160);let j=e=>{let{items:t}=e;return(0,r.jsx)(c.Ne,{items:t,ulClassName:"menu__list",liClassName:"menu__list-item",linkClassName:"menu__link",linkActiveClassName:"menu__link--active"})};function p(e){let{sidebar:t}=e,n=(0,c.cH)(t.items);return(0,r.jsx)(m,{items:n,ListComponent:j,yearGroupHeadingClassName:"yearGroupHeading_Ruz9"})}let v=(0,a.memo)(function(e){return(0,r.jsx)(f.Zo,{component:p,props:e})});function b(e){let{sidebar:t}=e,n=(0,i.i)();return t?.items.length?"mobile"===n?(0,r.jsx)(v,{sidebar:t}):(0,r.jsx)(x,{sidebar:t}):null}function w(e){let{sidebar:t,toc:n,children:a,...i}=e,o=t&&t.items.length>0;return(0,r.jsx)(l.Z,{...i,children:(0,r.jsx)("div",{className:"container margin-vert--lg",children:(0,r.jsxs)("div",{className:"row",children:[(0,r.jsx)(b,{sidebar:t}),(0,r.jsx)("main",{className:(0,s.Z)("col",{"col--7":o,"col--9 col--offset-1":!o}),children:a}),n&&(0,r.jsx)("div",{className:"col col--2",children:n})]})})})}},22272:function(e,t,n){n.d(t,{Z:()=>l});var r=n(85893);n(67294);var a=n(77827),s=n(65773);function l(e){let{metadata:t}=e,{previousPage:n,nextPage:l}=t;return(0,r.jsxs)("nav",{className:"pagination-nav","aria-label":(0,a.I)({id:"theme.blog.paginator.navAriaLabel",message:"Blog list page navigation",description:"The ARIA label for the blog pagination"}),children:[n&&(0,r.jsx)(s.Z,{permalink:n,title:(0,r.jsx)(a.Z,{id:"theme.blog.paginator.newerEntries",description:"The label used to navigate to the newer blog posts page (previous page)",children:"Newer entries"})}),l&&(0,r.jsx)(s.Z,{permalink:l,title:(0,r.jsx)(a.Z,{id:"theme.blog.paginator.olderEntries",description:"The label used to navigate to the older blog posts page (next page)",children:"Older entries"}),isNext:!0})]})}},76460:function(e,t,n){n.d(t,{Z:()=>a});var r=n(85893);function a(e){let{children:t,className:n}=e;return(0,r.jsx)("article",{className:n,children:t})}n(67294)},90437:function(e,t,n){n.d(t,{Z:()=>o});var r=n(85893);n(67294);var a=n(90496),s=n(59699),l=n(5666),i=n(84015);function o(e){let{children:t,className:n}=e,{isBlogPostPage:o}=(0,l.nO)();return(0,r.jsx)("div",{id:o?s.blogPostContainerID:void 0,className:(0,a.Z)("markdown",n),children:(0,r.jsx)(i.Z,{children:t})})}},54505:function(e,t,n){n.d(t,{Z:()=>h});var r=n(85893);n(67294);var a=n(90496),s=n(77827),l=n(11660),i=n(90177),o=n(5666);function c(e){let{readingTime:t}=e,n=function(){let{selectMessage:e}=(0,l.c)();return t=>{let n=Math.ceil(t);return e(n,(0,s.I)({id:"theme.blog.post.readingTime.plurals",description:'Pluralized label for "{readingTime} min read". Use as much plural forms (separated by "|") as your language support (see https://www.unicode.org/cldr/cldr-aux/charts/34/supplemental/language_plural_rules.html)',message:"One min read|{readingTime} min read"},{readingTime:n}))}}();return(0,r.jsx)(r.Fragment,{children:n(t)})}function d(e){let{date:t,formattedDate:n}=e;return(0,r.jsx)("time",{dateTime:t,children:n})}function u(){return(0,r.jsx)(r.Fragment,{children:" \xb7 "})}function h(e){let{className:t}=e,{metadata:n}=(0,o.nO)(),{date:s,readingTime:l}=n,h=(0,i.P)({day:"numeric",month:"long",year:"numeric",timeZone:"UTC"});return(0,r.jsxs)("div",{className:(0,a.Z)("container_x5Un","margin-vert--md",t),children:[(0,r.jsx)(d,{date:s,formattedDate:h.format(new Date(s))}),void 0!==l&&(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(u,{}),(0,r.jsx)(c,{readingTime:l})]})]})}},37147:function(e,t,n){n.d(t,{Z:()=>i});var r=n(85893);n(67294);var a=n(90496),s=n(35363),l=n(5666);function i(e){let{className:t}=e,{metadata:n,isBlogPostPage:i}=(0,l.nO)(),{permalink:o,title:c}=n;return(0,r.jsx)(i?"h1":"h2",{className:(0,a.Z)("title_UBNu",t),children:i?c:(0,r.jsx)(s.Z,{to:o,children:c})})}},80145:function(e,t,n){n.d(t,{Z:()=>Z});var r=n(85893);n(67294);var a=n(90496),s=n(5666),l=n(76460),i=n(37147),o=n(54505),c=n(68930);let d={authorCol:"authorCol_bvyx",imageOnlyAuthorRow:"imageOnlyAuthorRow_L2DM",imageOnlyAuthorCol:"imageOnlyAuthorCol_oyze"};function u(e){let{className:t}=e,{metadata:{authors:n},assets:l}=(0,s.nO)();if(0===n.length)return null;let i=n.every(e=>{let{name:t}=e;return!t}),o=1===n.length;return(0,r.jsx)("div",{className:(0,a.Z)("margin-top--md margin-bottom--sm",i?d.imageOnlyAuthorRow:"row",t),children:n.map((e,t)=>(0,r.jsx)("div",{className:(0,a.Z)(!i&&(o?"col col--12":"col col--6"),i?d.imageOnlyAuthorCol:d.authorCol),children:(0,r.jsx)(c.Z,{author:{...e,imageURL:l.authorsImageUrls[t]??e.imageURL}})},t))})}function h(){return(0,r.jsxs)("header",{children:[(0,r.jsx)(i.Z,{}),(0,r.jsx)(o.Z,{}),(0,r.jsx)(u,{})]})}var m=n(90437),g=n(55951),x=n(60114),f=n(47294),j=n(77827),p=n(35363);function v(){return(0,r.jsx)("b",{children:(0,r.jsx)(j.Z,{id:"theme.blog.post.readMore",description:"The label used in blog post item excerpts to link to full blog posts",children:"Read more"})})}function b(e){let{blogPostTitle:t,...n}=e;return(0,r.jsx)(p.Z,{"aria-label":(0,j.I)({message:"Read more about {title}",id:"theme.blog.post.readMoreLabel",description:"The ARIA label for the link to full blog posts from excerpts"},{title:t}),...n,children:(0,r.jsx)(v,{})})}function w(){let{metadata:e,isBlogPostPage:t}=(0,s.nO)(),{tags:n,title:l,editUrl:i,hasTruncateMarker:o,lastUpdatedBy:c,lastUpdatedAt:d}=e,u=!t&&o,h=n.length>0;if(!(h||u||i))return null;if(!t)return(0,r.jsxs)("footer",{className:"row docusaurus-mt-lg",children:[h&&(0,r.jsx)("div",{className:(0,a.Z)("col",{"col--9":u}),children:(0,r.jsx)(f.Z,{tags:n})}),u&&(0,r.jsx)("div",{className:(0,a.Z)("col text--right",{"col--3":h}),children:(0,r.jsx)(b,{blogPostTitle:l,to:e.permalink})})]});{let e=!!(i||d||c);return(0,r.jsxs)("footer",{className:"docusaurus-mt-lg",children:[h&&(0,r.jsx)("div",{className:(0,a.Z)("row","margin-top--sm",g.k.blog.blogFooterEditMetaRow),children:(0,r.jsx)("div",{className:"col",children:(0,r.jsx)(f.Z,{tags:n})})}),e&&(0,r.jsx)(x.Z,{className:(0,a.Z)("margin-top--sm",g.k.blog.blogFooterEditMetaRow),editUrl:i,lastUpdatedAt:d,lastUpdatedBy:c})]})}}function Z(e){let{children:t,className:n}=e,i=function(){let{isBlogPostPage:e}=(0,s.nO)();return e?void 0:"margin-bottom--xl"}();return(0,r.jsxs)(l.Z,{className:(0,a.Z)(i,n),children:[(0,r.jsx)(h,{}),(0,r.jsx)(m.Z,{children:t}),(0,r.jsx)(w,{})]})}},65808:function(e,t,n){n.d(t,{Z:()=>l});var r=n(85893);n(67294);var a=n(5666),s=n(80145);function l(e){let{items:t,component:n=s.Z}=e;return(0,r.jsx)(r.Fragment,{children:t.map(e=>{let{content:t}=e;return(0,r.jsx)(a.n4,{content:t,children:(0,r.jsx)(n,{children:(0,r.jsx)(t,{})})},t.metadata.permalink)})})}},2769:function(e,t,n){n.d(t,{Z:()=>h});var r=n(85893),a=n(67294),s=n(90496),l=n(96700),i=n(71607),o=n(97812);let c={details:"details_Nokh",isBrowser:"isBrowser_QrB5",collapsibleContent:"collapsibleContent_EoA1"};function d(e){return!!e&&("SUMMARY"===e.tagName||d(e.parentElement))}function u(e){let{summary:t,children:n,...u}=e;(0,l.Z)().collectAnchor(u.id);let h=(0,i.Z)(),m=(0,a.useRef)(null),{collapsed:g,setCollapsed:x}=(0,o.u)({initialState:!u.open}),[f,j]=(0,a.useState)(u.open),p=a.isValidElement(t)?t:(0,r.jsx)("summary",{children:t??"Details"});return(0,r.jsxs)("details",{...u,ref:m,open:f,"data-collapsed":g,className:(0,s.Z)(c.details,h&&c.isBrowser,u.className),onMouseDown:e=>{d(e.target)&&e.detail>1&&e.preventDefault()},onClick:e=>{e.stopPropagation();let t=e.target;d(t)&&function e(t,n){return!!t&&(t===n||e(t.parentElement,n))}(t,m.current)&&(e.preventDefault(),g?(x(!1),j(!0)):x(!0))},children:[p,(0,r.jsx)(o.z,{lazy:!1,collapsed:g,onCollapseTransitionEnd:e=>{x(e),j(!e)},children:(0,r.jsx)("div",{className:c.collapsibleContent,children:n})})]})}function h(e){let{...t}=e;return(0,r.jsx)(u,{...t,className:(0,s.Z)("alert alert--info","details_Cn_P",t.className)})}},60114:function(e,t,n){n.d(t,{Z:()=>g});var r=n(85893);n(67294);var a=n(90496),s=n(77827),l=n(55951),i=n(35363);function o(e){let{className:t,...n}=e;return(0,r.jsx)("svg",{fill:"currentColor",height:"20",width:"20",viewBox:"0 0 40 40",className:(0,a.Z)("iconEdit_IMw_",t),"aria-hidden":"true",...n,children:(0,r.jsx)("g",{children:(0,r.jsx)("path",{d:"m34.5 11.7l-3 3.1-6.3-6.3 3.1-3q0.5-0.5 1.2-0.5t1.1 0.5l3.9 3.9q0.5 0.4 0.5 1.1t-0.5 1.2z m-29.5 17.1l18.4-18.5 6.3 6.3-18.4 18.4h-6.3v-6.2z"})})})}function c(e){let{editUrl:t}=e;return(0,r.jsxs)(i.Z,{to:t,className:l.k.common.editThisPage,children:[(0,r.jsx)(o,{}),(0,r.jsx)(s.Z,{id:"theme.common.editThisPage",description:"The link label to edit the current page",children:"Edit this page"})]})}var d=n(90177);function u(e){let{lastUpdatedAt:t}=e,n=new Date(t),a=(0,d.P)({day:"numeric",month:"short",year:"numeric",timeZone:"UTC"}).format(n);return(0,r.jsx)(s.Z,{id:"theme.lastUpdated.atDate",description:"The words used to describe on which date a page has been last updated",values:{date:(0,r.jsx)("b",{children:(0,r.jsx)("time",{dateTime:n.toISOString(),itemProp:"dateModified",children:a})})},children:" on {date}"})}function h(e){let{lastUpdatedBy:t}=e;return(0,r.jsx)(s.Z,{id:"theme.lastUpdated.byUser",description:"The words used to describe by who the page has been last updated",values:{user:(0,r.jsx)("b",{children:t})},children:" by {user}"})}function m(e){let{lastUpdatedAt:t,lastUpdatedBy:n}=e;return(0,r.jsxs)("span",{className:l.k.common.lastUpdated,children:[(0,r.jsx)(s.Z,{id:"theme.lastUpdated.lastUpdatedAtBy",description:"The sentence used to display when a page has been last updated, and by who",values:{atDate:t?(0,r.jsx)(u,{lastUpdatedAt:t}):"",byUser:n?(0,r.jsx)(h,{lastUpdatedBy:n}):""},children:"Last updated{atDate}{byUser}"}),!1]})}function g(e){let{className:t,editUrl:n,lastUpdatedAt:s,lastUpdatedBy:l}=e;return(0,r.jsxs)("div",{className:(0,a.Z)("row",t),children:[(0,r.jsx)("div",{className:"col",children:n&&(0,r.jsx)(c,{editUrl:n})}),(0,r.jsx)("div",{className:(0,a.Z)("col","lastUpdated_OHCJ"),children:(s||l)&&(0,r.jsx)(m,{lastUpdatedAt:s,lastUpdatedBy:l})})]})}},84015:function(e,t,n){n.d(t,{Z:()=>B});var r=n(85893),a=n(67294),s=n(80980),l=n(53327),i=n(93278);function o(e){return(0,r.jsx)("code",{...e})}function c(e){return void 0!==e.children&&a.Children.toArray(e.children).every(e=>"string"==typeof e&&!e.includes("\n"))?(0,r.jsx)(o,{...e}):(0,r.jsx)(i.Z,{...e})}var d=n(35363),u=n(2769);function h(e){let t=a.Children.toArray(e.children),n=t.find(e=>a.isValidElement(e)&&"summary"===e.type),s=(0,r.jsx)(r.Fragment,{children:t.filter(e=>e!==n)});return(0,r.jsx)(u.Z,{...e,summary:n,children:s})}var m=n(57922);function g(e){return(0,r.jsx)(m.Z,{...e})}var x=n(90496);let f={containsTaskList:"containsTaskList_k9gM"};var j=n(96700),p=n(49356),v=n(67490),b=n(85108),w=n(26378),Z=n(45245),N=n(57396);async function y(e){let{id:t,text:n,config:r}=e;N.Z.mermaidAPI.initialize(r);try{return await N.Z.render(t,n)}catch(e){throw document.querySelector(`#d${t}`)?.remove(),e}}function k(e){let{renderResult:t}=e,n=(0,a.useRef)(null);return(0,a.useEffect)(()=>{let e=n.current;t.bindFunctions?.(e)},[t]),(0,r.jsx)("div",{ref:n,className:"docusaurus-mermaid-container container_RUsj",dangerouslySetInnerHTML:{__html:t.svg}})}function C(e){let{value:t}=e,n=function(e){let{text:t,config:n}=e,[r,s]=(0,a.useState)(null),l=(0,a.useState)(`mermaid-svg-${Math.round(1e7*Math.random())}`)[0],i=function(){let{colorMode:e}=(0,Z.I)(),t=(0,w.L)().mermaid,n=t.theme[e],{options:r}=t;return(0,a.useMemo)(()=>({startOnLoad:!1,...r,theme:n}),[n,r])}(),o=n??i;return(0,a.useEffect)(()=>{y({id:l,text:t,config:o}).then(s).catch(e=>{s(()=>{throw e})})},[l,t,o]),r}({text:t});return null===n?null:(0,r.jsx)(k,{renderResult:n})}let _={...{Head:l.Z,details:h,Details:h,code:c,a:function(e){return(0,r.jsx)(d.Z,{...e})},pre:function(e){return(0,r.jsx)(r.Fragment,{children:e.children})},ul:function(e){return(0,r.jsx)("ul",{...e,className:function(e){if(void 0!==e)return(0,x.Z)(e,e?.includes("contains-task-list")&&f.containsTaskList)}(e.className)})},li:function(e){return(0,j.Z)().collectAnchor(e.id),(0,r.jsx)("li",{...e})},img:function(e){var t;return(0,r.jsx)("img",{decoding:"async",loading:"lazy",...e,className:(t=e.className,(0,x.Z)(t,"img_vXGZ"))})},h1:e=>(0,r.jsx)(g,{as:"h1",...e}),h2:e=>(0,r.jsx)(g,{as:"h2",...e}),h3:e=>(0,r.jsx)(g,{as:"h3",...e}),h4:e=>(0,r.jsx)(g,{as:"h4",...e}),h5:e=>(0,r.jsx)(g,{as:"h5",...e}),h6:e=>(0,r.jsx)(g,{as:"h6",...e}),admonition:p.Z,mermaid:function(e){return(0,r.jsx)(v.Z,{fallback:e=>(0,r.jsx)(b.Ac,{...e}),children:(0,r.jsx)(C,{...e})})}},Code:c,Highlight:function(e){let{children:t,color:n}=e;return(0,r.jsx)("span",{style:{backgroundColor:n,borderRadius:"2px",color:"#fff",padding:"0.2rem"},children:t})},TweetQuote:function(e){let{url:t,handle:n,name:a,job:s,children:l}=e,i=`https://unavatar.io/x/${n}`,o=`https://x.com/${n}`;return(0,r.jsxs)("figure",{className:"tweetQuote_h8Rz",children:[(0,r.jsx)("blockquote",{children:(0,r.jsx)(d.Z,{to:t,children:l})}),(0,r.jsx)("figcaption",{children:(0,r.jsx)(d.Z,{to:o,rel:"nofollow",children:(0,r.jsxs)("div",{className:"avatar",children:[(0,r.jsx)("img",{alt:a,className:(0,x.Z)("avatar__photo","avatarImg_b51M"),src:i}),(0,r.jsxs)("div",{className:(0,x.Z)("avatar__intro"),children:[(0,r.jsx)("strong",{className:"avatar__name",children:(0,r.jsx)("cite",{children:a})}),(0,r.jsx)("small",{className:"avatar__subtitle",itemProp:"description",children:s})]})]})})})]})}};function B(e){let{children:t}=e;return(0,r.jsx)(s.Z,{components:_,children:t})}},65773:function(e,t,n){n.d(t,{Z:()=>l});var r=n(85893);n(67294);var a=n(90496),s=n(35363);function l(e){let{permalink:t,title:n,subLabel:l,isNext:i}=e;return(0,r.jsxs)(s.Z,{className:(0,a.Z)("pagination-nav__link",i?"pagination-nav__link--next":"pagination-nav__link--prev"),to:t,children:[l&&(0,r.jsx)("div",{className:"pagination-nav__sublabel",children:l}),(0,r.jsx)("div",{className:"pagination-nav__label",children:n})]})}},63479:function(e,t,n){n.d(t,{Z:()=>i});var r=n(85893);n(67294);var a=n(90496),s=n(35363);let l={tag:"tag_Nd8t",tagRegular:"tagRegular_TiLs",tagWithCount:"tagWithCount_AQg7"};function i(e){let{permalink:t,label:n,count:i,description:o}=e;return(0,r.jsxs)(s.Z,{href:t,title:o,className:(0,a.Z)(l.tag,i?l.tagWithCount:l.tagRegular),children:[n,i&&(0,r.jsx)("span",{children:i})]})}},47294:function(e,t,n){n.d(t,{Z:()=>i});var r=n(85893);n(67294);var a=n(90496),s=n(77827),l=n(63479);function i(e){let{tags:t}=e;return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)("b",{children:(0,r.jsx)(s.Z,{id:"theme.tags.tagsListLabel",description:"The label alongside a tag list",children:"Tags:"})}),(0,r.jsx)("ul",{className:(0,a.Z)("tags_rTaS","padding--none","margin-left--sm"),children:t.map(e=>(0,r.jsx)("li",{className:"tag_l5va",children:(0,r.jsx)(l.Z,{...e})},e.permalink))})]})}},90177:function(e,t,n){n.d(t,{P:()=>a});var r=n(8156);function a(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},{i18n:{currentLocale:t}}=(0,r.Z)(),n=function(){let{i18n:{currentLocale:e,localeConfigs:t}}=(0,r.Z)();return t[e].calendar}();return new Intl.DateTimeFormat(t,{calendar:n,...e})}},11660:function(e,t,n){n.d(t,{c:()=>o});var r=n(67294),a=n(8156);let s=["zero","one","two","few","many","other"];function l(e){return s.filter(t=>e.includes(t))}let i={locale:"en",pluralForms:l(["one","other"]),select:e=>1===e?"one":"other"};function o(){let e=function(){let{i18n:{currentLocale:e}}=(0,a.Z)();return(0,r.useMemo)(()=>{try{let t=new Intl.PluralRules(e);return{locale:e,pluralForms:l(t.resolvedOptions().pluralCategories),select:e=>t.select(e)}}catch(t){return console.error(`Failed to use Intl.PluralRules for locale "${e}". +"use strict";(self.webpackChunkwebsite=self.webpackChunkwebsite||[]).push([["96766"],{5666:function(e,t,n){n.d(t,{CS:()=>f,iZ:()=>j,ci:()=>y,Ne:()=>k,cH:()=>N,nO:()=>d,wj:()=>i,n4:()=>c});var r=n(85893),a=n(67294),s=n(50923),l=n(3564);function i(){let e=(0,l.Z)(),t=e?.data?.blogMetadata;if(!t)throw Error("useBlogMetadata() can't be called on the current route because the blog metadata could not be found in route context");return t}let o=a.createContext(null);function c(e){let{children:t,content:n,isBlogPostPage:s=!1}=e,l=function(e){let{content:t,isBlogPostPage:n}=e;return(0,a.useMemo)(()=>({metadata:t.metadata,frontMatter:t.frontMatter,assets:t.assets,toc:t.toc,isBlogPostPage:n}),[t,n])}({content:n,isBlogPostPage:s});return(0,r.jsx)(o.Provider,{value:l,children:t})}function d(){let e=(0,a.useContext)(o);if(null===e)throw new s.i6("BlogPostProvider");return e}var u=n(83631),h=n(8156);let m=e=>new Date(e).toISOString();function g(e){let t=e.map(p);return{author:1===t.length?t[0]:t}}function x(e,t,n){return e?{image:function(e){let{imageUrl:t,caption:n}=e;return{"@type":"ImageObject","@id":t,url:t,contentUrl:t,caption:n}}({imageUrl:t(e,{absolute:!0}),caption:`title image for the blog post: ${n}`})}:{}}function f(e){let{siteConfig:t}=(0,h.Z)(),{withBaseUrl:n}=(0,u.Cg)(),{metadata:{blogDescription:r,blogTitle:a,permalink:s}}=e,l=`${t.url}${s}`;return{"@context":"https://schema.org","@type":"Blog","@id":l,mainEntityOfPage:l,headline:a,description:r,blogPost:e.items.map(e=>(function(e,t,n){let{assets:r,frontMatter:a,metadata:s}=e,{date:l,title:i,description:o,lastUpdatedAt:c}=s,d=r.image??a.image,u=a.keywords??[],h=`${t.url}${s.permalink}`,f=c?m(c):void 0;return{"@type":"BlogPosting","@id":h,mainEntityOfPage:h,url:h,headline:i,name:i,description:o,datePublished:l,...f?{dateModified:f}:{},...g(s.authors),...x(d,n,i),...u?{keywords:u}:{}}})(e.content,t,n))}}function j(){let e=i(),{assets:t,metadata:n}=d(),{siteConfig:r}=(0,h.Z)(),{withBaseUrl:a}=(0,u.Cg)(),{date:s,title:l,description:o,frontMatter:c,lastUpdatedAt:f}=n,j=t.image??c.image,p=c.keywords??[],v=f?m(f):void 0,b=`${r.url}${n.permalink}`;return{"@context":"https://schema.org","@type":"BlogPosting","@id":b,mainEntityOfPage:b,url:b,headline:l,name:l,description:o,datePublished:s,...v?{dateModified:v}:{},...g(n.authors),...x(j,a,l),...p?{keywords:p}:{},isPartOf:{"@type":"Blog","@id":`${r.url}${e.blogBasePath}`,name:e.blogTitle}}}function p(e){return{"@type":"Person",...e.name?{name:e.name}:{},...e.title?{description:e.title}:{},...e.url?{url:e.url}:{},...e.email?{email:e.email}:{},...e.imageURL?{image:e.imageURL}:{}}}var v=n(3620),b=n(35363),w=n(32263),Z=n(71208);function N(e){let{pathname:t}=(0,v.TH)();return(0,a.useMemo)(()=>e.filter(e=>!e.unlisted||!!(0,Z.Mg)(e.permalink,t)),[e,t])}function y(e){let t=Object.entries((0,w.vM)(e,e=>`${new Date(e.date).getFullYear()}`));return t.reverse(),t}function k(e){let{items:t,ulClassName:n,liClassName:a,linkClassName:s,linkActiveClassName:l}=e;return(0,r.jsx)("ul",{className:n,children:t.map(e=>(0,r.jsx)("li",{className:a,children:(0,r.jsx)(b.Z,{isNavLink:!0,to:e.permalink,className:s,activeClassName:l,children:e.title})},e.permalink))})}},37796:function(e,t,n){n.d(t,{Z:()=>a});var r=n(85893);function a(e){return(0,r.jsx)("svg",{viewBox:"0 0 14 16",...e,children:(0,r.jsx)("path",{fillRule:"evenodd",d:"M7 2.3c3.14 0 5.7 2.56 5.7 5.7s-2.56 5.7-5.7 5.7A5.71 5.71 0 0 1 1.3 8c0-3.14 2.56-5.7 5.7-5.7zM7 1C3.14 1 0 4.14 0 8s3.14 7 7 7 7-3.14 7-7-3.14-7-7-7zm1 3H6v5h2V4zm0 6H6v2h2v-2z"})})}n(67294)},49356:function(e,t,n){n.d(t,{Z:()=>C});var r=n(85893),a=n(67294),s=n(90496),l=n(77827),i=n(55951);let o={admonition:"admonition_o5H7",admonitionHeading:"admonitionHeading_FzoX",admonitionIcon:"admonitionIcon_rXq6",admonitionContent:"admonitionContent_Knsx"};function c(e){let{type:t,className:n,children:a}=e;return(0,r.jsx)("div",{className:(0,s.Z)(i.k.common.admonition,i.k.common.admonitionType(t),o.admonition,n),children:a})}function d(e){let{icon:t,title:n}=e;return(0,r.jsxs)("div",{className:o.admonitionHeading,children:[(0,r.jsx)("span",{className:o.admonitionIcon,children:t}),n]})}function u(e){let{children:t}=e;return t?(0,r.jsx)("div",{className:o.admonitionContent,children:t}):null}function h(e){let{type:t,icon:n,title:a,children:s,className:l}=e;return(0,r.jsxs)(c,{type:t,className:l,children:[a||n?(0,r.jsx)(d,{title:a,icon:n}):null,(0,r.jsx)(u,{children:s})]})}let m={icon:(0,r.jsx)(function(e){return(0,r.jsx)("svg",{viewBox:"0 0 14 16",...e,children:(0,r.jsx)("path",{fillRule:"evenodd",d:"M6.3 5.69a.942.942 0 0 1-.28-.7c0-.28.09-.52.28-.7.19-.18.42-.28.7-.28.28 0 .52.09.7.28.18.19.28.42.28.7 0 .28-.09.52-.28.7a1 1 0 0 1-.7.3c-.28 0-.52-.11-.7-.3zM8 7.99c-.02-.25-.11-.48-.31-.69-.2-.19-.42-.3-.69-.31H6c-.27.02-.48.13-.69.31-.2.2-.3.44-.31.69h1v3c.02.27.11.5.31.69.2.2.42.31.69.31h1c.27 0 .48-.11.69-.31.2-.19.3-.42.31-.69H8V7.98v.01zM7 2.3c-3.14 0-5.7 2.54-5.7 5.68 0 3.14 2.56 5.7 5.7 5.7s5.7-2.55 5.7-5.7c0-3.15-2.56-5.69-5.7-5.69v.01zM7 .98c3.86 0 7 3.14 7 7s-3.14 7-7 7-7-3.12-7-7 3.14-7 7-7z"})})},{}),title:(0,r.jsx)(l.Z,{id:"theme.admonition.note",description:"The default label used for the Note admonition (:::note)",children:"note"})};function g(e){return(0,r.jsx)(h,{...m,...e,className:(0,s.Z)("alert alert--secondary",e.className),children:e.children})}let x={icon:(0,r.jsx)(function(e){return(0,r.jsx)("svg",{viewBox:"0 0 12 16",...e,children:(0,r.jsx)("path",{fillRule:"evenodd",d:"M6.5 0C3.48 0 1 2.19 1 5c0 .92.55 2.25 1 3 1.34 2.25 1.78 2.78 2 4v1h5v-1c.22-1.22.66-1.75 2-4 .45-.75 1-2.08 1-3 0-2.81-2.48-5-5.5-5zm3.64 7.48c-.25.44-.47.8-.67 1.11-.86 1.41-1.25 2.06-1.45 3.23-.02.05-.02.11-.02.17H5c0-.06 0-.13-.02-.17-.2-1.17-.59-1.83-1.45-3.23-.2-.31-.42-.67-.67-1.11C2.44 6.78 2 5.65 2 5c0-2.2 2.02-4 4.5-4 1.22 0 2.36.42 3.22 1.19C10.55 2.94 11 3.94 11 5c0 .66-.44 1.78-.86 2.48zM4 14h5c-.23 1.14-1.3 2-2.5 2s-2.27-.86-2.5-2z"})})},{}),title:(0,r.jsx)(l.Z,{id:"theme.admonition.tip",description:"The default label used for the Tip admonition (:::tip)",children:"tip"})};function f(e){return(0,r.jsx)(h,{...x,...e,className:(0,s.Z)("alert alert--success",e.className),children:e.children})}var j=n(37796);let p={icon:(0,r.jsx)(j.Z,{}),title:(0,r.jsx)(l.Z,{id:"theme.admonition.info",description:"The default label used for the Info admonition (:::info)",children:"info"})};function v(e){return(0,r.jsx)(h,{...p,...e,className:(0,s.Z)("alert alert--info",e.className),children:e.children})}function b(e){return(0,r.jsx)("svg",{viewBox:"0 0 16 16",...e,children:(0,r.jsx)("path",{fillRule:"evenodd",d:"M8.893 1.5c-.183-.31-.52-.5-.887-.5s-.703.19-.886.5L.138 13.499a.98.98 0 0 0 0 1.001c.193.31.53.501.886.501h13.964c.367 0 .704-.19.877-.5a1.03 1.03 0 0 0 .01-1.002L8.893 1.5zm.133 11.497H6.987v-2.003h2.039v2.003zm0-3.004H6.987V5.987h2.039v4.006z"})})}let w={icon:(0,r.jsx)(b,{}),title:(0,r.jsx)(l.Z,{id:"theme.admonition.warning",description:"The default label used for the Warning admonition (:::warning)",children:"warning"})},Z={icon:(0,r.jsx)(function(e){return(0,r.jsx)("svg",{viewBox:"0 0 12 16",...e,children:(0,r.jsx)("path",{fillRule:"evenodd",d:"M5.05.31c.81 2.17.41 3.38-.52 4.31C3.55 5.67 1.98 6.45.9 7.98c-1.45 2.05-1.7 6.53 3.53 7.7-2.2-1.16-2.67-4.52-.3-6.61-.61 2.03.53 3.33 1.94 2.86 1.39-.47 2.3.53 2.27 1.67-.02.78-.31 1.44-1.13 1.81 3.42-.59 4.78-3.42 4.78-5.56 0-2.84-2.53-3.22-1.25-5.61-1.52.13-2.03 1.13-1.89 2.75.09 1.08-1.02 1.8-1.86 1.33-.67-.41-.66-1.19-.06-1.78C8.18 5.31 8.68 2.45 5.05.32L5.03.3l.02.01z"})})},{}),title:(0,r.jsx)(l.Z,{id:"theme.admonition.danger",description:"The default label used for the Danger admonition (:::danger)",children:"danger"})},N={icon:(0,r.jsx)(b,{}),title:(0,r.jsx)(l.Z,{id:"theme.admonition.caution",description:"The default label used for the Caution admonition (:::caution)",children:"caution"})};var y=n(57922);let k={note:g,tip:f,info:v,warning:function(e){return(0,r.jsx)(h,{...w,...e,className:(0,s.Z)("alert alert--warning",e.className),children:e.children})},danger:function(e){return(0,r.jsx)(h,{...Z,...e,className:(0,s.Z)("alert alert--danger",e.className),children:e.children})},secondary:e=>(0,r.jsx)(g,{title:"secondary",...e}),important:e=>(0,r.jsx)(v,{title:"important",...e}),success:e=>(0,r.jsx)(f,{title:"success",...e}),caution:function(e){return(0,r.jsx)(h,{...N,...e,className:(0,s.Z)("alert alert--warning",e.className),children:e.children})},"my-custom-admonition":function(e){return(0,r.jsxs)("div",{style:{border:"solid red",padding:10},children:[(0,r.jsx)(y.Z,{as:"h5",style:{color:"blue",fontSize:30},children:e.title}),(0,r.jsx)("div",{children:e.children})]})}};function C(e){let t=function(e){let{mdxAdmonitionTitle:t,rest:n}=function(e){let t=a.Children.toArray(e),n=t.find(e=>a.isValidElement(e)&&"mdxAdmonitionTitle"===e.type),s=t.filter(e=>e!==n);return{mdxAdmonitionTitle:n?.props.children,rest:s.length>0?(0,r.jsx)(r.Fragment,{children:s}):null}}(e.children),s=e.title??t;return{...e,...s&&{title:s},children:n}}(e),n=function(e){let t=k[e];return t||(console.warn(`No admonition component found for admonition type "${e}". Using Info as fallback.`),k.info)}(t.type);return(0,r.jsx)(n,{...t})}},68930:function(e,t,n){n.d(t,{Z:()=>p});var r=n(85893),a=n(67294),s=n(90496),l=n(35363);let i=function(e){return(0,r.jsxs)("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",...e,children:[(0,r.jsx)("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),(0,r.jsx)("path",{d:"M3 12a9 9 0 1 0 18 0a9 9 0 0 0 -18 0"}),(0,r.jsx)("path",{d:"M3.6 9h16.8"}),(0,r.jsx)("path",{d:"M3.6 15h16.8"}),(0,r.jsx)("path",{d:"M11.5 3a17 17 0 0 0 0 18"}),(0,r.jsx)("path",{d:"M12.5 3a17 17 0 0 1 0 18"})]})},o="authorSocialLink_hEWM",c={twitter:{Icon:function(e){return(0,r.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 256 209",width:"1em",height:"1em",preserveAspectRatio:"xMidYMid",...e,children:(0,r.jsx)("path",{d:"M256 25.45c-9.42 4.177-19.542 7-30.166 8.27 10.845-6.5 19.172-16.793 23.093-29.057a105.183 105.183 0 0 1-33.351 12.745C205.995 7.201 192.346.822 177.239.822c-29.006 0-52.523 23.516-52.523 52.52 0 4.117.465 8.125 1.36 11.97-43.65-2.191-82.35-23.1-108.255-54.876-4.52 7.757-7.11 16.78-7.11 26.404 0 18.222 9.273 34.297 23.365 43.716a52.312 52.312 0 0 1-23.79-6.57c-.003.22-.003.44-.003.661 0 25.447 18.104 46.675 42.13 51.5a52.592 52.592 0 0 1-23.718.9c6.683 20.866 26.08 36.05 49.062 36.475-17.975 14.086-40.622 22.483-65.228 22.483-4.24 0-8.42-.249-12.529-.734 23.243 14.902 50.85 23.597 80.51 23.597 96.607 0 149.434-80.031 149.434-149.435 0-2.278-.05-4.543-.152-6.795A106.748 106.748 0 0 0 256 25.45",fill:"#55acee"})})},label:"Twitter"},github:{Icon:function(e){return(0,r.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 256 250",preserveAspectRatio:"xMidYMid",style:{"--dark":"#000","--light":"#fff"},...e,className:(0,s.Z)(e.className,"githubSvg_jqE4"),children:(0,r.jsx)("path",{d:"M128.001 0C57.317 0 0 57.307 0 128.001c0 56.554 36.676 104.535 87.535 121.46 6.397 1.185 8.746-2.777 8.746-6.158 0-3.052-.12-13.135-.174-23.83-35.61 7.742-43.124-15.103-43.124-15.103-5.823-14.795-14.213-18.73-14.213-18.73-11.613-7.944.876-7.78.876-7.78 12.853.902 19.621 13.19 19.621 13.19 11.417 19.568 29.945 13.911 37.249 10.64 1.149-8.272 4.466-13.92 8.127-17.116-28.431-3.236-58.318-14.212-58.318-63.258 0-13.975 5-25.394 13.188-34.358-1.329-3.224-5.71-16.242 1.24-33.874 0 0 10.749-3.44 35.21 13.121 10.21-2.836 21.16-4.258 32.038-4.307 10.878.049 21.837 1.47 32.066 4.307 24.431-16.56 35.165-13.12 35.165-13.12 6.967 17.63 2.584 30.65 1.255 33.873 8.207 8.964 13.173 20.383 13.173 34.358 0 49.163-29.944 59.988-58.447 63.157 4.591 3.972 8.682 11.762 8.682 23.704 0 17.126-.148 30.91-.148 35.126 0 3.407 2.304 7.398 8.792 6.14C219.37 232.5 256 184.537 256 128.002 256 57.307 198.691 0 128.001 0Zm-80.06 182.34c-.282.636-1.283.827-2.194.39-.929-.417-1.45-1.284-1.15-1.922.276-.655 1.279-.838 2.205-.399.93.418 1.46 1.293 1.139 1.931Zm6.296 5.618c-.61.566-1.804.303-2.614-.591-.837-.892-.994-2.086-.375-2.66.63-.566 1.787-.301 2.626.591.838.903 1 2.088.363 2.66Zm4.32 7.188c-.785.545-2.067.034-2.86-1.104-.784-1.138-.784-2.503.017-3.05.795-.547 2.058-.055 2.861 1.075.782 1.157.782 2.522-.019 3.08Zm7.304 8.325c-.701.774-2.196.566-3.29-.49-1.119-1.032-1.43-2.496-.726-3.27.71-.776 2.213-.558 3.315.49 1.11 1.03 1.45 2.505.701 3.27Zm9.442 2.81c-.31 1.003-1.75 1.459-3.199 1.033-1.448-.439-2.395-1.613-2.103-2.626.301-1.01 1.747-1.484 3.207-1.028 1.446.436 2.396 1.602 2.095 2.622Zm10.744 1.193c.036 1.055-1.193 1.93-2.715 1.95-1.53.034-2.769-.82-2.786-1.86 0-1.065 1.202-1.932 2.733-1.958 1.522-.03 2.768.818 2.768 1.868Zm10.555-.405c.182 1.03-.875 2.088-2.387 2.37-1.485.271-2.861-.365-3.05-1.386-.184-1.056.893-2.114 2.376-2.387 1.514-.263 2.868.356 3.061 1.403Z"})})},label:"GitHub"},stackoverflow:{Icon:function(e){return(0,r.jsxs)("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 169.61 200",width:"1em",height:"1em",...e,children:[(0,r.jsx)("path",{d:"M140.44 178.38v-48.65h21.61V200H0v-70.27h21.61v48.65z",fill:"#bcbbbb"}),(0,r.jsx)("path",{d:"M124.24 140.54l4.32-16.22-86.97-17.83-3.78 17.83zM49.7 82.16L130.72 120l7.56-16.22-81.02-37.83zm22.68-40l68.06 57.3 11.35-13.51-68.6-57.3-11.35 13.51zM116.14 0l-14.59 10.81 53.48 71.89 14.58-10.81zM37.81 162.16h86.43v-16.21H37.81z",fill:"#f48024"})]})},label:"Stack Overflow"},linkedin:{Icon:function(e){return(0,r.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",preserveAspectRatio:"xMidYMid",viewBox:"0 0 256 256",...e,children:(0,r.jsx)("path",{d:"M218.123 218.127h-37.931v-59.403c0-14.165-.253-32.4-19.728-32.4-19.756 0-22.779 15.434-22.779 31.369v60.43h-37.93V95.967h36.413v16.694h.51a39.907 39.907 0 0 1 35.928-19.733c38.445 0 45.533 25.288 45.533 58.186l-.016 67.013ZM56.955 79.27c-12.157.002-22.014-9.852-22.016-22.009-.002-12.157 9.851-22.014 22.008-22.016 12.157-.003 22.014 9.851 22.016 22.008A22.013 22.013 0 0 1 56.955 79.27m18.966 138.858H37.95V95.967h37.97v122.16ZM237.033.018H18.89C8.58-.098.125 8.161-.001 18.471v219.053c.122 10.315 8.576 18.582 18.89 18.474h218.144c10.336.128 18.823-8.139 18.966-18.474V18.454c-.147-10.33-8.635-18.588-18.966-18.453",fill:"#0A66C2"})})},label:"LinkedIn"},x:{Icon:function(e){return(0,r.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",fill:"none",viewBox:"0 0 1200 1227",style:{"--dark":"#000","--light":"#fff"},...e,className:(0,s.Z)(e.className,"xSvg_Q0g7"),children:(0,r.jsx)("path",{d:"M714.163 519.284 1160.89 0h-105.86L667.137 450.887 357.328 0H0l468.492 681.821L0 1226.37h105.866l409.625-476.152 327.181 476.152H1200L714.137 519.284h.026ZM569.165 687.828l-47.468-67.894-377.686-540.24h162.604l304.797 435.991 47.468 67.894 396.2 566.721H892.476L569.165 687.854v-.026Z"})})},label:"X"},bluesky:{Icon:function(e){return(0,r.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",preserveAspectRatio:"xMidYMid",viewBox:"0 0 256 226",...e,children:(0,r.jsx)("path",{fill:"#1185FE",d:"M55.491 15.172c29.35 22.035 60.917 66.712 72.509 90.686 11.592-23.974 43.159-68.651 72.509-90.686C221.686-.727 256-13.028 256 26.116c0 7.818-4.482 65.674-7.111 75.068-9.138 32.654-42.436 40.983-72.057 35.942 51.775 8.812 64.946 38 36.501 67.187-54.021 55.433-77.644-13.908-83.696-31.676-1.11-3.257-1.63-4.78-1.637-3.485-.008-1.296-.527.228-1.637 3.485-6.052 17.768-29.675 87.11-83.696 31.676-28.445-29.187-15.274-58.375 36.5-67.187-29.62 5.041-62.918-3.288-72.056-35.942C4.482 91.79 0 33.934 0 26.116 0-13.028 34.314-.727 55.491 15.172Z"})})},label:"Bluesky"},instagram:{Icon:function(e){return(0,r.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",preserveAspectRatio:"xMidYMid",viewBox:"0 0 256 256",style:{"--dark":"#000","--light":"#fff"},...e,className:(0,s.Z)(e.className,"instagramSvg_Svcp"),children:(0,r.jsx)("path",{d:"M128 23.064c34.177 0 38.225.13 51.722.745 12.48.57 19.258 2.655 23.769 4.408 5.974 2.322 10.238 5.096 14.717 9.575 4.48 4.479 7.253 8.743 9.575 14.717 1.753 4.511 3.838 11.289 4.408 23.768.615 13.498.745 17.546.745 51.723 0 34.178-.13 38.226-.745 51.723-.57 12.48-2.655 19.257-4.408 23.768-2.322 5.974-5.096 10.239-9.575 14.718-4.479 4.479-8.743 7.253-14.717 9.574-4.511 1.753-11.289 3.839-23.769 4.408-13.495.616-17.543.746-51.722.746-34.18 0-38.228-.13-51.723-.746-12.48-.57-19.257-2.655-23.768-4.408-5.974-2.321-10.239-5.095-14.718-9.574-4.479-4.48-7.253-8.744-9.574-14.718-1.753-4.51-3.839-11.288-4.408-23.768-.616-13.497-.746-17.545-.746-51.723 0-34.177.13-38.225.746-51.722.57-12.48 2.655-19.258 4.408-23.769 2.321-5.974 5.095-10.238 9.574-14.717 4.48-4.48 8.744-7.253 14.718-9.575 4.51-1.753 11.288-3.838 23.768-4.408 13.497-.615 17.545-.745 51.723-.745M128 0C93.237 0 88.878.147 75.226.77c-13.625.622-22.93 2.786-31.071 5.95-8.418 3.271-15.556 7.648-22.672 14.764C14.367 28.6 9.991 35.738 6.72 44.155 3.555 52.297 1.392 61.602.77 75.226.147 88.878 0 93.237 0 128c0 34.763.147 39.122.77 52.774.622 13.625 2.785 22.93 5.95 31.071 3.27 8.417 7.647 15.556 14.763 22.672 7.116 7.116 14.254 11.492 22.672 14.763 8.142 3.165 17.446 5.328 31.07 5.95 13.653.623 18.012.77 52.775.77s39.122-.147 52.774-.77c13.624-.622 22.929-2.785 31.07-5.95 8.418-3.27 15.556-7.647 22.672-14.763 7.116-7.116 11.493-14.254 14.764-22.672 3.164-8.142 5.328-17.446 5.95-31.07.623-13.653.77-18.012.77-52.775s-.147-39.122-.77-52.774c-.622-13.624-2.786-22.929-5.95-31.07-3.271-8.418-7.648-15.556-14.764-22.672C227.4 14.368 220.262 9.99 211.845 6.72c-8.142-3.164-17.447-5.328-31.071-5.95C167.122.147 162.763 0 128 0Zm0 62.27C91.698 62.27 62.27 91.7 62.27 128c0 36.302 29.428 65.73 65.73 65.73 36.301 0 65.73-29.428 65.73-65.73 0-36.301-29.429-65.73-65.73-65.73Zm0 108.397c-23.564 0-42.667-19.103-42.667-42.667S104.436 85.333 128 85.333s42.667 19.103 42.667 42.667-19.103 42.667-42.667 42.667Zm83.686-110.994c0 8.484-6.876 15.36-15.36 15.36-8.483 0-15.36-6.876-15.36-15.36 0-8.483 6.877-15.36 15.36-15.36 8.484 0 15.36 6.877 15.36 15.36Z"})})},label:"Instagram"},threads:{Icon:function(e){return(0,r.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg","aria-label":"Threads",viewBox:"0 0 192 192",width:"1em",fill:"none",height:"1em",style:{"--dark":"#000","--light":"#fff"},...e,className:(0,s.Z)(e.className,"threadsSvg_kngY"),children:(0,r.jsx)("path",{d:"M141.537 88.988a66.667 66.667 0 0 0-2.518-1.143c-1.482-27.307-16.403-42.94-41.457-43.1h-.34c-14.986 0-27.449 6.396-35.12 18.036l13.779 9.452c5.73-8.695 14.724-10.548 21.348-10.548h.229c8.249.053 14.474 2.452 18.503 7.129 2.932 3.405 4.893 8.111 5.864 14.05-7.314-1.243-15.224-1.626-23.68-1.14-23.82 1.371-39.134 15.264-38.105 34.568.522 9.792 5.4 18.216 13.735 23.719 7.047 4.652 16.124 6.927 25.557 6.412 12.458-.683 22.231-5.436 29.049-14.127 5.178-6.6 8.453-15.153 9.899-25.93 5.937 3.583 10.337 8.298 12.767 13.966 4.132 9.635 4.373 25.468-8.546 38.376-11.319 11.308-24.925 16.2-45.488 16.351-22.809-.169-40.06-7.484-51.275-21.742C35.236 139.966 29.808 120.682 29.605 96c.203-24.682 5.63-43.966 16.133-57.317C56.954 24.425 74.204 17.11 97.013 16.94c22.975.17 40.526 7.52 52.171 21.847 5.71 7.026 10.015 15.86 12.853 26.162l16.147-4.308c-3.44-12.68-8.853-23.606-16.219-32.668C147.036 9.607 125.202.195 97.07 0h-.113C68.882.194 47.292 9.642 32.788 28.08 19.882 44.485 13.224 67.315 13.001 95.932L13 96v.067c.224 28.617 6.882 51.447 19.788 67.854C47.292 182.358 68.882 191.806 96.957 192h.113c24.96-.173 42.554-6.708 57.048-21.189 18.963-18.945 18.392-42.692 12.142-57.27-4.484-10.454-13.033-18.945-24.723-24.553ZM98.44 129.507c-10.44.588-21.286-4.098-21.82-14.135-.397-7.442 5.296-15.746 22.461-16.735 1.966-.114 3.895-.169 5.79-.169 6.235 0 12.068.606 17.371 1.765-1.978 24.702-13.58 28.713-23.802 29.274Z"})})},label:"Threads"},mastodon:{Icon:function(e){let t=(0,a.useId)();return(0,r.jsxs)("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 61 65",width:"1em",height:"1em",...e,children:[(0,r.jsx)("path",{fill:`url(#${t})`,d:"M60.754 14.39C59.814 7.406 53.727 1.903 46.512.836 45.294.656 40.682 0 29.997 0h-.08C19.23 0 16.938.656 15.72.836 8.705 1.873 2.299 6.82.745 13.886c-.748 3.48-.828 7.338-.689 10.877.198 5.075.237 10.142.697 15.197a71.482 71.482 0 0 0 1.664 9.968c1.477 6.056 7.458 11.096 13.317 13.152a35.718 35.718 0 0 0 19.484 1.028 28.365 28.365 0 0 0 2.107-.576c1.572-.5 3.413-1.057 4.766-2.038a.154.154 0 0 0 .062-.118v-4.899a.146.146 0 0 0-.055-.111.145.145 0 0 0-.122-.028 54 54 0 0 1-12.644 1.478c-7.328 0-9.298-3.478-9.863-4.925a15.258 15.258 0 0 1-.857-3.882.142.142 0 0 1 .178-.145 52.976 52.976 0 0 0 12.437 1.477c1.007 0 2.012 0 3.02-.026 4.213-.119 8.654-.334 12.8-1.144.103-.02.206-.038.295-.065 6.539-1.255 12.762-5.196 13.394-15.176.024-.393.083-4.115.083-4.523.003-1.386.446-9.829-.065-15.017Z"}),(0,r.jsx)("path",{fill:"#fff",d:"M50.394 22.237v17.35H43.52V22.749c0-3.545-1.478-5.353-4.483-5.353-3.303 0-4.958 2.139-4.958 6.364v9.217h-6.835V23.76c0-4.225-1.657-6.364-4.96-6.364-2.988 0-4.48 1.808-4.48 5.353v16.84H10.93V22.237c0-3.545.905-6.362 2.715-8.45 1.868-2.082 4.317-3.152 7.358-3.152 3.519 0 6.178 1.354 7.951 4.057l1.711 2.871 1.714-2.871c1.773-2.704 4.432-4.056 7.945-4.056 3.038 0 5.487 1.069 7.36 3.152 1.81 2.085 2.712 4.902 2.71 8.449Z"}),(0,r.jsx)("defs",{children:(0,r.jsxs)("linearGradient",{id:t,x1:30.5,x2:30.5,y1:0,y2:65,gradientUnits:"userSpaceOnUse",children:[(0,r.jsx)("stop",{stopColor:"#6364FF"}),(0,r.jsx)("stop",{offset:1,stopColor:"#563ACC"})]})})]})},label:"Mastodon"},youtube:{Icon:function(e){return(0,r.jsxs)("svg",{viewBox:"0 0 256 180",width:"1em",height:"1em",xmlns:"http://www.w3.org/2000/svg",preserveAspectRatio:"xMidYMid",...e,children:[(0,r.jsx)("path",{d:"M250.346 28.075A32.18 32.18 0 0 0 227.69 5.418C207.824 0 127.87 0 127.87 0S47.912.164 28.046 5.582A32.18 32.18 0 0 0 5.39 28.24c-6.009 35.298-8.34 89.084.165 122.97a32.18 32.18 0 0 0 22.656 22.657c19.866 5.418 99.822 5.418 99.822 5.418s79.955 0 99.82-5.418a32.18 32.18 0 0 0 22.657-22.657c6.338-35.348 8.291-89.1-.164-123.134Z",fill:"red"}),(0,r.jsx)("path",{fill:"#FFF",d:"m102.421 128.06 66.328-38.418-66.328-38.418z"})]})},label:"YouTube"},twitch:{Icon:function(e){return(0,r.jsxs)("svg",{xmlns:"http://www.w3.org/2000/svg",x:0,y:0,viewBox:"0 0 2400 2800",width:"1em",height:"1em",...e,children:[(0,r.jsx)("path",{d:"m2200 1300-400 400h-400l-350 350v-350H600V200h1600z",fill:"#fff"}),(0,r.jsxs)("g",{children:[(0,r.jsx)("path",{d:"M500 0 0 500v1800h600v500l500-500h400l900-900V0H500zm1700 1300-400 400h-400l-350 350v-350H600V200h1600v1100z",fill:"#9146ff"}),(0,r.jsx)("path",{d:"M1700 550h200v600h-200zM1150 550h200v600h-200z",fill:"#9146ff"})]})]})},label:"Twitch"}};function d(e){let{platform:t,link:n}=e,{Icon:a,label:d}=c[t]??{Icon:i,label:t};return(0,r.jsx)(l.Z,{className:o,href:n,title:d,children:(0,r.jsx)(a,{className:(0,s.Z)(o)})})}function u(e){let{author:t}=e,n=Object.entries(t.socials??{});return(0,r.jsx)("div",{className:"authorSocials_tPnL",children:n.map(e=>{let[t,n]=e;return(0,r.jsx)(d,{platform:t,link:n},t)})})}var h=n(57922);let m={authorImage:"authorImage_p8ow","author-as-h1":"author-as-h1_Pd3R","author-as-h2":"author-as-h2_UaZL",authorDetails:"authorDetails_dWdF",authorName:"authorName_Y8Hr",authorTitle:"authorTitle_Slpj",authorBlogPostCount:"authorBlogPostCount_FxU_"};function g(e){return e.href?(0,r.jsx)(l.Z,{...e}):(0,r.jsx)(r.Fragment,{children:e.children})}function x(e){let{title:t}=e;return(0,r.jsx)("small",{className:m.authorTitle,title:t,children:t})}function f(e){let{name:t,as:n}=e;return n?(0,r.jsx)(h.Z,{as:n,className:m.authorName,children:t}):(0,r.jsx)("span",{className:m.authorName,children:t})}function j(e){let{count:t}=e;return(0,r.jsx)("span",{className:(0,s.Z)(m.authorBlogPostCount),children:t})}function p(e){let{as:t,author:n,className:a,count:l}=e,{name:i,title:o,url:c,imageURL:d,email:h,page:p}=n,v=p?.permalink||c||h&&`mailto:${h}`||void 0;return(0,r.jsxs)("div",{className:(0,s.Z)("avatar margin-bottom--sm",a,m[`author-as-${t}`]),children:[d&&(0,r.jsx)(g,{href:v,className:"avatar__photo-link",children:(0,r.jsx)("img",{className:(0,s.Z)("avatar__photo",m.authorImage),src:d,alt:i})}),(i||o)&&(0,r.jsxs)("div",{className:(0,s.Z)("avatar__intro",m.authorDetails),children:[(0,r.jsxs)("div",{className:"avatar__name",children:[i&&(0,r.jsx)(g,{href:v,children:(0,r.jsx)(f,{name:i,as:t})}),void 0!==l&&(0,r.jsx)(j,{count:l})]}),!!o&&(0,r.jsx)(x,{title:o}),(0,r.jsx)(u,{author:n})]})]})}},9942:function(e,t,n){n.d(t,{Z:()=>w});var r=n(85893),a=n(67294),s=n(90496),l=n(23944),i=n(28115),o=n(77827),c=n(5666),d=n(26378),u=n(57922);function h(e){let{year:t,yearGroupHeadingClassName:n,children:a}=e;return(0,r.jsxs)("div",{role:"group",children:[(0,r.jsx)(u.Z,{as:"h3",className:n,children:t}),a]})}let m=(0,a.memo)(function(e){let{items:t,yearGroupHeadingClassName:n,ListComponent:a}=e;if(!(0,d.L)().blog.sidebar.groupByYear)return(0,r.jsx)(a,{items:t});{let e=(0,c.ci)(t);return(0,r.jsx)(r.Fragment,{children:e.map(e=>{let[t,s]=e;return(0,r.jsx)(h,{year:t,yearGroupHeadingClassName:n,children:(0,r.jsx)(a,{items:s})},t)})})}}),g=e=>{let{items:t}=e;return(0,r.jsx)(c.Ne,{items:t,ulClassName:(0,s.Z)("sidebarItemList_OSkG","clean-list"),liClassName:"sidebarItem_WJ0y",linkClassName:"sidebarItemLink_Qrfg",linkActiveClassName:"sidebarItemLinkActive_nUeK"})},x=(0,a.memo)(function(e){let{sidebar:t}=e,n=(0,c.cH)(t.items);return(0,r.jsx)("aside",{className:"col col--3",children:(0,r.jsxs)("nav",{className:(0,s.Z)("sidebar_P3nc","thin-scrollbar"),"aria-label":(0,o.I)({id:"theme.blog.sidebar.navAriaLabel",message:"Blog recent posts navigation",description:"The ARIA label for recent posts in the blog sidebar"}),children:[(0,r.jsx)("div",{className:(0,s.Z)("sidebarItemTitle_VrjY","margin-bottom--md"),children:t.title}),(0,r.jsx)(m,{items:n,ListComponent:g,yearGroupHeadingClassName:"yearGroupHeading_lECJ"})]})})});var f=n(44160);let j=e=>{let{items:t}=e;return(0,r.jsx)(c.Ne,{items:t,ulClassName:"menu__list",liClassName:"menu__list-item",linkClassName:"menu__link",linkActiveClassName:"menu__link--active"})};function p(e){let{sidebar:t}=e,n=(0,c.cH)(t.items);return(0,r.jsx)(m,{items:n,ListComponent:j,yearGroupHeadingClassName:"yearGroupHeading_Ruz9"})}let v=(0,a.memo)(function(e){return(0,r.jsx)(f.Zo,{component:p,props:e})});function b(e){let{sidebar:t}=e,n=(0,i.i)();return t?.items.length?"mobile"===n?(0,r.jsx)(v,{sidebar:t}):(0,r.jsx)(x,{sidebar:t}):null}function w(e){let{sidebar:t,toc:n,children:a,...i}=e,o=t&&t.items.length>0;return(0,r.jsx)(l.Z,{...i,children:(0,r.jsx)("div",{className:"container margin-vert--lg",children:(0,r.jsxs)("div",{className:"row",children:[(0,r.jsx)(b,{sidebar:t}),(0,r.jsx)("main",{className:(0,s.Z)("col",{"col--7":o,"col--9 col--offset-1":!o}),children:a}),n&&(0,r.jsx)("div",{className:"col col--2",children:n})]})})})}},22272:function(e,t,n){n.d(t,{Z:()=>l});var r=n(85893);n(67294);var a=n(77827),s=n(65773);function l(e){let{metadata:t}=e,{previousPage:n,nextPage:l}=t;return(0,r.jsxs)("nav",{className:"pagination-nav","aria-label":(0,a.I)({id:"theme.blog.paginator.navAriaLabel",message:"Blog list page navigation",description:"The ARIA label for the blog pagination"}),children:[n&&(0,r.jsx)(s.Z,{permalink:n,title:(0,r.jsx)(a.Z,{id:"theme.blog.paginator.newerEntries",description:"The label used to navigate to the newer blog posts page (previous page)",children:"Newer entries"})}),l&&(0,r.jsx)(s.Z,{permalink:l,title:(0,r.jsx)(a.Z,{id:"theme.blog.paginator.olderEntries",description:"The label used to navigate to the older blog posts page (next page)",children:"Older entries"}),isNext:!0})]})}},76460:function(e,t,n){n.d(t,{Z:()=>a});var r=n(85893);function a(e){let{children:t,className:n}=e;return(0,r.jsx)("article",{className:n,children:t})}n(67294)},90437:function(e,t,n){n.d(t,{Z:()=>o});var r=n(85893);n(67294);var a=n(90496),s=n(59699),l=n(5666),i=n(84015);function o(e){let{children:t,className:n}=e,{isBlogPostPage:o}=(0,l.nO)();return(0,r.jsx)("div",{id:o?s.blogPostContainerID:void 0,className:(0,a.Z)("markdown",n),children:(0,r.jsx)(i.Z,{children:t})})}},54505:function(e,t,n){n.d(t,{Z:()=>h});var r=n(85893);n(67294);var a=n(90496),s=n(77827),l=n(11660),i=n(90177),o=n(5666);function c(e){let{readingTime:t}=e,n=function(){let{selectMessage:e}=(0,l.c)();return t=>{let n=Math.ceil(t);return e(n,(0,s.I)({id:"theme.blog.post.readingTime.plurals",description:'Pluralized label for "{readingTime} min read". Use as much plural forms (separated by "|") as your language support (see https://www.unicode.org/cldr/cldr-aux/charts/34/supplemental/language_plural_rules.html)',message:"One min read|{readingTime} min read"},{readingTime:n}))}}();return(0,r.jsx)(r.Fragment,{children:n(t)})}function d(e){let{date:t,formattedDate:n}=e;return(0,r.jsx)("time",{dateTime:t,children:n})}function u(){return(0,r.jsx)(r.Fragment,{children:" \xb7 "})}function h(e){let{className:t}=e,{metadata:n}=(0,o.nO)(),{date:s,readingTime:l}=n,h=(0,i.P)({day:"numeric",month:"long",year:"numeric",timeZone:"UTC"});return(0,r.jsxs)("div",{className:(0,a.Z)("container_x5Un","margin-vert--md",t),children:[(0,r.jsx)(d,{date:s,formattedDate:h.format(new Date(s))}),void 0!==l&&(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(u,{}),(0,r.jsx)(c,{readingTime:l})]})]})}},37147:function(e,t,n){n.d(t,{Z:()=>i});var r=n(85893);n(67294);var a=n(90496),s=n(35363),l=n(5666);function i(e){let{className:t}=e,{metadata:n,isBlogPostPage:i}=(0,l.nO)(),{permalink:o,title:c}=n;return(0,r.jsx)(i?"h1":"h2",{className:(0,a.Z)("title_UBNu",t),children:i?c:(0,r.jsx)(s.Z,{to:o,children:c})})}},80145:function(e,t,n){n.d(t,{Z:()=>Z});var r=n(85893);n(67294);var a=n(90496),s=n(5666),l=n(76460),i=n(37147),o=n(54505),c=n(68930);let d={authorCol:"authorCol_bvyx",imageOnlyAuthorRow:"imageOnlyAuthorRow_L2DM",imageOnlyAuthorCol:"imageOnlyAuthorCol_oyze"};function u(e){let{className:t}=e,{metadata:{authors:n},assets:l}=(0,s.nO)();if(0===n.length)return null;let i=n.every(e=>{let{name:t}=e;return!t}),o=1===n.length;return(0,r.jsx)("div",{className:(0,a.Z)("margin-top--md margin-bottom--sm",i?d.imageOnlyAuthorRow:"row",t),children:n.map((e,t)=>(0,r.jsx)("div",{className:(0,a.Z)(!i&&(o?"col col--12":"col col--6"),i?d.imageOnlyAuthorCol:d.authorCol),children:(0,r.jsx)(c.Z,{author:{...e,imageURL:l.authorsImageUrls[t]??e.imageURL}})},t))})}function h(){return(0,r.jsxs)("header",{children:[(0,r.jsx)(i.Z,{}),(0,r.jsx)(o.Z,{}),(0,r.jsx)(u,{})]})}var m=n(90437),g=n(55951),x=n(60114),f=n(47294),j=n(77827),p=n(35363);function v(){return(0,r.jsx)("b",{children:(0,r.jsx)(j.Z,{id:"theme.blog.post.readMore",description:"The label used in blog post item excerpts to link to full blog posts",children:"Read more"})})}function b(e){let{blogPostTitle:t,...n}=e;return(0,r.jsx)(p.Z,{"aria-label":(0,j.I)({message:"Read more about {title}",id:"theme.blog.post.readMoreLabel",description:"The ARIA label for the link to full blog posts from excerpts"},{title:t}),...n,children:(0,r.jsx)(v,{})})}function w(){let{metadata:e,isBlogPostPage:t}=(0,s.nO)(),{tags:n,title:l,editUrl:i,hasTruncateMarker:o,lastUpdatedBy:c,lastUpdatedAt:d}=e,u=!t&&o,h=n.length>0;if(!(h||u||i))return null;if(!t)return(0,r.jsxs)("footer",{className:"row docusaurus-mt-lg",children:[h&&(0,r.jsx)("div",{className:(0,a.Z)("col",{"col--9":u}),children:(0,r.jsx)(f.Z,{tags:n})}),u&&(0,r.jsx)("div",{className:(0,a.Z)("col text--right",{"col--3":h}),children:(0,r.jsx)(b,{blogPostTitle:l,to:e.permalink})})]});{let e=!!(i||d||c);return(0,r.jsxs)("footer",{className:"docusaurus-mt-lg",children:[h&&(0,r.jsx)("div",{className:(0,a.Z)("row","margin-top--sm",g.k.blog.blogFooterEditMetaRow),children:(0,r.jsx)("div",{className:"col",children:(0,r.jsx)(f.Z,{tags:n})})}),e&&(0,r.jsx)(x.Z,{className:(0,a.Z)("margin-top--sm",g.k.blog.blogFooterEditMetaRow),editUrl:i,lastUpdatedAt:d,lastUpdatedBy:c})]})}}function Z(e){let{children:t,className:n}=e,i=function(){let{isBlogPostPage:e}=(0,s.nO)();return e?void 0:"margin-bottom--xl"}();return(0,r.jsxs)(l.Z,{className:(0,a.Z)(i,n),children:[(0,r.jsx)(h,{}),(0,r.jsx)(m.Z,{children:t}),(0,r.jsx)(w,{})]})}},65808:function(e,t,n){n.d(t,{Z:()=>l});var r=n(85893);n(67294);var a=n(5666),s=n(80145);function l(e){let{items:t,component:n=s.Z}=e;return(0,r.jsx)(r.Fragment,{children:t.map(e=>{let{content:t}=e;return(0,r.jsx)(a.n4,{content:t,children:(0,r.jsx)(n,{children:(0,r.jsx)(t,{})})},t.metadata.permalink)})})}},2769:function(e,t,n){n.d(t,{Z:()=>h});var r=n(85893),a=n(67294),s=n(90496),l=n(96700),i=n(71607),o=n(97812);let c={details:"details_Nokh",isBrowser:"isBrowser_QrB5",collapsibleContent:"collapsibleContent_EoA1"};function d(e){return!!e&&("SUMMARY"===e.tagName||d(e.parentElement))}function u(e){let{summary:t,children:n,...u}=e;(0,l.Z)().collectAnchor(u.id);let h=(0,i.Z)(),m=(0,a.useRef)(null),{collapsed:g,setCollapsed:x}=(0,o.u)({initialState:!u.open}),[f,j]=(0,a.useState)(u.open),p=a.isValidElement(t)?t:(0,r.jsx)("summary",{children:t??"Details"});return(0,r.jsxs)("details",{...u,ref:m,open:f,"data-collapsed":g,className:(0,s.Z)(c.details,h&&c.isBrowser,u.className),onMouseDown:e=>{d(e.target)&&e.detail>1&&e.preventDefault()},onClick:e=>{e.stopPropagation();let t=e.target;d(t)&&function e(t,n){return!!t&&(t===n||e(t.parentElement,n))}(t,m.current)&&(e.preventDefault(),g?(x(!1),j(!0)):x(!0))},children:[p,(0,r.jsx)(o.z,{lazy:!1,collapsed:g,onCollapseTransitionEnd:e=>{x(e),j(!e)},children:(0,r.jsx)("div",{className:c.collapsibleContent,children:n})})]})}function h(e){let{...t}=e;return(0,r.jsx)(u,{...t,className:(0,s.Z)("alert alert--info","details_Cn_P",t.className)})}},60114:function(e,t,n){n.d(t,{Z:()=>g});var r=n(85893);n(67294);var a=n(90496),s=n(77827),l=n(55951),i=n(35363);function o(e){let{className:t,...n}=e;return(0,r.jsx)("svg",{fill:"currentColor",height:"20",width:"20",viewBox:"0 0 40 40",className:(0,a.Z)("iconEdit_IMw_",t),"aria-hidden":"true",...n,children:(0,r.jsx)("g",{children:(0,r.jsx)("path",{d:"m34.5 11.7l-3 3.1-6.3-6.3 3.1-3q0.5-0.5 1.2-0.5t1.1 0.5l3.9 3.9q0.5 0.4 0.5 1.1t-0.5 1.2z m-29.5 17.1l18.4-18.5 6.3 6.3-18.4 18.4h-6.3v-6.2z"})})})}function c(e){let{editUrl:t}=e;return(0,r.jsxs)(i.Z,{to:t,className:l.k.common.editThisPage,children:[(0,r.jsx)(o,{}),(0,r.jsx)(s.Z,{id:"theme.common.editThisPage",description:"The link label to edit the current page",children:"Edit this page"})]})}var d=n(90177);function u(e){let{lastUpdatedAt:t}=e,n=new Date(t),a=(0,d.P)({day:"numeric",month:"short",year:"numeric",timeZone:"UTC"}).format(n);return(0,r.jsx)(s.Z,{id:"theme.lastUpdated.atDate",description:"The words used to describe on which date a page has been last updated",values:{date:(0,r.jsx)("b",{children:(0,r.jsx)("time",{dateTime:n.toISOString(),itemProp:"dateModified",children:a})})},children:" on {date}"})}function h(e){let{lastUpdatedBy:t}=e;return(0,r.jsx)(s.Z,{id:"theme.lastUpdated.byUser",description:"The words used to describe by who the page has been last updated",values:{user:(0,r.jsx)("b",{children:t})},children:" by {user}"})}function m(e){let{lastUpdatedAt:t,lastUpdatedBy:n}=e;return(0,r.jsxs)("span",{className:l.k.common.lastUpdated,children:[(0,r.jsx)(s.Z,{id:"theme.lastUpdated.lastUpdatedAtBy",description:"The sentence used to display when a page has been last updated, and by who",values:{atDate:t?(0,r.jsx)(u,{lastUpdatedAt:t}):"",byUser:n?(0,r.jsx)(h,{lastUpdatedBy:n}):""},children:"Last updated{atDate}{byUser}"}),!1]})}function g(e){let{className:t,editUrl:n,lastUpdatedAt:s,lastUpdatedBy:l}=e;return(0,r.jsxs)("div",{className:(0,a.Z)("row",t),children:[(0,r.jsx)("div",{className:"col",children:n&&(0,r.jsx)(c,{editUrl:n})}),(0,r.jsx)("div",{className:(0,a.Z)("col","lastUpdated_OHCJ"),children:(s||l)&&(0,r.jsx)(m,{lastUpdatedAt:s,lastUpdatedBy:l})})]})}},84015:function(e,t,n){n.d(t,{Z:()=>B});var r=n(85893),a=n(67294),s=n(80980),l=n(53327),i=n(27817);function o(e){return(0,r.jsx)("code",{...e})}function c(e){return void 0!==e.children&&a.Children.toArray(e.children).every(e=>"string"==typeof e&&!e.includes("\n"))?(0,r.jsx)(o,{...e}):(0,r.jsx)(i.Z,{...e})}var d=n(35363),u=n(2769);function h(e){let t=a.Children.toArray(e.children),n=t.find(e=>a.isValidElement(e)&&"summary"===e.type),s=(0,r.jsx)(r.Fragment,{children:t.filter(e=>e!==n)});return(0,r.jsx)(u.Z,{...e,summary:n,children:s})}var m=n(57922);function g(e){return(0,r.jsx)(m.Z,{...e})}var x=n(90496);let f={containsTaskList:"containsTaskList_k9gM"};var j=n(96700),p=n(49356),v=n(67490),b=n(85108),w=n(26378),Z=n(45245),N=n(57396);async function y(e){let{id:t,text:n,config:r}=e;N.Z.mermaidAPI.initialize(r);try{return await N.Z.render(t,n)}catch(e){throw document.querySelector(`#d${t}`)?.remove(),e}}function k(e){let{renderResult:t}=e,n=(0,a.useRef)(null);return(0,a.useEffect)(()=>{let e=n.current;t.bindFunctions?.(e)},[t]),(0,r.jsx)("div",{ref:n,className:"docusaurus-mermaid-container container_RUsj",dangerouslySetInnerHTML:{__html:t.svg}})}function C(e){let{value:t}=e,n=function(e){let{text:t,config:n}=e,[r,s]=(0,a.useState)(null),l=(0,a.useState)(`mermaid-svg-${Math.round(1e7*Math.random())}`)[0],i=function(){let{colorMode:e}=(0,Z.I)(),t=(0,w.L)().mermaid,n=t.theme[e],{options:r}=t;return(0,a.useMemo)(()=>({startOnLoad:!1,...r,theme:n}),[n,r])}(),o=n??i;return(0,a.useEffect)(()=>{y({id:l,text:t,config:o}).then(s).catch(e=>{s(()=>{throw e})})},[l,t,o]),r}({text:t});return null===n?null:(0,r.jsx)(k,{renderResult:n})}let _={...{Head:l.Z,details:h,Details:h,code:c,a:function(e){return(0,r.jsx)(d.Z,{...e})},pre:function(e){return(0,r.jsx)(r.Fragment,{children:e.children})},ul:function(e){return(0,r.jsx)("ul",{...e,className:function(e){if(void 0!==e)return(0,x.Z)(e,e?.includes("contains-task-list")&&f.containsTaskList)}(e.className)})},li:function(e){return(0,j.Z)().collectAnchor(e.id),(0,r.jsx)("li",{...e})},img:function(e){var t;return(0,r.jsx)("img",{decoding:"async",loading:"lazy",...e,className:(t=e.className,(0,x.Z)(t,"img_vXGZ"))})},h1:e=>(0,r.jsx)(g,{as:"h1",...e}),h2:e=>(0,r.jsx)(g,{as:"h2",...e}),h3:e=>(0,r.jsx)(g,{as:"h3",...e}),h4:e=>(0,r.jsx)(g,{as:"h4",...e}),h5:e=>(0,r.jsx)(g,{as:"h5",...e}),h6:e=>(0,r.jsx)(g,{as:"h6",...e}),admonition:p.Z,mermaid:function(e){return(0,r.jsx)(v.Z,{fallback:e=>(0,r.jsx)(b.Ac,{...e}),children:(0,r.jsx)(C,{...e})})}},Code:c,Highlight:function(e){let{children:t,color:n}=e;return(0,r.jsx)("span",{style:{backgroundColor:n,borderRadius:"2px",color:"#fff",padding:"0.2rem"},children:t})},TweetQuote:function(e){let{url:t,handle:n,name:a,job:s,children:l}=e,i=`https://unavatar.io/x/${n}`,o=`https://x.com/${n}`;return(0,r.jsxs)("figure",{className:"tweetQuote_h8Rz",children:[(0,r.jsx)("blockquote",{children:(0,r.jsx)(d.Z,{to:t,children:l})}),(0,r.jsx)("figcaption",{children:(0,r.jsx)(d.Z,{to:o,rel:"nofollow",children:(0,r.jsxs)("div",{className:"avatar",children:[(0,r.jsx)("img",{alt:a,className:(0,x.Z)("avatar__photo","avatarImg_b51M"),src:i}),(0,r.jsxs)("div",{className:(0,x.Z)("avatar__intro"),children:[(0,r.jsx)("strong",{className:"avatar__name",children:(0,r.jsx)("cite",{children:a})}),(0,r.jsx)("small",{className:"avatar__subtitle",itemProp:"description",children:s})]})]})})})]})}};function B(e){let{children:t}=e;return(0,r.jsx)(s.Z,{components:_,children:t})}},65773:function(e,t,n){n.d(t,{Z:()=>l});var r=n(85893);n(67294);var a=n(90496),s=n(35363);function l(e){let{permalink:t,title:n,subLabel:l,isNext:i}=e;return(0,r.jsxs)(s.Z,{className:(0,a.Z)("pagination-nav__link",i?"pagination-nav__link--next":"pagination-nav__link--prev"),to:t,children:[l&&(0,r.jsx)("div",{className:"pagination-nav__sublabel",children:l}),(0,r.jsx)("div",{className:"pagination-nav__label",children:n})]})}},63479:function(e,t,n){n.d(t,{Z:()=>i});var r=n(85893);n(67294);var a=n(90496),s=n(35363);let l={tag:"tag_Nd8t",tagRegular:"tagRegular_TiLs",tagWithCount:"tagWithCount_AQg7"};function i(e){let{permalink:t,label:n,count:i,description:o}=e;return(0,r.jsxs)(s.Z,{href:t,title:o,className:(0,a.Z)(l.tag,i?l.tagWithCount:l.tagRegular),children:[n,i&&(0,r.jsx)("span",{children:i})]})}},47294:function(e,t,n){n.d(t,{Z:()=>i});var r=n(85893);n(67294);var a=n(90496),s=n(77827),l=n(63479);function i(e){let{tags:t}=e;return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)("b",{children:(0,r.jsx)(s.Z,{id:"theme.tags.tagsListLabel",description:"The label alongside a tag list",children:"Tags:"})}),(0,r.jsx)("ul",{className:(0,a.Z)("tags_rTaS","padding--none","margin-left--sm"),children:t.map(e=>(0,r.jsx)("li",{className:"tag_l5va",children:(0,r.jsx)(l.Z,{...e})},e.permalink))})]})}},90177:function(e,t,n){n.d(t,{P:()=>a});var r=n(8156);function a(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},{i18n:{currentLocale:t}}=(0,r.Z)(),n=function(){let{i18n:{currentLocale:e,localeConfigs:t}}=(0,r.Z)();return t[e].calendar}();return new Intl.DateTimeFormat(t,{calendar:n,...e})}},11660:function(e,t,n){n.d(t,{c:()=>o});var r=n(67294),a=n(8156);let s=["zero","one","two","few","many","other"];function l(e){return s.filter(t=>e.includes(t))}let i={locale:"en",pluralForms:l(["one","other"]),select:e=>1===e?"one":"other"};function o(){let e=function(){let{i18n:{currentLocale:e}}=(0,a.Z)();return(0,r.useMemo)(()=>{try{let t=new Intl.PluralRules(e);return{locale:e,pluralForms:l(t.resolvedOptions().pluralCategories),select:e=>t.select(e)}}catch(t){return console.error(`Failed to use Intl.PluralRules for locale "${e}". Docusaurus will fallback to the default (English) implementation. Error: ${t.message} -`),i}},[e])}();return{selectMessage:(t,n)=>(function(e,t,n){let r=e.split("|");if(1===r.length)return r[0];r.length>n.pluralForms.length&&console.error(`For locale=${n.locale}, a maximum of ${n.pluralForms.length} plural forms are expected (${n.pluralForms.join(",")}), but the message contains ${r.length}: ${e}`);let a=n.select(t);return r[Math.min(n.pluralForms.indexOf(a),r.length-1)]})(n,t,e)}}},56497:function(e,t,n){n.d(t,{Z:()=>s});var r=n(85893);n(67294);var a=n(71607);function s(e){let{children:t,fallback:n}=e;return(0,a.Z)()?(0,r.jsx)(r.Fragment,{children:t?.()}):n??null}},61420:function(e,t,n){n.d(t,{Z:()=>b});var r=n(85893),a=n(67294),s=n(5666),l=n(37147),i=n(54505),o=n(90496),c=n(35363);let d={image:"image_oRbT"};function u(e){let{author:t,className:n}=e,{name:a,url:s,imageURL:l}=t;return(0,r.jsx)("div",{className:(0,o.Z)("avatar margin-bottom--sm",n),children:l&&(0,r.jsx)(c.Z,{className:"avatar__photo-link avatar__photo",href:s,children:(0,r.jsx)("img",{className:d.image,src:l,alt:a,onError:e=>{e.currentTarget.src='data:image/svg+xml,'}})})})}function h(e){let{expanded:t,...n}=e;return t?(0,r.jsx)("svg",{viewBox:"0 0 1024 1024",width:"20",height:"20",fill:"currentColor",...n,children:(0,r.jsx)("path",{d:"M783.915092 1009.031953l-271.898251-277.615587-271.930737 277.550617a49.214558 49.214558 0 0 1-70.752018 0 51.780862 51.780862 0 0 1 0-72.246322l307.274261-313.706262a49.279528 49.279528 0 0 1 70.784503 0l307.33923 313.706262a51.975771 51.975771 0 0 1 0 72.311292 49.409467 49.409467 0 0 1-70.816988 0z m-307.306745-608.05155L169.269117 87.274141A51.975771 51.975771 0 0 1 169.269117 14.96285a49.409467 49.409467 0 0 1 70.816987 0l271.930737 277.615586L783.850122 14.96285a49.409467 49.409467 0 0 1 70.816988 0 51.975771 51.975771 0 0 1 0 72.311291l-307.33923 313.706262a49.376982 49.376982 0 0 1-70.719533 0z"})}):(0,r.jsx)("svg",{viewBox:"0 0 1024 1024",width:"20",height:"20",fill:"currentColor",...n,children:(0,r.jsx)("path",{d:"M476.612887 1009.12034L169.240699 695.380437a51.981345 51.981345 0 0 1 0-72.319045 49.382277 49.382277 0 0 1 70.824582 0l271.959897 277.645356 271.862433-277.645356a49.382277 49.382277 0 0 1 70.824582 0 51.981345 51.981345 0 0 1 0 72.319045l-307.307212 313.739903a49.447254 49.447254 0 0 1-70.792094 0z m307.274724-608.116755L511.99269 123.455693l-271.959897 277.645357a49.382277 49.382277 0 0 1-70.824582 0 51.981345 51.981345 0 0 1 0-72.319045L476.580399 15.042102a49.382277 49.382277 0 0 1 70.727117 0l307.372188 313.739903a51.981345 51.981345 0 0 1 0 72.319045 49.414766 49.414766 0 0 1-70.824582 0z"})})}let m={imageOnlyAuthorRow:"imageOnlyAuthorRow_WiD6",imageOnlyAuthorCol:"imageOnlyAuthorCol_uiac",toggleButton:"toggleButton_WvRg"};function g(e){let{className:t}=e,{metadata:{authors:n},assets:l}=(0,s.nO)(),[i,c]=(0,a.useState)(!1);if(0===n.length)return null;let d=n.slice(0,i?n.length:10);return(0,r.jsxs)("div",{className:(0,o.Z)("margin-top--md margin-bottom--sm",m.imageOnlyAuthorRow,t),children:[d.map((e,t)=>(0,r.jsx)("div",{className:m.imageOnlyAuthorCol,children:(0,r.jsx)(u,{author:{...e,imageURL:l.authorsImageUrls[t]??e.imageURL}})},t)),n.length>10&&(0,r.jsx)("button",{className:(0,o.Z)("clean-btn",m.toggleButton),type:"button",onClick:()=>c(e=>!e),"aria-label":"expand",children:(0,r.jsx)(h,{expanded:i})})]})}let x={changelogItemTitleList:"changelogItemTitleList_sueG"};function f(){let{isBlogPostPage:e}=(0,s.nO)();return(0,r.jsx)(l.Z,{className:e?void 0:x.changelogItemTitleList})}function j(){return(0,r.jsxs)("header",{children:[(0,r.jsx)(f,{}),(0,r.jsx)(i.Z,{}),(0,r.jsx)(g,{})]})}var p=n(76460),v=n(90437);function b(e){let{children:t}=e;return(0,r.jsxs)(p.Z,{className:"changelogItemContainer_jeDt",children:[(0,r.jsx)(j,{}),(0,r.jsx)(v.Z,{children:t})]})}},67186:function(e,t,n){n.r(t),n.d(t,{default:()=>b});var r=n(85893);n(67294);var a=n(90496),s=n(57335),l=n(55951),i=n(9942),o=n(22272),c=n(65808),d=n(69879),u=n(61420),h=n(77827),m=n(35363),g=n(57922);function x(){return(0,r.jsxs)(m.Z,{href:"https://x.com/docusaurus",className:"x_RTSd",children:[(0,r.jsx)("b",{children:"X"}),(0,r.jsx)("svg",{style:{fill:"#1da1f2",position:"relative",left:4,top:1,marginRight:8},width:"16",height:"16",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 512 512",children:(0,r.jsx)("path",{d:"M459.37 151.716c.325 4.548.325 9.097.325 13.645 0 138.72-105.583 298.558-298.558 298.558-59.452 0-114.68-17.219-161.137-47.106 8.447.974 16.568 1.299 25.34 1.299 49.055 0 94.213-16.568 130.274-44.832-46.132-.975-84.792-31.188-98.112-72.772 6.498.974 12.995 1.624 19.818 1.624 9.421 0 18.843-1.3 27.614-3.573-48.081-9.747-84.143-51.98-84.143-102.985v-1.299c13.969 7.797 30.214 12.67 47.431 13.319-28.264-18.843-46.781-51.005-46.781-87.391 0-19.492 5.197-37.36 14.294-52.954 51.655 63.675 129.3 105.258 216.365 109.807-1.624-7.797-2.599-15.918-2.599-24.04 0-57.828 46.782-104.934 104.934-104.934 30.213 0 57.502 12.67 76.67 33.137 23.715-4.548 46.456-13.32 66.599-25.34-7.798 24.366-24.366 44.833-46.132 57.827 21.117-2.273 41.584-8.122 60.426-16.243-14.292 20.791-32.161 39.308-52.628 54.253z"})})]})}function f(){return(0,r.jsxs)(m.Z,{href:"pathname:///changelog/rss.xml",className:"rss_fOa_",children:[(0,r.jsx)("b",{children:(0,r.jsx)(h.Z,{id:"changelog.description.rssLink",children:"RSS feeds"})}),(0,r.jsx)("svg",{style:{fill:"#f26522",position:"relative",left:4,top:1,marginRight:8},xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 24 24",children:(0,r.jsx)("path",{d:"M6.503 20.752c0 1.794-1.456 3.248-3.251 3.248-1.796 0-3.252-1.454-3.252-3.248 0-1.794 1.456-3.248 3.252-3.248 1.795.001 3.251 1.454 3.251 3.248zm-6.503-12.572v4.811c6.05.062 10.96 4.966 11.022 11.009h4.817c-.062-8.71-7.118-15.758-15.839-15.82zm0-3.368c10.58.046 19.152 8.594 19.183 19.188h4.817c-.03-13.231-10.755-23.954-24-24v4.812z"})})]})}function j(e){let{blogTitle:t}=e;return(0,r.jsxs)("header",{className:"margin-bottom--lg",children:[(0,r.jsx)(g.Z,{as:"h1",style:{fontSize:"3rem"},children:t}),(0,r.jsx)("p",{children:(0,r.jsx)(h.Z,{id:"changelog.description",values:{xLink:(0,r.jsx)(x,{}),rssLink:(0,r.jsx)(f,{})},children:"Subscribe through {rssLink} or follow us on {xLink} to stay up-to-date with new releases!"})})]})}function p(e){let{metadata:t}=e,{blogTitle:n,blogDescription:a}=t;return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(s.d,{title:n,description:a}),(0,r.jsx)(d.Z,{tag:"blog_posts_list"})]})}function v(e){let{metadata:t,items:n,sidebar:a}=e,{blogTitle:s}=t;return(0,r.jsxs)(i.Z,{sidebar:a,children:[(0,r.jsx)(j,{blogTitle:s}),(0,r.jsx)(c.Z,{items:n,component:u.Z}),(0,r.jsx)(o.Z,{metadata:t})]})}function b(e){return(0,r.jsxs)(s.FG,{className:(0,a.Z)(l.k.wrapper.blogPages,l.k.page.blogListPage),children:[(0,r.jsx)(p,{...e}),(0,r.jsx)(v,{...e})]})}},93278:function(e,t,n){n.d(t,{Z:()=>em});var r,a={};n.r(a),n.d(a,{ButtonExample:()=>C});var s=n(85893),l=n(67294),i=n(90496),o=n(71607),c=n(10075),d=n(77827),u=n(8156),h=n(56497),m=n(85108),g=n(45245),x=n(26378);function f(){let{prism:e}=(0,x.L)(),{colorMode:t}=(0,g.I)(),n=e.theme,r=e.darkTheme||n;return"dark"===t?r:n}var j=n(67490);function p(e){let{children:t}=e;return(0,s.jsx)("div",{className:(0,i.Z)("playgroundHeader_Tvsk"),children:t})}function v(){return(0,s.jsx)("div",{children:"Loading..."})}function b(){return(0,s.jsx)(h.Z,{fallback:(0,s.jsx)(v,{}),children:()=>(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(j.Z,{fallback:e=>(0,s.jsx)(m.Ac,{...e}),children:(0,s.jsx)(c.i5,{})}),(0,s.jsx)(c.IF,{})]})})}function w(){return(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(p,{children:(0,s.jsx)(d.Z,{id:"theme.Playground.result",description:"The result label of the live codeblocks",children:"Result"})}),(0,s.jsx)("div",{className:"playgroundPreview_mApW",children:(0,s.jsx)(b,{})})]})}function Z(){let e=(0,o.Z)();return(0,s.jsx)(c.uz,{className:"playgroundEditor_TySg"},String(e))}function N(){return(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(p,{children:(0,s.jsx)(d.Z,{id:"theme.Playground.liveEditor",description:"The live editor label of the live codeblocks",children:"Live Editor"})}),(0,s.jsx)(Z,{})]})}let y=e=>`${e};`;function k(e){let{children:t,transformCode:n,...r}=e,{siteConfig:{themeConfig:a}}=(0,u.Z)(),{liveCodeBlock:{playgroundPosition:l}}=a,i=f(),o=r.metastring?.includes("noInline")??!1;return(0,s.jsx)("div",{className:"playgroundContainer_6Ior",children:(0,s.jsx)(c.nu,{code:t?.replace(/\n$/,""),noInline:o,transformCode:n??y,theme:i,...r,children:"top"===l?(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(w,{}),(0,s.jsx)(N,{})]}):(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(N,{}),(0,s.jsx)(w,{})]})})})}function C(e){return(0,s.jsx)("button",{type:"button",...e,style:{backgroundColor:"white",color:"black",border:"solid red",borderRadius:20,padding:10,cursor:"pointer",...e.style}})}let _={React:l,...l,...a};var B=n(55951),L=n(6324),M=n.n(L),I=n(50923);let T=/title=(?["'])(?.*?)\1/,A=/\{(? [\d,-]+)\}/,R={js:{start:"\\/\\/",end:""},jsBlock:{start:"\\/\\*",end:"\\*\\/"},jsx:{start:"\\{\\s*\\/\\*",end:"\\*\\/\\s*\\}"},bash:{start:"#",end:""},html:{start:"\x3c!--",end:"--\x3e"}},z={...R,lua:{start:"--",end:""},wasm:{start:"\\;\\;",end:""},tex:{start:"%",end:""},vb:{start:"['\u2018\u2019]",end:""},vbnet:{start:"(?:_\\s*)?['\u2018\u2019]",end:""},rem:{start:"[Rr][Ee][Mm]\\b",end:""},f90:{start:"!",end:""},ml:{start:"\\(\\*",end:"\\*\\)"},cobol:{start:"\\*>",end:""}},E=Object.keys(R);function S(e,t){let n=e.map(e=>{let{start:n,end:r}=z[e];return`(?:${n}\\s*(${t.flatMap(e=>[e.line,e.block?.start,e.block?.end].filter(Boolean)).join("|")})\\s*${r})`}).join("|");return RegExp(`^\\s*(?:${n})\\s*$`)}let H=(0,l.createContext)(null);function O(e){let{metadata:t,wordWrap:n,children:r}=e,a=(0,l.useMemo)(()=>({metadata:t,wordWrap:n}),[t,n]);return(0,s.jsx)(H.Provider,{value:a,children:r})}function F(){let e=(0,l.useContext)(H);if(null===e)throw new I.i6("CodeBlockContextProvider");return e}function P(e){let{as:t,...n}=e,r=function(e){let t={color:"--prism-color",backgroundColor:"--prism-background-color"},n={};return Object.entries(e.plain).forEach(e=>{let[r,a]=e,s=t[r];s&&"string"==typeof a&&(n[s]=a)}),n}(f());return(0,s.jsx)(t,{...n,style:r,className:(0,i.Z)(n.className,"codeBlockContainer_jDV4",B.k.common.codeBlock)})}let U={codeBlock:"codeBlock_Gebt",codeBlockStandalone:"codeBlockStandalone_i_cY",codeBlockLines:"codeBlockLines_FJaf",codeBlockLinesWithNumbering:"codeBlockLinesWithNumbering_FU9Q"};function $(e){let{children:t,className:n}=e;return(0,s.jsx)(P,{as:"pre",tabIndex:0,className:(0,i.Z)(U.codeBlockStandalone,"thin-scrollbar",n),children:(0,s.jsx)("code",{className:U.codeBlockLines,children:t})})}let D={attributes:!0,characterData:!0,childList:!0,subtree:!0};function W(e){let{children:t}=e;return t}var V=n(7316);function G(e){let{line:t,token:n,...r}=e;return(0,s.jsx)("span",{...r})}let Y={codeLine:"codeLine_qRmp",codeLineNumber:"codeLineNumber_dS_J",codeLineContent:"codeLineContent_XF5l"};function q(e){let{line:t,classNames:n,showLineNumbers:r,getLineProps:a,getTokenProps:l}=e,o=function(e){let t=1===e.length&&"\n"===e[0].content?e[0]:void 0;return t?[{...t,content:""}]:e}(t),c=a({line:o,className:(0,i.Z)(n,r&&Y.codeLine)}),d=o.map((e,t)=>{let n=l({token:e});return(0,s.jsx)(G,{...n,line:o,token:e,children:n.children},t)});return(0,s.jsxs)("span",{...c,children:[r?(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)("span",{className:Y.codeLineNumber}),(0,s.jsx)("span",{className:Y.codeLineContent,children:d})]}):d,(0,s.jsx)("br",{})]})}let X=l.forwardRef((e,t)=>(0,s.jsx)("pre",{ref:t,tabIndex:0,...e,className:(0,i.Z)(e.className,U.codeBlock,"thin-scrollbar")}));function Q(e){let{metadata:t}=F();return(0,s.jsx)("code",{...e,className:(0,i.Z)(e.className,U.codeBlockLines,void 0!==t.lineNumbersStart&&U.codeBlockLinesWithNumbering),style:{...e.style,counterReset:void 0===t.lineNumbersStart?void 0:`line-count ${t.lineNumbersStart-1}`}})}function J(e){let{className:t}=e,{metadata:n,wordWrap:r}=F(),a=f(),{code:l,language:o,lineNumbersStart:c,lineClassNames:d}=n;return(0,s.jsx)(V.y$,{theme:a,code:l,language:o,children:e=>{let{className:n,style:a,tokens:l,getLineProps:o,getTokenProps:u}=e;return(0,s.jsx)(X,{ref:r.codeBlockRef,className:(0,i.Z)(t,n),style:a,children:(0,s.jsx)(Q,{children:l.map((e,t)=>(0,s.jsx)(q,{line:e,getLineProps:o,getTokenProps:u,classNames:d[t],showLineNumbers:void 0!==c},t))})})}})}var K=n(44771);function ee(e){let{className:t,...n}=e;return(0,s.jsx)("button",{type:"button",...n,className:(0,i.Z)("clean-btn",t)})}function et(e){return(0,s.jsx)("svg",{viewBox:"0 0 24 24",...e,children:(0,s.jsx)("path",{fill:"currentColor",d:"M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"})})}function en(e){return(0,s.jsx)("svg",{viewBox:"0 0 24 24",...e,children:(0,s.jsx)("path",{fill:"currentColor",d:"M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"})})}let er={copyButtonCopied:"copyButtonCopied_wDuR",copyButtonIcons:"copyButtonIcons_gMWc",copyButtonIcon:"copyButtonIcon_GXfb",copyButtonSuccessIcon:"copyButtonSuccessIcon_ktUX"};function ea(e){let{className:t}=e,{copyCode:n,isCopied:r}=function(){let{metadata:{code:e}}=F(),[t,n]=(0,l.useState)(!1),r=(0,l.useRef)(void 0),a=(0,l.useCallback)(()=>{(0,K.Z)(e),n(!0),r.current=window.setTimeout(()=>{n(!1)},1e3)},[e]);return(0,l.useEffect)(()=>()=>window.clearTimeout(r.current),[]),{copyCode:a,isCopied:t}}();return(0,s.jsx)(ee,{"aria-label":r?(0,d.I)({id:"theme.CodeBlock.copied",message:"Copied",description:"The copied button label on code blocks"}):(0,d.I)({id:"theme.CodeBlock.copyButtonAriaLabel",message:"Copy code to clipboard",description:"The ARIA label for copy code blocks button"}),title:(0,d.I)({id:"theme.CodeBlock.copy",message:"Copy",description:"The copy button label on code blocks"}),className:(0,i.Z)(t,er.copyButton,r&&er.copyButtonCopied),onClick:n,children:(0,s.jsxs)("span",{className:er.copyButtonIcons,"aria-hidden":"true",children:[(0,s.jsx)(et,{className:er.copyButtonIcon}),(0,s.jsx)(en,{className:er.copyButtonSuccessIcon})]})})}function es(e){return(0,s.jsx)("svg",{viewBox:"0 0 24 24",...e,children:(0,s.jsx)("path",{fill:"currentColor",d:"M4 19h6v-2H4v2zM20 5H4v2h16V5zm-3 6H4v2h13.25c1.1 0 2 .9 2 2s-.9 2-2 2H15v-2l-3 3l3 3v-2h2c2.21 0 4-1.79 4-4s-1.79-4-4-4z"})})}let el={wordWrapButtonIcon:"wordWrapButtonIcon___5r",wordWrapButtonEnabled:"wordWrapButtonEnabled_nam_"};function ei(e){let{className:t}=e,{wordWrap:n}=F();if(!(n.isEnabled||n.isCodeScrollable))return!1;let r=(0,d.I)({id:"theme.CodeBlock.wordWrapToggle",message:"Toggle word wrap",description:"The title attribute for toggle word wrapping button of code block lines"});return(0,s.jsx)(ee,{onClick:()=>n.toggle(),className:(0,i.Z)(t,n.isEnabled&&el.wordWrapButtonEnabled),"aria-label":r,title:r,children:(0,s.jsx)(es,{className:el.wordWrapButtonIcon,"aria-hidden":"true"})})}function eo(e){let{className:t}=e;return(0,s.jsx)(h.Z,{children:()=>(0,s.jsxs)("div",{className:(0,i.Z)(t,"buttonGroup_KXnS"),children:[(0,s.jsx)(ei,{}),(0,s.jsx)(ea,{})]})})}let ec={codeBlockContent:"codeBlockContent_cKMj",codeBlockTitle:"codeBlockTitle_U6Q0"};function ed(e){let{className:t}=e,{metadata:n}=F();return(0,s.jsxs)(P,{as:"div",className:(0,i.Z)(t,n.className),children:[n.title&&(0,s.jsx)("div",{className:ec.codeBlockTitle,children:(0,s.jsx)(W,{children:n.title})}),(0,s.jsxs)("div",{className:ec.codeBlockContent,children:[(0,s.jsx)(J,{}),(0,s.jsx)(eo,{})]})]})}function eu(e){let t=function(e){let{prism:t}=(0,x.L)();return function(e){var t,n,r;let a=(n=(t={language:e.language,defaultLanguage:e.defaultLanguage,className:e.className}).language??function(e){if(!e)return;let t=e.split(" ").find(e=>e.startsWith("language-"));return t?.replace(/language-/,"")}(t.className)??t.defaultLanguage,n?.toLowerCase()??"text"),{lineClassNames:s,code:l}=function(e,t){let n=e.replace(/\r?\n$/,"");return function(e,t){let{metastring:n,magicComments:r}=t;if(n&&A.test(n)){let t=n.match(A).groups.range;if(0===r.length)throw Error(`A highlight range has been given in code block's metastring (\`\`\` ${n}), but no magic comment config is available. Docusaurus applies the first magic comment entry's className for metastring ranges.`);let a=r[0].className;return{lineClassNames:Object.fromEntries(M()(t).filter(e=>e>0).map(e=>[e-1,[a]])),code:e}}return null}(n,{...t})??function(e,t){let{language:n,magicComments:r}=t;if(void 0===n)return{lineClassNames:{},code:e};let a=function(e,t){switch(e){case"js":case"javascript":case"ts":case"typescript":return S(["js","jsBlock"],t);case"jsx":case"tsx":return S(["js","jsBlock","jsx"],t);case"html":return S(["js","jsBlock","html"],t);case"python":case"py":case"bash":return S(["bash"],t);case"markdown":case"md":return S(["html","jsx","bash"],t);case"tex":case"latex":case"matlab":return S(["tex"],t);case"lua":case"haskell":return S(["lua"],t);case"sql":return S(["lua","jsBlock"],t);case"wasm":return S(["wasm"],t);case"vb":case"vba":case"visual-basic":return S(["vb","rem"],t);case"vbnet":return S(["vbnet","rem"],t);case"batch":return S(["rem"],t);case"basic":return S(["rem","f90"],t);case"fsharp":return S(["js","ml"],t);case"ocaml":case"sml":return S(["ml"],t);case"fortran":return S(["f90"],t);case"cobol":return S(["cobol"],t);default:return S(E,t)}}(n,r),s=e.split(/\r?\n/),l=Object.fromEntries(r.map(e=>[e.className,{start:0,range:""}])),i=Object.fromEntries(r.filter(e=>e.line).map(e=>{let{className:t,line:n}=e;return[n,t]})),o=Object.fromEntries(r.filter(e=>e.block).map(e=>{let{className:t,block:n}=e;return[n.start,t]})),c=Object.fromEntries(r.filter(e=>e.block).map(e=>{let{className:t,block:n}=e;return[n.end,t]}));for(let e=0;e void 0!==e);i[n]?l[i[n]].range+=`${e},`:o[n]?l[o[n]].start=e:c[n]&&(l[c[n]].range+=`${l[c[n]].start}-${e-1},`),s.splice(e,1)}let d={};return Object.entries(l).forEach(e=>{let[t,{range:n}]=e;M()(n).forEach(e=>{d[e]??=[],d[e].push(t)})}),{code:s.join("\n"),lineClassNames:d}}(n,{...t})}(e.code,{metastring:e.metastring,magicComments:e.magicComments,language:a}),o=function(e){let{className:t,language:n}=e;return(0,i.Z)(t,n&&!t?.includes(`language-${n}`)&&`language-${n}`)}({className:e.className,language:a}),c=(r=e.metastring,(r?.match(T)?.groups.title??"")||e.title),d=function(e){let{showLineNumbers:t,metastring:n}=e;if("boolean"==typeof t)return t?1:void 0;if("number"==typeof t)return t;let r=n?.split(" ").find(e=>e.startsWith("showLineNumbers"));if(r)return r.startsWith("showLineNumbers=")?parseInt(r.replace("showLineNumbers=",""),10):1}({showLineNumbers:e.showLineNumbers,metastring:e.metastring});return{codeInput:e.code,code:l,className:o,language:a,title:c,lineNumbersStart:d,lineClassNames:s}}({code:e.children,className:e.className,metastring:e.metastring,magicComments:t.magicComments,defaultLanguage:t.defaultLanguage,language:e.language,title:e.title,showLineNumbers:e.showLineNumbers})}(e),n=function(){let[e,t]=(0,l.useState)(!1),[n,r]=(0,l.useState)(!1),a=(0,l.useRef)(null),s=(0,l.useCallback)(()=>{let n=a.current.querySelector("code");e?n.removeAttribute("style"):(n.style.whiteSpace="pre-wrap",n.style.overflowWrap="anywhere"),t(e=>!e)},[a,e]),i=(0,l.useCallback)(()=>{let{scrollWidth:e,clientWidth:t}=a.current;r(e>t||a.current.querySelector("code").hasAttribute("style"))},[a]),[o,c]=(0,l.useState)(),d=(0,l.useCallback)(()=>{c(a.current?.closest("[role=tabpanel][hidden]"))},[a,c]);return(0,l.useEffect)(()=>{d()},[d]),!function(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:D,r=(0,I.zX)(t),a=(0,I.Ql)(n);(0,l.useEffect)(()=>{let t=new MutationObserver(r);return e&&t.observe(e,a),()=>t.disconnect()},[e,r,a])}(o,e=>{e.forEach(e=>{"attributes"===e.type&&"hidden"===e.attributeName&&(i(),d())})},{attributes:!0,characterData:!1,childList:!1,subtree:!1}),(0,l.useEffect)(()=>{i()},[e,i]),(0,l.useEffect)(()=>(window.addEventListener("resize",i,{passive:!0}),()=>{window.removeEventListener("resize",i)}),[i]),{codeBlockRef:a,isEnabled:e,isCodeScrollable:n,toggle:s}}();return(0,s.jsx)(O,{metadata:t,wordWrap:n,children:(0,s.jsx)(ed,{})})}let eh=(r=function(e){let{children:t,...n}=e,r=(0,o.Z)(),a=l.Children.toArray(t).some(e=>(0,l.isValidElement)(e))?t:Array.isArray(t)?t.join(""):t;return(0,s.jsx)("string"==typeof a?eu:$,{...n,children:a},String(r))},function(e){return e.live?(0,s.jsx)(k,{scope:_,...e}):(0,s.jsx)(r,{...e})});function em(e){return(0,s.jsx)(eh,{...e})}}}]); \ No newline at end of file +`),i}},[e])}();return{selectMessage:(t,n)=>(function(e,t,n){let r=e.split("|");if(1===r.length)return r[0];r.length>n.pluralForms.length&&console.error(`For locale=${n.locale}, a maximum of ${n.pluralForms.length} plural forms are expected (${n.pluralForms.join(",")}), but the message contains ${r.length}: ${e}`);let a=n.select(t);return r[Math.min(n.pluralForms.indexOf(a),r.length-1)]})(n,t,e)}}},56497:function(e,t,n){n.d(t,{Z:()=>s});var r=n(85893);n(67294);var a=n(71607);function s(e){let{children:t,fallback:n}=e;return(0,a.Z)()?(0,r.jsx)(r.Fragment,{children:t?.()}):n??null}},61420:function(e,t,n){n.d(t,{Z:()=>b});var r=n(85893),a=n(67294),s=n(5666),l=n(37147),i=n(54505),o=n(90496),c=n(35363);let d={image:"image_oRbT"};function u(e){let{author:t,className:n}=e,{name:a,url:s,imageURL:l}=t;return(0,r.jsx)("div",{className:(0,o.Z)("avatar margin-bottom--sm",n),children:l&&(0,r.jsx)(c.Z,{className:"avatar__photo-link avatar__photo",href:s,children:(0,r.jsx)("img",{className:d.image,src:l,alt:a,onError:e=>{e.currentTarget.src='data:image/svg+xml,'}})})})}function h(e){let{expanded:t,...n}=e;return t?(0,r.jsx)("svg",{viewBox:"0 0 1024 1024",width:"20",height:"20",fill:"currentColor",...n,children:(0,r.jsx)("path",{d:"M783.915092 1009.031953l-271.898251-277.615587-271.930737 277.550617a49.214558 49.214558 0 0 1-70.752018 0 51.780862 51.780862 0 0 1 0-72.246322l307.274261-313.706262a49.279528 49.279528 0 0 1 70.784503 0l307.33923 313.706262a51.975771 51.975771 0 0 1 0 72.311292 49.409467 49.409467 0 0 1-70.816988 0z m-307.306745-608.05155L169.269117 87.274141A51.975771 51.975771 0 0 1 169.269117 14.96285a49.409467 49.409467 0 0 1 70.816987 0l271.930737 277.615586L783.850122 14.96285a49.409467 49.409467 0 0 1 70.816988 0 51.975771 51.975771 0 0 1 0 72.311291l-307.33923 313.706262a49.376982 49.376982 0 0 1-70.719533 0z"})}):(0,r.jsx)("svg",{viewBox:"0 0 1024 1024",width:"20",height:"20",fill:"currentColor",...n,children:(0,r.jsx)("path",{d:"M476.612887 1009.12034L169.240699 695.380437a51.981345 51.981345 0 0 1 0-72.319045 49.382277 49.382277 0 0 1 70.824582 0l271.959897 277.645356 271.862433-277.645356a49.382277 49.382277 0 0 1 70.824582 0 51.981345 51.981345 0 0 1 0 72.319045l-307.307212 313.739903a49.447254 49.447254 0 0 1-70.792094 0z m307.274724-608.116755L511.99269 123.455693l-271.959897 277.645357a49.382277 49.382277 0 0 1-70.824582 0 51.981345 51.981345 0 0 1 0-72.319045L476.580399 15.042102a49.382277 49.382277 0 0 1 70.727117 0l307.372188 313.739903a51.981345 51.981345 0 0 1 0 72.319045 49.414766 49.414766 0 0 1-70.824582 0z"})})}let m={imageOnlyAuthorRow:"imageOnlyAuthorRow_WiD6",imageOnlyAuthorCol:"imageOnlyAuthorCol_uiac",toggleButton:"toggleButton_WvRg"};function g(e){let{className:t}=e,{metadata:{authors:n},assets:l}=(0,s.nO)(),[i,c]=(0,a.useState)(!1);if(0===n.length)return null;let d=n.slice(0,i?n.length:10);return(0,r.jsxs)("div",{className:(0,o.Z)("margin-top--md margin-bottom--sm",m.imageOnlyAuthorRow,t),children:[d.map((e,t)=>(0,r.jsx)("div",{className:m.imageOnlyAuthorCol,children:(0,r.jsx)(u,{author:{...e,imageURL:l.authorsImageUrls[t]??e.imageURL}})},t)),n.length>10&&(0,r.jsx)("button",{className:(0,o.Z)("clean-btn",m.toggleButton),type:"button",onClick:()=>c(e=>!e),"aria-label":"expand",children:(0,r.jsx)(h,{expanded:i})})]})}let x={changelogItemTitleList:"changelogItemTitleList_sueG"};function f(){let{isBlogPostPage:e}=(0,s.nO)();return(0,r.jsx)(l.Z,{className:e?void 0:x.changelogItemTitleList})}function j(){return(0,r.jsxs)("header",{children:[(0,r.jsx)(f,{}),(0,r.jsx)(i.Z,{}),(0,r.jsx)(g,{})]})}var p=n(76460),v=n(90437);function b(e){let{children:t}=e;return(0,r.jsxs)(p.Z,{className:"changelogItemContainer_jeDt",children:[(0,r.jsx)(j,{}),(0,r.jsx)(v.Z,{children:t})]})}},67186:function(e,t,n){n.r(t),n.d(t,{default:()=>b});var r=n(85893);n(67294);var a=n(90496),s=n(57335),l=n(55951),i=n(9942),o=n(22272),c=n(65808),d=n(69879),u=n(61420),h=n(77827),m=n(35363),g=n(57922);function x(){return(0,r.jsxs)(m.Z,{href:"https://x.com/docusaurus",className:"x_RTSd",children:[(0,r.jsx)("b",{children:"X"}),(0,r.jsx)("svg",{style:{fill:"#1da1f2",position:"relative",left:4,top:1,marginRight:8},width:"16",height:"16",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 512 512",children:(0,r.jsx)("path",{d:"M459.37 151.716c.325 4.548.325 9.097.325 13.645 0 138.72-105.583 298.558-298.558 298.558-59.452 0-114.68-17.219-161.137-47.106 8.447.974 16.568 1.299 25.34 1.299 49.055 0 94.213-16.568 130.274-44.832-46.132-.975-84.792-31.188-98.112-72.772 6.498.974 12.995 1.624 19.818 1.624 9.421 0 18.843-1.3 27.614-3.573-48.081-9.747-84.143-51.98-84.143-102.985v-1.299c13.969 7.797 30.214 12.67 47.431 13.319-28.264-18.843-46.781-51.005-46.781-87.391 0-19.492 5.197-37.36 14.294-52.954 51.655 63.675 129.3 105.258 216.365 109.807-1.624-7.797-2.599-15.918-2.599-24.04 0-57.828 46.782-104.934 104.934-104.934 30.213 0 57.502 12.67 76.67 33.137 23.715-4.548 46.456-13.32 66.599-25.34-7.798 24.366-24.366 44.833-46.132 57.827 21.117-2.273 41.584-8.122 60.426-16.243-14.292 20.791-32.161 39.308-52.628 54.253z"})})]})}function f(){return(0,r.jsxs)(m.Z,{href:"pathname:///changelog/rss.xml",className:"rss_fOa_",children:[(0,r.jsx)("b",{children:(0,r.jsx)(h.Z,{id:"changelog.description.rssLink",children:"RSS feeds"})}),(0,r.jsx)("svg",{style:{fill:"#f26522",position:"relative",left:4,top:1,marginRight:8},xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 24 24",children:(0,r.jsx)("path",{d:"M6.503 20.752c0 1.794-1.456 3.248-3.251 3.248-1.796 0-3.252-1.454-3.252-3.248 0-1.794 1.456-3.248 3.252-3.248 1.795.001 3.251 1.454 3.251 3.248zm-6.503-12.572v4.811c6.05.062 10.96 4.966 11.022 11.009h4.817c-.062-8.71-7.118-15.758-15.839-15.82zm0-3.368c10.58.046 19.152 8.594 19.183 19.188h4.817c-.03-13.231-10.755-23.954-24-24v4.812z"})})]})}function j(e){let{blogTitle:t}=e;return(0,r.jsxs)("header",{className:"margin-bottom--lg",children:[(0,r.jsx)(g.Z,{as:"h1",style:{fontSize:"3rem"},children:t}),(0,r.jsx)("p",{children:(0,r.jsx)(h.Z,{id:"changelog.description",values:{xLink:(0,r.jsx)(x,{}),rssLink:(0,r.jsx)(f,{})},children:"Subscribe through {rssLink} or follow us on {xLink} to stay up-to-date with new releases!"})})]})}function p(e){let{metadata:t}=e,{blogTitle:n,blogDescription:a}=t;return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(s.d,{title:n,description:a}),(0,r.jsx)(d.Z,{tag:"blog_posts_list"})]})}function v(e){let{metadata:t,items:n,sidebar:a}=e,{blogTitle:s}=t;return(0,r.jsxs)(i.Z,{sidebar:a,children:[(0,r.jsx)(j,{blogTitle:s}),(0,r.jsx)(c.Z,{items:n,component:u.Z}),(0,r.jsx)(o.Z,{metadata:t})]})}function b(e){return(0,r.jsxs)(s.FG,{className:(0,a.Z)(l.k.wrapper.blogPages,l.k.page.blogListPage),children:[(0,r.jsx)(p,{...e}),(0,r.jsx)(v,{...e})]})}},27817:function(e,t,n){n.d(t,{Z:()=>ex});var r={};n.r(r),n.d(r,{ButtonExample:()=>eu});var a=n(85893),s=n(67294),l=n(71607),i=n(90496),o=n(45245),c=n(26378);function d(){let{prism:e}=(0,c.L)(),{colorMode:t}=(0,o.I)(),n=e.theme,r=e.darkTheme||n;return"dark"===t?r:n}var u=n(55951),h=n(6324),m=n.n(h),g=n(50923);let x=/title=(? ["'])(?.*?)\1/,f=/\{(? [\d,-]+)\}/,j={js:{start:"\\/\\/",end:""},jsBlock:{start:"\\/\\*",end:"\\*\\/"},jsx:{start:"\\{\\s*\\/\\*",end:"\\*\\/\\s*\\}"},bash:{start:"#",end:""},html:{start:"\x3c!--",end:"--\x3e"}},p={...j,lua:{start:"--",end:""},wasm:{start:"\\;\\;",end:""},tex:{start:"%",end:""},vb:{start:"['\u2018\u2019]",end:""},vbnet:{start:"(?:_\\s*)?['\u2018\u2019]",end:""},rem:{start:"[Rr][Ee][Mm]\\b",end:""},f90:{start:"!",end:""},ml:{start:"\\(\\*",end:"\\*\\)"},cobol:{start:"\\*>",end:""}},v=Object.keys(j);function b(e,t){let n=e.map(e=>{let{start:n,end:r}=p[e];return`(?:${n}\\s*(${t.flatMap(e=>[e.line,e.block?.start,e.block?.end].filter(Boolean)).join("|")})\\s*${r})`}).join("|");return RegExp(`^\\s*(?:${n})\\s*$`)}let w=(0,s.createContext)(null);function Z(e){let{metadata:t,wordWrap:n,children:r}=e,l=(0,s.useMemo)(()=>({metadata:t,wordWrap:n}),[t,n]);return(0,a.jsx)(w.Provider,{value:l,children:r})}function N(){let e=(0,s.useContext)(w);if(null===e)throw new g.i6("CodeBlockContextProvider");return e}function y(e){let{as:t,...n}=e,r=function(e){let t={color:"--prism-color",backgroundColor:"--prism-background-color"},n={};return Object.entries(e.plain).forEach(e=>{let[r,a]=e,s=t[r];s&&"string"==typeof a&&(n[s]=a)}),n}(d());return(0,a.jsx)(t,{...n,style:r,className:(0,i.Z)(n.className,"codeBlockContainer_jDV4",u.k.common.codeBlock)})}let k={codeBlock:"codeBlock_Gebt",codeBlockStandalone:"codeBlockStandalone_i_cY",codeBlockLines:"codeBlockLines_FJaf",codeBlockLinesWithNumbering:"codeBlockLinesWithNumbering_FU9Q"};function C(e){let{children:t,className:n}=e;return(0,a.jsx)(y,{as:"pre",tabIndex:0,className:(0,i.Z)(k.codeBlockStandalone,"thin-scrollbar",n),children:(0,a.jsx)("code",{className:k.codeBlockLines,children:t})})}let _={attributes:!0,characterData:!0,childList:!0,subtree:!0};function B(e){let{children:t}=e;return t}var L=n(7316);function M(e){let{line:t,token:n,...r}=e;return(0,a.jsx)("span",{...r})}let I={codeLine:"codeLine_qRmp",codeLineNumber:"codeLineNumber_dS_J",codeLineContent:"codeLineContent_XF5l"};function T(e){let{line:t,classNames:n,showLineNumbers:r,getLineProps:s,getTokenProps:l}=e,o=function(e){let t=1===e.length&&"\n"===e[0].content?e[0]:void 0;return t?[{...t,content:""}]:e}(t),c=s({line:o,className:(0,i.Z)(n,r&&I.codeLine)}),d=o.map((e,t)=>{let n=l({token:e});return(0,a.jsx)(M,{...n,line:o,token:e,children:n.children},t)});return(0,a.jsxs)("span",{...c,children:[r?(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)("span",{className:I.codeLineNumber}),(0,a.jsx)("span",{className:I.codeLineContent,children:d})]}):d,(0,a.jsx)("br",{})]})}let A=s.forwardRef((e,t)=>(0,a.jsx)("pre",{ref:t,tabIndex:0,...e,className:(0,i.Z)(e.className,k.codeBlock,"thin-scrollbar")}));function R(e){let{metadata:t}=N();return(0,a.jsx)("code",{...e,className:(0,i.Z)(e.className,k.codeBlockLines,void 0!==t.lineNumbersStart&&k.codeBlockLinesWithNumbering),style:{...e.style,counterReset:void 0===t.lineNumbersStart?void 0:`line-count ${t.lineNumbersStart-1}`}})}function z(e){let{className:t}=e,{metadata:n,wordWrap:r}=N(),s=d(),{code:l,language:o,lineNumbersStart:c,lineClassNames:u}=n;return(0,a.jsx)(L.y$,{theme:s,code:l,language:o,children:e=>{let{className:n,style:s,tokens:l,getLineProps:o,getTokenProps:d}=e;return(0,a.jsx)(A,{ref:r.codeBlockRef,className:(0,i.Z)(t,n),style:s,children:(0,a.jsx)(R,{children:l.map((e,t)=>(0,a.jsx)(T,{line:e,getLineProps:o,getTokenProps:d,classNames:u[t],showLineNumbers:void 0!==c},t))})})}})}var E=n(56497),S=n(44771),H=n(77827);function O(e){let{className:t,...n}=e;return(0,a.jsx)("button",{type:"button",...n,className:(0,i.Z)("clean-btn",t)})}function F(e){return(0,a.jsx)("svg",{viewBox:"0 0 24 24",...e,children:(0,a.jsx)("path",{fill:"currentColor",d:"M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"})})}function P(e){return(0,a.jsx)("svg",{viewBox:"0 0 24 24",...e,children:(0,a.jsx)("path",{fill:"currentColor",d:"M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"})})}let U={copyButtonCopied:"copyButtonCopied_wDuR",copyButtonIcons:"copyButtonIcons_gMWc",copyButtonIcon:"copyButtonIcon_GXfb",copyButtonSuccessIcon:"copyButtonSuccessIcon_ktUX"};function $(e){let{className:t}=e,{copyCode:n,isCopied:r}=function(){let{metadata:{code:e}}=N(),[t,n]=(0,s.useState)(!1),r=(0,s.useRef)(void 0),a=(0,s.useCallback)(()=>{(0,S.Z)(e),n(!0),r.current=window.setTimeout(()=>{n(!1)},1e3)},[e]);return(0,s.useEffect)(()=>()=>window.clearTimeout(r.current),[]),{copyCode:a,isCopied:t}}();return(0,a.jsx)(O,{"aria-label":r?(0,H.I)({id:"theme.CodeBlock.copied",message:"Copied",description:"The copied button label on code blocks"}):(0,H.I)({id:"theme.CodeBlock.copyButtonAriaLabel",message:"Copy code to clipboard",description:"The ARIA label for copy code blocks button"}),title:(0,H.I)({id:"theme.CodeBlock.copy",message:"Copy",description:"The copy button label on code blocks"}),className:(0,i.Z)(t,U.copyButton,r&&U.copyButtonCopied),onClick:n,children:(0,a.jsxs)("span",{className:U.copyButtonIcons,"aria-hidden":"true",children:[(0,a.jsx)(F,{className:U.copyButtonIcon}),(0,a.jsx)(P,{className:U.copyButtonSuccessIcon})]})})}function D(e){return(0,a.jsx)("svg",{viewBox:"0 0 24 24",...e,children:(0,a.jsx)("path",{fill:"currentColor",d:"M4 19h6v-2H4v2zM20 5H4v2h16V5zm-3 6H4v2h13.25c1.1 0 2 .9 2 2s-.9 2-2 2H15v-2l-3 3l3 3v-2h2c2.21 0 4-1.79 4-4s-1.79-4-4-4z"})})}let V={wordWrapButtonIcon:"wordWrapButtonIcon___5r",wordWrapButtonEnabled:"wordWrapButtonEnabled_nam_"};function W(e){let{className:t}=e,{wordWrap:n}=N();if(!(n.isEnabled||n.isCodeScrollable))return!1;let r=(0,H.I)({id:"theme.CodeBlock.wordWrapToggle",message:"Toggle word wrap",description:"The title attribute for toggle word wrapping button of code block lines"});return(0,a.jsx)(O,{onClick:()=>n.toggle(),className:(0,i.Z)(t,n.isEnabled&&V.wordWrapButtonEnabled),"aria-label":r,title:r,children:(0,a.jsx)(D,{className:V.wordWrapButtonIcon,"aria-hidden":"true"})})}function G(e){let{className:t}=e;return(0,a.jsx)(E.Z,{children:()=>(0,a.jsxs)("div",{className:(0,i.Z)(t,"buttonGroup_KXnS"),children:[(0,a.jsx)(W,{}),(0,a.jsx)($,{})]})})}let Y={codeBlockContent:"codeBlockContent_cKMj",codeBlockTitle:"codeBlockTitle_U6Q0"};function q(e){let{className:t}=e,{metadata:n}=N();return(0,a.jsxs)(y,{as:"div",className:(0,i.Z)(t,n.className),children:[n.title&&(0,a.jsx)("div",{className:Y.codeBlockTitle,children:(0,a.jsx)(B,{children:n.title})}),(0,a.jsxs)("div",{className:Y.codeBlockContent,children:[(0,a.jsx)(z,{}),(0,a.jsx)(G,{})]})]})}function X(e){let t=function(e){let{prism:t}=(0,c.L)();return function(e){var t,n,r;let a=(n=(t={language:e.language,defaultLanguage:e.defaultLanguage,className:e.className}).language??function(e){if(!e)return;let t=e.split(" ").find(e=>e.startsWith("language-"));return t?.replace(/language-/,"")}(t.className)??t.defaultLanguage,n?.toLowerCase()??"text"),{lineClassNames:s,code:l}=function(e,t){let n=e.replace(/\r?\n$/,"");return function(e,t){let{metastring:n,magicComments:r}=t;if(n&&f.test(n)){let t=n.match(f).groups.range;if(0===r.length)throw Error(`A highlight range has been given in code block's metastring (\`\`\` ${n}), but no magic comment config is available. Docusaurus applies the first magic comment entry's className for metastring ranges.`);let a=r[0].className;return{lineClassNames:Object.fromEntries(m()(t).filter(e=>e>0).map(e=>[e-1,[a]])),code:e}}return null}(n,{...t})??function(e,t){let{language:n,magicComments:r}=t;if(void 0===n)return{lineClassNames:{},code:e};let a=function(e,t){switch(e){case"js":case"javascript":case"ts":case"typescript":return b(["js","jsBlock"],t);case"jsx":case"tsx":return b(["js","jsBlock","jsx"],t);case"html":return b(["js","jsBlock","html"],t);case"python":case"py":case"bash":return b(["bash"],t);case"markdown":case"md":return b(["html","jsx","bash"],t);case"tex":case"latex":case"matlab":return b(["tex"],t);case"lua":case"haskell":return b(["lua"],t);case"sql":return b(["lua","jsBlock"],t);case"wasm":return b(["wasm"],t);case"vb":case"vba":case"visual-basic":return b(["vb","rem"],t);case"vbnet":return b(["vbnet","rem"],t);case"batch":return b(["rem"],t);case"basic":return b(["rem","f90"],t);case"fsharp":return b(["js","ml"],t);case"ocaml":case"sml":return b(["ml"],t);case"fortran":return b(["f90"],t);case"cobol":return b(["cobol"],t);default:return b(v,t)}}(n,r),s=e.split(/\r?\n/),l=Object.fromEntries(r.map(e=>[e.className,{start:0,range:""}])),i=Object.fromEntries(r.filter(e=>e.line).map(e=>{let{className:t,line:n}=e;return[n,t]})),o=Object.fromEntries(r.filter(e=>e.block).map(e=>{let{className:t,block:n}=e;return[n.start,t]})),c=Object.fromEntries(r.filter(e=>e.block).map(e=>{let{className:t,block:n}=e;return[n.end,t]}));for(let e=0;e void 0!==e);i[n]?l[i[n]].range+=`${e},`:o[n]?l[o[n]].start=e:c[n]&&(l[c[n]].range+=`${l[c[n]].start}-${e-1},`),s.splice(e,1)}let d={};return Object.entries(l).forEach(e=>{let[t,{range:n}]=e;m()(n).forEach(e=>{d[e]??=[],d[e].push(t)})}),{code:s.join("\n"),lineClassNames:d}}(n,{...t})}(e.code,{metastring:e.metastring,magicComments:e.magicComments,language:a}),o=function(e){let{className:t,language:n}=e;return(0,i.Z)(t,n&&!t?.includes(`language-${n}`)&&`language-${n}`)}({className:e.className,language:a}),c=(r=e.metastring,(r?.match(x)?.groups.title??"")||e.title),d=function(e){let{showLineNumbers:t,metastring:n}=e;if("boolean"==typeof t)return t?1:void 0;if("number"==typeof t)return t;let r=n?.split(" ").find(e=>e.startsWith("showLineNumbers"));if(r)return r.startsWith("showLineNumbers=")?parseInt(r.replace("showLineNumbers=",""),10):1}({showLineNumbers:e.showLineNumbers,metastring:e.metastring});return{codeInput:e.code,code:l,className:o,language:a,title:c,lineNumbersStart:d,lineClassNames:s}}({code:e.children,className:e.className,metastring:e.metastring,magicComments:t.magicComments,defaultLanguage:t.defaultLanguage,language:e.language,title:e.title,showLineNumbers:e.showLineNumbers})}(e),n=function(){let[e,t]=(0,s.useState)(!1),[n,r]=(0,s.useState)(!1),a=(0,s.useRef)(null),l=(0,s.useCallback)(()=>{let n=a.current.querySelector("code");e?n.removeAttribute("style"):(n.style.whiteSpace="pre-wrap",n.style.overflowWrap="anywhere"),t(e=>!e)},[a,e]),i=(0,s.useCallback)(()=>{let{scrollWidth:e,clientWidth:t}=a.current;r(e>t||a.current.querySelector("code").hasAttribute("style"))},[a]),[o,c]=(0,s.useState)(),d=(0,s.useCallback)(()=>{c(a.current?.closest("[role=tabpanel][hidden]"))},[a,c]);return(0,s.useEffect)(()=>{d()},[d]),!function(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:_,r=(0,g.zX)(t),a=(0,g.Ql)(n);(0,s.useEffect)(()=>{let t=new MutationObserver(r);return e&&t.observe(e,a),()=>t.disconnect()},[e,r,a])}(o,e=>{e.forEach(e=>{"attributes"===e.type&&"hidden"===e.attributeName&&(i(),d())})},{attributes:!0,characterData:!1,childList:!1,subtree:!1}),(0,s.useEffect)(()=>{i()},[e,i]),(0,s.useEffect)(()=>(window.addEventListener("resize",i,{passive:!0}),()=>{window.removeEventListener("resize",i)}),[i]),{codeBlockRef:a,isEnabled:e,isCodeScrollable:n,toggle:l}}();return(0,a.jsx)(Z,{metadata:t,wordWrap:n,children:(0,a.jsx)(q,{})})}function Q(e){let{children:t,...n}=e,r=(0,l.Z)(),i=s.Children.toArray(t).some(e=>(0,s.isValidElement)(e))?t:Array.isArray(t)?t.join(""):t;return(0,a.jsx)("string"==typeof i?X:C,{...n,children:i},String(r))}var J=n(10075);let K=e=>`${e};`;function ee(e){let{code:t,children:n,...r}=e,s=d(),l=r.metastring?.includes("noInline")??!1;return(0,a.jsx)(J.nu,{noInline:l,theme:s,...r,code:t?.replace(/\n$/,""),transformCode:r.transformCode??K,children:n})}function et(e){let{children:t}=e;return(0,a.jsx)("div",{className:"playgroundContainer_TDLX",children:t})}var en=n(85108),er=n(67490);function ea(e){let{children:t}=e;return(0,a.jsx)("div",{className:(0,i.Z)("playgroundHeader_h_Hu"),children:t})}function es(){return(0,a.jsx)("div",{children:"Loading..."})}function el(){return(0,a.jsx)(E.Z,{fallback:(0,a.jsx)(es,{}),children:()=>(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(er.Z,{fallback:e=>(0,a.jsx)(en.Ac,{...e}),children:(0,a.jsx)(J.i5,{})}),(0,a.jsx)(J.IF,{})]})})}function ei(){return(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(ea,{children:(0,a.jsx)(H.Z,{id:"theme.Playground.result",description:"The result label of the live codeblocks",children:"Result"})}),(0,a.jsx)("div",{className:"playgroundPreview_u2xE",children:(0,a.jsx)(el,{})})]})}function eo(){let e=(0,l.Z)();return(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(ea,{children:(0,a.jsx)(H.Z,{id:"theme.Playground.liveEditor",description:"The live editor label of the live codeblocks",children:"Live Editor"})}),(0,a.jsx)(J.uz,{className:"playgroundEditor_uqZ4"},String(e))]})}function ec(){let{playgroundPosition:e}=(0,c.L)().liveCodeBlock;return(0,a.jsx)(a.Fragment,{children:"top"===e?(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(ei,{}),(0,a.jsx)(eo,{})]}):(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(eo,{}),(0,a.jsx)(ei,{})]})})}function ed(e){let{children:t,transformCode:n,...r}=e;return(0,a.jsx)(et,{children:(0,a.jsx)(ee,{code:t,...r,children:(0,a.jsx)(ec,{})})})}function eu(e){return(0,a.jsx)("button",{type:"button",...e,style:{backgroundColor:"white",color:"black",border:"solid red",borderRadius:20,padding:10,cursor:"pointer",...e.style}})}let eh={React:s,...s,...r};function em(e){return(0,a.jsx)(ed,{scope:eh,...e})}function eg(e){return e.live?(0,a.jsx)(em,{...e}):(0,a.jsx)(Q,{...e})}function ex(e){return(0,a.jsx)(eg,{...e})}}}]); \ No newline at end of file diff --git a/assets/js/0a818389.a87436a0.js b/assets/js/0a818389.a87436a0.js deleted file mode 100644 index a4ed05ce43..0000000000 --- a/assets/js/0a818389.a87436a0.js +++ /dev/null @@ -1,3 +0,0 @@ -"use strict";(self.webpackChunkwebsite=self.webpackChunkwebsite||[]).push([["51698"],{13244:function(e,n,s){s.r(n),s.d(n,{frontMatter:()=>d,default:()=>p,contentTitle:()=>h,assets:()=>u,toc:()=>g,metadata:()=>t});var t=JSON.parse('{"id":"guides/markdown-features/code-blocks","title":"Code blocks","description":"Handling code blocks in Docusaurus Markdown","source":"@site/docs/guides/markdown-features/markdown-features-code-blocks.mdx","sourceDirName":"guides/markdown-features","slug":"/markdown-features/code-blocks","permalink":"/docs/markdown-features/code-blocks","draft":false,"unlisted":false,"editUrl":"https://github.com/facebook/docusaurus/edit/main/website/docs/guides/markdown-features/markdown-features-code-blocks.mdx","tags":[],"version":"current","lastUpdatedBy":"Ben McCann","lastUpdatedAt":1744155424000,"frontMatter":{"id":"code-blocks","description":"Handling code blocks in Docusaurus Markdown","slug":"/markdown-features/code-blocks"},"sidebar":"docs","previous":{"title":"Tabs","permalink":"/docs/markdown-features/tabs"},"next":{"title":"Admonitions","permalink":"/docs/markdown-features/admonitions"}}'),r=s(85893),i=s(80980),l=s(15398),a=s(58636),o=s(14522),c=s(93278);let d={id:"code-blocks",description:"Handling code blocks in Docusaurus Markdown",slug:"/markdown-features/code-blocks"},h="Code blocks",u={},g=[{value:"Code title",id:"code-title",level:2},{value:"Syntax highlighting",id:"syntax-highlighting",level:2},{value:"Theming",id:"theming",level:3},{value:"Supported Languages",id:"supported-languages",level:3},{value:"Line highlighting",id:"line-highlighting",level:2},{value:"Highlighting with comments",id:"highlighting-with-comments",level:3},{value:"Highlighting with metadata string",id:"highlighting-with-metadata-string",level:3},{value:"Custom magic comments",id:"custom-magic-comments",level:3},{value:"Line numbering",id:"line-numbering",level:2},{value:"Interactive code editor",id:"interactive-code-editor",level:2},{value:"Imports",id:"imports",level:3},{value:"Imperative Rendering (noInline)",id:"imperative-rendering-noinline",level:3},{value:"Using JSX markup in code blocks",id:"using-jsx-markup",level:2},{value:"Multi-language support code blocks",id:"multi-language-support-code-blocks",level:2},{value:"Docusaurus npm2yarn remark plugin",id:"npm2yarn-remark-plugin",level:3},{value:"Configuration",id:"npm2yarn-remark-plugin-configuration",level:4},{value:"Usage in JSX",id:"usage-in-jsx",level:2}];function m(e){let n={a:"a",admonition:"admonition",code:"code",em:"em",h1:"h1",h2:"h2",h3:"h3",h4:"h4",header:"header",p:"p",pre:"pre",strong:"strong",table:"table",tbody:"tbody",td:"td",th:"th",thead:"thead",tr:"tr",...(0,i.a)(),...e.components};return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(n.header,{children:(0,r.jsx)(n.h1,{id:"code-blocks",children:"Code blocks"})}),"\n","\n",(0,r.jsx)(n.p,{children:"Code blocks within documentation are super-powered \uD83D\uDCAA."}),"\n",(0,r.jsx)(n.h2,{id:"code-title",children:"Code title"}),"\n",(0,r.jsxs)(n.p,{children:["You can add a title to the code block by adding a ",(0,r.jsx)(n.code,{children:"title"})," key after the language (leave a space between them)."]}),"\n",(0,r.jsx)(n.pre,{children:(0,r.jsx)(n.code,{className:"language-md",children:'```jsx title="/src/components/HelloCodeTitle.js"\nfunction HelloCodeTitle(props) {\n return Hello, {props.name}
;\n}\n```\n'})}),"\n",(0,r.jsx)(o.Z,{children:(0,r.jsx)(n.pre,{children:(0,r.jsx)(n.code,{className:"language-jsx",metastring:'title="/src/components/HelloCodeTitle.js"',children:"function HelloCodeTitle(props) {\n returnHello, {props.name}
;\n}\n"})})}),"\n",(0,r.jsx)(n.h2,{id:"syntax-highlighting",children:"Syntax highlighting"}),"\n",(0,r.jsxs)(n.p,{children:["Code blocks are text blocks wrapped around by strings of 3 backticks. You may check out ",(0,r.jsx)(n.a,{href:"https://mdxjs.com/docs/",children:"this reference"})," for the specifications of MDX."]}),"\n",(0,r.jsx)(n.pre,{children:(0,r.jsx)(n.code,{className:"language-md",children:"```js\nconsole.log('Every repo must come with a mascot.');\n```\n"})}),"\n",(0,r.jsxs)(n.p,{children:["Use the matching language meta string for your code block, and Docusaurus will pick up syntax highlighting automatically, powered by ",(0,r.jsx)(n.a,{href:"https://github.com/FormidableLabs/prism-react-renderer",children:"Prism React Renderer"}),"."]}),"\n",(0,r.jsx)(o.Z,{children:(0,r.jsx)(n.pre,{children:(0,r.jsx)(n.code,{className:"language-js",children:"console.log('Every repo must come with a mascot.');\n"})})}),"\n",(0,r.jsx)(n.h3,{id:"theming",children:"Theming"}),"\n",(0,r.jsxs)(n.p,{children:["By default, the Prism ",(0,r.jsx)(n.a,{href:"https://github.com/FormidableLabs/prism-react-renderer#theming",children:"syntax highlighting theme"})," we use is ",(0,r.jsx)(n.a,{href:"https://github.com/FormidableLabs/prism-react-renderer/blob/master/packages/prism-react-renderer/src/themes/palenight.ts",children:"Palenight"}),". You can change this to another theme by passing ",(0,r.jsx)(n.code,{children:"theme"})," field in ",(0,r.jsx)(n.code,{children:"prism"})," as ",(0,r.jsx)(n.code,{children:"themeConfig"})," in your docusaurus.config.js."]}),"\n",(0,r.jsxs)(n.p,{children:["For example, if you prefer to use the ",(0,r.jsx)(n.code,{children:"dracula"})," highlighting theme:"]}),"\n",(0,r.jsx)(n.pre,{children:(0,r.jsx)(n.code,{className:"language-js",metastring:'title="docusaurus.config.js"',children:"import {themes as prismThemes} from 'prism-react-renderer';\n\nexport default {\n themeConfig: {\n prism: {\n // highlight-next-line\n theme: prismThemes.dracula,\n },\n },\n};\n"})}),"\n",(0,r.jsxs)(n.p,{children:["Because a Prism theme is just a JS object, you can also write your own theme if you are not satisfied with the default. Docusaurus enhances the ",(0,r.jsx)(n.code,{children:"github"})," and ",(0,r.jsx)(n.code,{children:"vsDark"})," themes to provide richer highlight, and you can check our implementations for the ",(0,r.jsx)(n.a,{href:"https://github.com/facebook/docusaurus/blob/main/website/src/utils/prismLight.ts",children:"light"})," and ",(0,r.jsx)(n.a,{href:"https://github.com/facebook/docusaurus/blob/main/website/src/utils/prismDark.ts",children:"dark"})," code block themes."]}),"\n",(0,r.jsx)(n.h3,{id:"supported-languages",children:"Supported Languages"}),"\n",(0,r.jsxs)(n.p,{children:["By default, Docusaurus comes with a subset of ",(0,r.jsx)(n.a,{href:"https://github.com/FormidableLabs/prism-react-renderer/blob/master/packages/generate-prism-languages/index.ts#L9-L23",children:"commonly used languages"}),"."]}),"\n",(0,r.jsx)(n.admonition,{type:"warning",children:(0,r.jsx)(n.p,{children:"Some popular languages like Java, C#, or PHP are not enabled by default."})}),"\n",(0,r.jsxs)(n.p,{children:["To add syntax highlighting for any of the other ",(0,r.jsx)(n.a,{href:"https://prismjs.com/#supported-languages",children:"Prism-supported languages"}),", define it in an array of additional languages."]}),"\n",(0,r.jsx)(n.admonition,{type:"note",children:(0,r.jsxs)(n.p,{children:["Each additional language has to be a valid Prism component name. For example, Prism would map the ",(0,r.jsx)(n.em,{children:"language"})," ",(0,r.jsx)(n.code,{children:"cs"})," to ",(0,r.jsx)(n.code,{children:"csharp"}),", but only ",(0,r.jsx)(n.code,{children:"prism-csharp.js"})," exists as a ",(0,r.jsx)(n.em,{children:"component"}),", so you need to use ",(0,r.jsx)(n.code,{children:"additionalLanguages: ['csharp']"}),". You can look into ",(0,r.jsx)(n.code,{children:"node_modules/prismjs/components"})," to find all components (languages) available."]})}),"\n",(0,r.jsx)(n.p,{children:"For example, if you want to add highlighting for the PowerShell language:"}),"\n",(0,r.jsx)(n.pre,{children:(0,r.jsx)(n.code,{className:"language-js",metastring:'title="docusaurus.config.js"',children:"export default {\n // ...\n themeConfig: {\n prism: {\n // highlight-next-line\n additionalLanguages: ['powershell'],\n },\n // ...\n },\n};\n"})}),"\n",(0,r.jsxs)(n.p,{children:["After adding ",(0,r.jsx)(n.code,{children:"additionalLanguages"}),", restart Docusaurus."]}),"\n",(0,r.jsxs)(n.p,{children:["If you want to add highlighting for languages not yet supported by Prism, you can swizzle ",(0,r.jsx)(n.code,{children:"prism-include-languages"}),":"]}),"\n",(0,r.jsxs)(l.Z,{groupId:"npm2yarn",children:[(0,r.jsx)(a.Z,{value:"npm",children:(0,r.jsx)(n.pre,{children:(0,r.jsx)(n.code,{className:"language-bash",children:"npm run swizzle @docusaurus/theme-classic prism-include-languages\n"})})}),(0,r.jsx)(a.Z,{value:"yarn",label:"Yarn",children:(0,r.jsx)(n.pre,{children:(0,r.jsx)(n.code,{className:"language-bash",children:"yarn swizzle @docusaurus/theme-classic prism-include-languages\n"})})}),(0,r.jsx)(a.Z,{value:"pnpm",label:"pnpm",children:(0,r.jsx)(n.pre,{children:(0,r.jsx)(n.code,{className:"language-bash",children:"pnpm run swizzle @docusaurus/theme-classic prism-include-languages\n"})})}),(0,r.jsx)(a.Z,{value:"bun",label:"Bun",children:(0,r.jsx)(n.pre,{children:(0,r.jsx)(n.code,{className:"language-bash",children:"bun run swizzle @docusaurus/theme-classic prism-include-languages\n"})})})]}),"\n",(0,r.jsxs)(n.p,{children:["It will produce ",(0,r.jsx)(n.code,{children:"prism-include-languages.js"})," in your ",(0,r.jsx)(n.code,{children:"src/theme"})," folder. You can add highlighting support for custom languages by editing ",(0,r.jsx)(n.code,{children:"prism-include-languages.js"}),":"]}),"\n",(0,r.jsx)(n.pre,{children:(0,r.jsx)(n.code,{className:"language-js",metastring:'title="src/theme/prism-include-languages.js"',children:"const prismIncludeLanguages = (Prism) => {\n // ...\n\n additionalLanguages.forEach((lang) => {\n require(`prismjs/components/prism-${lang}`);\n });\n\n // highlight-next-line\n require('/path/to/your/prism-language-definition');\n\n // ...\n};\n"})}),"\n",(0,r.jsxs)(n.p,{children:["You can refer to ",(0,r.jsx)(n.a,{href:"https://github.com/PrismJS/prism/tree/master/components",children:"Prism's official language definitions"})," when you are writing your own language definitions."]}),"\n",(0,r.jsxs)(n.p,{children:["When adding a custom language definition, you do not need to add the language to the ",(0,r.jsx)(n.code,{children:"additionalLanguages"})," config array, since Docusaurus only looks up the ",(0,r.jsx)(n.code,{children:"additionalLanguages"})," strings in languages that Prism provides. Adding the language import in ",(0,r.jsx)(n.code,{children:"prism-include-languages.js"})," is sufficient."]}),"\n",(0,r.jsx)(n.h2,{id:"line-highlighting",children:"Line highlighting"}),"\n",(0,r.jsx)(n.h3,{id:"highlighting-with-comments",children:"Highlighting with comments"}),"\n",(0,r.jsxs)(n.p,{children:["You can use comments with ",(0,r.jsx)(n.code,{children:"highlight-next-line"}),", ",(0,r.jsx)(n.code,{children:"highlight-start"}),", and ",(0,r.jsx)(n.code,{children:"highlight-end"})," to select which lines are highlighted."]}),"\n",(0,r.jsx)(n.pre,{children:(0,r.jsx)(n.code,{className:"language-md",children:"```js\nfunction HighlightSomeText(highlight) {\n if (highlight) {\n // highlight-next-line\n return 'This text is highlighted!';\n }\n\n return 'Nothing highlighted';\n}\n\nfunction HighlightMoreText(highlight) {\n // highlight-start\n if (highlight) {\n return 'This range is highlighted!';\n }\n // highlight-end\n\n return 'Nothing highlighted';\n}\n```\n"})}),"\n",(0,r.jsx)(o.Z,{children:(0,r.jsx)(n.pre,{children:(0,r.jsx)(n.code,{className:"language-js",children:"function HighlightSomeText(highlight) {\n if (highlight) {\n // highlight-next-line\n return 'This text is highlighted!';\n }\n\n return 'Nothing highlighted';\n}\n\nfunction HighlightMoreText(highlight) {\n // highlight-start\n if (highlight) {\n return 'This range is highlighted!';\n }\n // highlight-end\n\n return 'Nothing highlighted';\n}\n"})})}),"\n",(0,r.jsx)(n.p,{children:"Supported commenting syntax:"}),"\n",(0,r.jsxs)(n.table,{children:[(0,r.jsx)(n.thead,{children:(0,r.jsxs)(n.tr,{children:[(0,r.jsx)(n.th,{children:"Style"}),(0,r.jsx)(n.th,{children:"Syntax"})]})}),(0,r.jsxs)(n.tbody,{children:[(0,r.jsxs)(n.tr,{children:[(0,r.jsx)(n.td,{children:"C-style"}),(0,r.jsxs)(n.td,{children:[(0,r.jsx)(n.code,{children:"/* ... */"})," and ",(0,r.jsx)(n.code,{children:"// ..."})]})]}),(0,r.jsxs)(n.tr,{children:[(0,r.jsx)(n.td,{children:"JSX-style"}),(0,r.jsx)(n.td,{children:(0,r.jsx)(n.code,{children:"{/* ... */}"})})]}),(0,r.jsxs)(n.tr,{children:[(0,r.jsx)(n.td,{children:"Bash-style"}),(0,r.jsx)(n.td,{children:(0,r.jsx)(n.code,{children:"# ..."})})]}),(0,r.jsxs)(n.tr,{children:[(0,r.jsx)(n.td,{children:"HTML-style"}),(0,r.jsx)(n.td,{children:(0,r.jsx)(n.code,{children:"\x3c!-- ... --\x3e"})})]})]})]}),"\n",(0,r.jsxs)(n.p,{children:["We will do our best to infer which set of comment styles to use based on the language, and default to allowing ",(0,r.jsx)(n.em,{children:"all"})," comment styles. If there's a comment style that is not currently supported, we are open to adding them! Pull requests welcome. Note that different comment styles have no semantic difference, only their content does."]}),"\n",(0,r.jsxs)(n.p,{children:["You can set your own background color for highlighted code line in your ",(0,r.jsx)(n.code,{children:"src/css/custom.css"})," which will better fit to your selected syntax highlighting theme. The color given below works for the default highlighting theme (Palenight), so if you are using another theme, you will have to tweak the color accordingly."]}),"\n",(0,r.jsx)(n.pre,{children:(0,r.jsx)(n.code,{className:"language-css",metastring:'title="/src/css/custom.css"',children:":root {\n --docusaurus-highlighted-code-line-bg: rgb(72, 77, 91);\n}\n\n/* If you have a different syntax highlighting theme for dark mode. */\n[data-theme='dark'] {\n /* Color which works with dark mode syntax highlighting theme */\n --docusaurus-highlighted-code-line-bg: rgb(100, 100, 100);\n}\n"})}),"\n",(0,r.jsxs)(n.p,{children:["If you also need to style the highlighted code line in some other way, you can target on ",(0,r.jsx)(n.code,{children:"theme-code-block-highlighted-line"})," CSS class."]}),"\n",(0,r.jsx)(n.h3,{id:"highlighting-with-metadata-string",children:"Highlighting with metadata string"}),"\n",(0,r.jsxs)(n.p,{children:["You can also specify highlighted line ranges within the language meta string (leave a space after the language). To highlight multiple lines, separate the line numbers by commas or use the range syntax to select a chunk of lines. This feature uses the ",(0,r.jsx)(n.code,{children:"parse-number-range"})," library and you can find ",(0,r.jsx)(n.a,{href:"https://www.npmjs.com/package/parse-numeric-range",children:"more syntax"})," on their project details."]}),"\n",(0,r.jsx)(n.pre,{children:(0,r.jsx)(n.code,{className:"language-md",children:"```jsx {1,4-6,11}\nimport React from 'react';\n\nfunction MyComponent(props) {\n if (props.isBar) {\n returnBar;\n }\n\n returnFoo;\n}\n\nexport default MyComponent;\n```\n"})}),"\n",(0,r.jsx)(o.Z,{children:(0,r.jsx)(n.pre,{children:(0,r.jsx)(n.code,{className:"language-jsx",metastring:"{1,4-6,11}",children:"import React from 'react';\n\nfunction MyComponent(props) {\n if (props.isBar) {\n returnBar;\n }\n\n returnFoo;\n}\n\nexport default MyComponent;\n"})})}),"\n",(0,r.jsxs)(n.admonition,{title:"prefer comments",type:"tip",children:[(0,r.jsx)(n.p,{children:"Prefer highlighting with comments where you can. By inlining highlight in the code, you don't have to manually count the lines if your code block becomes long. If you add/remove lines, you also don't have to offset your line ranges."}),(0,r.jsx)(n.pre,{children:(0,r.jsx)(n.code,{className:"language-diff",children:"- ```jsx {3}\n+ ```jsx {4}\n function HighlightSomeText(highlight) {\n if (highlight) {\n+ console.log('Highlighted text found');\n return 'This text is highlighted!';\n }\n\n return 'Nothing highlighted';\n }\n ```\n"})}),(0,r.jsx)(n.p,{children:"Below, we will introduce how the magic comment system can be extended to define custom directives and their functionalities. The magic comments would only be parsed if a highlight metastring is not present."})]}),"\n",(0,r.jsx)(n.h3,{id:"custom-magic-comments",children:"Custom magic comments"}),"\n",(0,r.jsxs)(n.p,{children:[(0,r.jsx)(n.code,{children:"// highlight-next-line"})," and ",(0,r.jsx)(n.code,{children:"// highlight-start"}),' etc. are called "magic comments", because they will be parsed and removed, and their purposes are to add metadata to the next line, or the section that the pair of start- and end-comments enclose.']}),"\n",(0,r.jsxs)(n.p,{children:["You can declare custom magic comments through theme config. For example, you can register another magic comment that adds a ",(0,r.jsx)(n.code,{children:"code-block-error-line"})," class name:"]}),"\n",(0,r.jsxs)(l.Z,{children:[(0,r.jsx)(a.Z,{value:"docusaurus.config.js",children:(0,r.jsx)(n.pre,{children:(0,r.jsx)(n.code,{className:"language-js",children:"export default {\n themeConfig: {\n prism: {\n magicComments: [\n // Remember to extend the default highlight class name as well!\n {\n className: 'theme-code-block-highlighted-line',\n line: 'highlight-next-line',\n block: {start: 'highlight-start', end: 'highlight-end'},\n },\n // highlight-start\n {\n className: 'code-block-error-line',\n line: 'This will error',\n },\n // highlight-end\n ],\n },\n },\n};\n"})})}),(0,r.jsx)(a.Z,{value:"src/css/custom.css",children:(0,r.jsx)(n.pre,{children:(0,r.jsx)(n.code,{className:"language-css",children:".code-block-error-line {\n background-color: #ff000020;\n display: block;\n margin: 0 calc(-1 * var(--ifm-pre-padding));\n padding: 0 var(--ifm-pre-padding);\n border-left: 3px solid #ff000080;\n}\n"})})}),(0,r.jsx)(a.Z,{value:"myDoc.md",children:(0,r.jsx)(n.pre,{children:(0,r.jsx)(n.code,{className:"language-md",children:"In JavaScript, trying to access properties on `null` will error.\n\n```js\nconst name = null;\n// This will error\nconsole.log(name.toUpperCase());\n// Uncaught TypeError: Cannot read properties of null (reading 'toUpperCase')\n```\n"})})})]}),"\n",(0,r.jsxs)(o.Z,{children:[(0,r.jsxs)(n.p,{children:["In JavaScript, trying to access properties on ",(0,r.jsx)(n.code,{children:"null"})," will error."]}),(0,r.jsx)(n.pre,{children:(0,r.jsx)(n.code,{className:"language-js",children:"const name = null;\n// This will error\nconsole.log(name.toUpperCase());\n// Uncaught TypeError: Cannot read properties of null (reading 'toUpperCase')\n"})})]}),"\n",(0,r.jsxs)(n.p,{children:["If you use number ranges in metastring (the ",(0,r.jsx)(n.code,{children:"{1,3-4}"})," syntax), Docusaurus will apply the ",(0,r.jsxs)(n.strong,{children:["first ",(0,r.jsx)(n.code,{children:"magicComments"})," entry"]}),"'s class name. This, by default, is ",(0,r.jsx)(n.code,{children:"theme-code-block-highlighted-line"}),", but if you change the ",(0,r.jsx)(n.code,{children:"magicComments"})," config and use a different entry as the first one, the meaning of the metastring range will change as well."]}),"\n",(0,r.jsxs)(n.p,{children:["You can disable the default line highlighting comments with ",(0,r.jsx)(n.code,{children:"magicComments: []"}),". If there's no magic comment config, but Docusaurus encounters a code block containing a metastring range, it will error because there will be no class name to apply\u2014the highlighting class name, after all, is just a magic comment entry."]}),"\n",(0,r.jsxs)(n.p,{children:["Every magic comment entry will contain three keys: ",(0,r.jsx)(n.code,{children:"className"})," (required), ",(0,r.jsx)(n.code,{children:"line"}),", which applies to the directly next line, or ",(0,r.jsx)(n.code,{children:"block"})," (containing ",(0,r.jsx)(n.code,{children:"start"})," and ",(0,r.jsx)(n.code,{children:"end"}),"), which applies to the entire block enclosed by the two comments."]}),"\n",(0,r.jsxs)(n.p,{children:["Using CSS to target the class can already do a lot, but you can unlock the full potential of this feature through ",(0,r.jsx)(n.a,{href:"/docs/swizzling",children:"swizzling"}),"."]}),"\n",(0,r.jsxs)(l.Z,{groupId:"npm2yarn",children:[(0,r.jsx)(a.Z,{value:"npm",children:(0,r.jsx)(n.pre,{children:(0,r.jsx)(n.code,{className:"language-bash",children:"npm run swizzle @docusaurus/theme-classic CodeBlock/Line\n"})})}),(0,r.jsx)(a.Z,{value:"yarn",label:"Yarn",children:(0,r.jsx)(n.pre,{children:(0,r.jsx)(n.code,{className:"language-bash",children:"yarn swizzle @docusaurus/theme-classic CodeBlock/Line\n"})})}),(0,r.jsx)(a.Z,{value:"pnpm",label:"pnpm",children:(0,r.jsx)(n.pre,{children:(0,r.jsx)(n.code,{className:"language-bash",children:"pnpm run swizzle @docusaurus/theme-classic CodeBlock/Line\n"})})}),(0,r.jsx)(a.Z,{value:"bun",label:"Bun",children:(0,r.jsx)(n.pre,{children:(0,r.jsx)(n.code,{className:"language-bash",children:"bun run swizzle @docusaurus/theme-classic CodeBlock/Line\n"})})})]}),"\n",(0,r.jsxs)(n.p,{children:["The ",(0,r.jsx)(n.code,{children:"Line"})," component will receive the list of class names, based on which you can conditionally render different markup."]}),"\n",(0,r.jsx)(n.h2,{id:"line-numbering",children:"Line numbering"}),"\n",(0,r.jsxs)(n.p,{children:["You can enable line numbering for your code block by using ",(0,r.jsx)(n.code,{children:"showLineNumbers"})," key within the language meta string (don't forget to add space directly before the key)."]}),"\n",(0,r.jsx)(n.pre,{children:(0,r.jsx)(n.code,{className:"language-md",children:"```jsx showLineNumbers\nimport React from 'react';\n\nexport default function MyComponent(props) {\n returnFoo;\n}\n```\n"})}),"\n",(0,r.jsx)(o.Z,{children:(0,r.jsx)(n.pre,{children:(0,r.jsx)(n.code,{className:"language-jsx",metastring:"showLineNumbers",children:"import React from 'react';\n\nexport default function MyComponent(props) {\n returnFoo;\n}\n"})})}),"\n",(0,r.jsx)(n.p,{children:"By default, the counter starts at line number 1. It's possible to pass a custom counter start value to split large code blocks for readability:"}),"\n",(0,r.jsx)(n.pre,{children:(0,r.jsx)(n.code,{className:"language-md",children:"```jsx showLineNumbers=3\nexport default function MyComponent(props) {\n returnFoo;\n}\n```\n"})}),"\n",(0,r.jsx)(o.Z,{children:(0,r.jsx)(n.pre,{children:(0,r.jsx)(n.code,{className:"language-jsx",metastring:"showLineNumbers=3",children:"export default function MyComponent(props) {\n returnFoo;\n}\n"})})}),"\n",(0,r.jsx)(n.h2,{id:"interactive-code-editor",children:"Interactive code editor"}),"\n",(0,r.jsxs)(n.p,{children:["(Powered by ",(0,r.jsx)(n.a,{href:"https://github.com/FormidableLabs/react-live",children:"React Live"}),")"]}),"\n",(0,r.jsxs)(n.p,{children:["You can create an interactive coding editor with the ",(0,r.jsx)(n.code,{children:"@docusaurus/theme-live-codeblock"})," plugin. First, add the plugin to your package."]}),"\n",(0,r.jsxs)(l.Z,{groupId:"npm2yarn",children:[(0,r.jsx)(a.Z,{value:"npm",children:(0,r.jsx)(n.pre,{children:(0,r.jsx)(n.code,{className:"language-bash",children:"npm install --save @docusaurus/theme-live-codeblock\n"})})}),(0,r.jsx)(a.Z,{value:"yarn",label:"Yarn",children:(0,r.jsx)(n.pre,{children:(0,r.jsx)(n.code,{className:"language-bash",children:"yarn add @docusaurus/theme-live-codeblock\n"})})}),(0,r.jsx)(a.Z,{value:"pnpm",label:"pnpm",children:(0,r.jsx)(n.pre,{children:(0,r.jsx)(n.code,{className:"language-bash",children:"pnpm add @docusaurus/theme-live-codeblock\n"})})}),(0,r.jsx)(a.Z,{value:"bun",label:"Bun",children:(0,r.jsx)(n.pre,{children:(0,r.jsx)(n.code,{className:"language-bash",children:"bun add @docusaurus/theme-live-codeblock\n"})})})]}),"\n",(0,r.jsxs)(n.p,{children:["You will also need to add the plugin to your ",(0,r.jsx)(n.code,{children:"docusaurus.config.js"}),"."]}),"\n",(0,r.jsx)(n.pre,{children:(0,r.jsx)(n.code,{className:"language-js",metastring:"{3}",children:"export default {\n // ...\n themes: ['@docusaurus/theme-live-codeblock'],\n // ...\n};\n"})}),"\n",(0,r.jsxs)(n.p,{children:["To use the plugin, create a code block with ",(0,r.jsx)(n.code,{children:"live"})," attached to the language meta string."]}),"\n",(0,r.jsx)(n.pre,{children:(0,r.jsx)(n.code,{className:"language-md",children:"```jsx live\nfunction Clock(props) {\n const [date, setDate] = useState(new Date());\n useEffect(() => {\n const timerID = setInterval(() => tick(), 1000);\n\n return function cleanup() {\n clearInterval(timerID);\n };\n });\n\n function tick() {\n setDate(new Date());\n }\n\n return (\n\n\n );\n}\n```\n"})}),"\n",(0,r.jsx)(n.p,{children:"The code block will be rendered as an interactive editor. Changes to the code will reflect on the result panel live."}),"\n",(0,r.jsx)(o.Z,{children:(0,r.jsx)(n.pre,{children:(0,r.jsx)(n.code,{className:"language-jsx",metastring:"live",live:!0,children:"function Clock(props) {\n const [date, setDate] = useState(new Date());\n useEffect(() => {\n const timerID = setInterval(() => tick(), 1000);\n\n return function cleanup() {\n clearInterval(timerID);\n };\n });\n\n function tick() {\n setDate(new Date());\n }\n\n return (\nIt is {date.toLocaleTimeString()}.
\n\n\n );\n}\n"})})}),"\n",(0,r.jsx)(n.h3,{id:"imports",children:"Imports"}),"\n",(0,r.jsx)(n.admonition,{title:"react-live and imports",type:"warning",children:(0,r.jsx)(n.p,{children:"It is not possible to import components directly from the react-live code editor, you have to define available imports upfront."})}),"\n",(0,r.jsx)(n.p,{children:"By default, all React imports are available. If you need more imports available, swizzle the react-live scope:"}),"\n",(0,r.jsxs)(l.Z,{groupId:"npm2yarn",children:[(0,r.jsx)(a.Z,{value:"npm",children:(0,r.jsx)(n.pre,{children:(0,r.jsx)(n.code,{className:"language-bash",children:"npm run swizzle @docusaurus/theme-live-codeblock ReactLiveScope -- --eject\n"})})}),(0,r.jsx)(a.Z,{value:"yarn",label:"Yarn",children:(0,r.jsx)(n.pre,{children:(0,r.jsx)(n.code,{className:"language-bash",children:"yarn swizzle @docusaurus/theme-live-codeblock ReactLiveScope --eject\n"})})}),(0,r.jsx)(a.Z,{value:"pnpm",label:"pnpm",children:(0,r.jsx)(n.pre,{children:(0,r.jsx)(n.code,{className:"language-bash",children:"pnpm run swizzle @docusaurus/theme-live-codeblock ReactLiveScope --eject\n"})})}),(0,r.jsx)(a.Z,{value:"bun",label:"Bun",children:(0,r.jsx)(n.pre,{children:(0,r.jsx)(n.code,{className:"language-bash",children:"bun run swizzle @docusaurus/theme-live-codeblock ReactLiveScope --eject\n"})})})]}),"\n",(0,r.jsx)(n.pre,{children:(0,r.jsx)(n.code,{className:"language-jsx",metastring:'title="src/theme/ReactLiveScope/index.js"',children:"import React from 'react';\n\n// highlight-start\nconst ButtonExample = (props) => (\n \n);\n// highlight-end\n\n// Add react-live imports you need here\nconst ReactLiveScope = {\n React,\n ...React,\n // highlight-next-line\n ButtonExample,\n};\n\nexport default ReactLiveScope;\n"})}),"\n",(0,r.jsxs)(n.p,{children:["The ",(0,r.jsx)(n.code,{children:"ButtonExample"})," component is now available to use:"]}),"\n",(0,r.jsx)(o.Z,{children:(0,r.jsx)(n.pre,{children:(0,r.jsx)(n.code,{className:"language-jsx",metastring:"live",live:!0,children:"function MyPlayground(props) {\n return (\nIt is {date.toLocaleTimeString()}.
\n\n\n );\n}\n"})})}),"\n",(0,r.jsx)(n.h3,{id:"imperative-rendering-noinline",children:"Imperative Rendering (noInline)"}),"\n",(0,r.jsxs)(n.p,{children:["The ",(0,r.jsx)(n.code,{children:"noInline"})," option should be used to avoid errors when your code spans multiple components or variables."]}),"\n",(0,r.jsx)(n.pre,{children:(0,r.jsx)(n.code,{className:"language-md",children:"```jsx live noInline\nconst project = 'Docusaurus';\n\nconst Greeting = () =>alert('hey!')}>Click me \nHello {project}!
;\n\nrender();\n```\n"})}),"\n",(0,r.jsxs)(n.p,{children:["Unlike an ordinary interactive code block, when using ",(0,r.jsx)(n.code,{children:"noInline"})," React Live won't wrap your code in an inline function to render it."]}),"\n",(0,r.jsxs)(n.p,{children:["You will need to explicitly call ",(0,r.jsx)(n.code,{children:"render()"})," at the end of your code to display the output."]}),"\n",(0,r.jsx)(o.Z,{children:(0,r.jsx)(n.pre,{children:(0,r.jsx)(n.code,{className:"language-jsx",metastring:"live noInline",live:!0,children:'const project = "Docusaurus";\n\nconst Greeting = () => (\n Hello {project}!
\n);\n\nrender(\n\n);\n'})})}),"\n",(0,r.jsx)(n.h2,{id:"using-jsx-markup",children:"Using JSX markup in code blocks"}),"\n",(0,r.jsx)(n.p,{children:"Code block in Markdown always preserves its content as plain text, meaning you can't do something like:"}),"\n",(0,r.jsx)(n.pre,{children:(0,r.jsx)(n.code,{className:"language-ts",children:'type EditUrlFunction = (params: {\n // This doesn\'t turn into a link (for good reason!)\n version: Version;\n versionDocsDirPath: string;\n docPath: string;\n permalink: string;\n locale: string;\n}) => string | undefined;\n'})}),"\n",(0,r.jsxs)(n.p,{children:["If you want to embed HTML markup such as anchor links or bold type, you can use the ",(0,r.jsx)(n.code,{children:" "})," tag, ",(0,r.jsx)(n.code,{children:""})," tag, or ",(0,r.jsx)(n.code,{children:"
"})," component."]}),"\n",(0,r.jsx)(n.pre,{children:(0,r.jsx)(n.code,{className:"language-jsx",children:" \n Input: 1 2 3 4{'\\n'}\n Output: \"366300745\"{'\\n'}\n\n"})}),"\n",(0,r.jsx)(o.Z,{children:(0,r.jsxs)("pre",{children:[(0,r.jsx)("b",{children:"Input: "}),"1 2 3 4\n",(0,r.jsx)("b",{children:"Output: "}),'"366300745"\n']})}),"\n",(0,r.jsx)(n.admonition,{title:"MDX is whitespace insensitive",type:"warning",children:(0,r.jsxs)(n.p,{children:["MDX is in line with JSX behavior: line break characters, even when inside ",(0,r.jsx)(n.code,{children:""}),", are turned into spaces. You have to explicitly write the new line character for it to be printed out."]})}),"\n",(0,r.jsx)(n.admonition,{type:"warning",children:(0,r.jsx)(n.p,{children:"Syntax highlighting only works on plain strings. Docusaurus will not attempt to parse code block content containing JSX children."})}),"\n",(0,r.jsx)(n.h2,{id:"multi-language-support-code-blocks",children:"Multi-language support code blocks"}),"\n",(0,r.jsx)(n.p,{children:"With MDX, you can easily create interactive components within your documentation, for example, to display code in multiple programming languages and switch between them using a tabs component."}),"\n",(0,r.jsxs)(n.p,{children:["Instead of implementing a dedicated component for multi-language support code blocks, we've implemented a general-purpose ",(0,r.jsx)(n.a,{href:"/docs/markdown-features/tabs",children:(0,r.jsx)(n.code,{children:""})})," component in the classic theme so that you can use it for other non-code scenarios as well."]}),"\n",(0,r.jsxs)(n.p,{children:["The following example is how you can have multi-language code tabs in your docs. Note that the empty lines above and below each language block are ",(0,r.jsx)(n.strong,{children:"intentional"}),". This is a ",(0,r.jsx)(n.a,{href:"/docs/markdown-features/react#markdown-and-jsx-interoperability",children:"current limitation of MDX"}),": you have to leave empty lines around Markdown syntax for the MDX parser to know that it's Markdown syntax and not JSX."]}),"\n",(0,r.jsx)(n.pre,{children:(0,r.jsx)(n.code,{className:"language-jsx",children:'import Tabs from \'@theme/Tabs\';\nimport TabItem from \'@theme/TabItem\';\n\n \n \n'})}),"\n",(0,r.jsx)(n.p,{children:"And you will get the following:"}),"\n",(0,r.jsx)(o.Z,{children:(0,r.jsxs)(l.Z,{children:[(0,r.jsx)(a.Z,{value:"js",label:"JavaScript",children:(0,r.jsx)(n.pre,{children:(0,r.jsx)(n.code,{className:"language-js",children:"function helloWorld() {\n console.log('Hello, world!');\n}\n"})})}),(0,r.jsx)(a.Z,{value:"py",label:"Python",children:(0,r.jsx)(n.pre,{children:(0,r.jsx)(n.code,{className:"language-py",children:'def hello_world():\n print("Hello, world!")\n'})})}),(0,r.jsx)(a.Z,{value:"java",label:"Java",children:(0,r.jsx)(n.pre,{children:(0,r.jsx)(n.code,{className:"language-java",children:'class HelloWorld {\n public static void main(String args[]) {\n System.out.println("Hello, World");\n }\n}\n'})})})]})}),"\n",(0,r.jsxs)(n.p,{children:["If you have multiple of these multi-language code tabs, and you want to sync the selection across the tab instances, refer to the ",(0,r.jsx)(n.a,{href:"/docs/markdown-features/tabs#syncing-tab-choices",children:"Syncing tab choices section"}),"."]}),"\n",(0,r.jsx)(n.h3,{id:"npm2yarn-remark-plugin",children:"Docusaurus npm2yarn remark plugin"}),"\n",(0,r.jsx)(n.p,{children:"Displaying CLI commands in both npm and Yarn is a very common need, for example:"}),"\n",(0,r.jsxs)(l.Z,{groupId:"npm2yarn",children:[(0,r.jsx)(a.Z,{value:"npm",children:(0,r.jsx)(n.pre,{children:(0,r.jsx)(n.code,{className:"language-bash",children:"npm install @docusaurus/remark-plugin-npm2yarn\n"})})}),(0,r.jsx)(a.Z,{value:"yarn",label:"Yarn",children:(0,r.jsx)(n.pre,{children:(0,r.jsx)(n.code,{className:"language-bash",children:"yarn add @docusaurus/remark-plugin-npm2yarn\n"})})}),(0,r.jsx)(a.Z,{value:"pnpm",label:"pnpm",children:(0,r.jsx)(n.pre,{children:(0,r.jsx)(n.code,{className:"language-bash",children:"pnpm add @docusaurus/remark-plugin-npm2yarn\n"})})}),(0,r.jsx)(a.Z,{value:"bun",label:"Bun",children:(0,r.jsx)(n.pre,{children:(0,r.jsx)(n.code,{className:"language-bash",children:"bun add @docusaurus/remark-plugin-npm2yarn\n"})})})]}),"\n",(0,r.jsxs)(n.p,{children:["Docusaurus provides such a utility out of the box, freeing you from using the ",(0,r.jsx)(n.code,{children:"Tabs"})," component every time. To enable this feature, first install the ",(0,r.jsx)(n.code,{children:"@docusaurus/remark-plugin-npm2yarn"})," package as above, and then in ",(0,r.jsx)(n.code,{children:"docusaurus.config.js"}),", for the plugins where you need this feature (doc, blog, pages, etc.), register it in the ",(0,r.jsx)(n.code,{children:"remarkPlugins"})," option. (See ",(0,r.jsx)(n.a,{href:"/docs/api/plugins/@docusaurus/plugin-content-docs#ex-config",children:"Docs configuration"})," for more details on configuration format)"]}),"\n",(0,r.jsx)(n.pre,{children:(0,r.jsx)(n.code,{className:"language-js",metastring:'title="docusaurus.config.js"',children:"export default {\n // ...\n presets: [\n [\n '@docusaurus/preset-classic',\n {\n docs: {\n // highlight-start\n remarkPlugins: [\n [require('@docusaurus/remark-plugin-npm2yarn'), {sync: true}],\n ],\n // highlight-end\n },\n pages: {\n // highlight-next-line\n remarkPlugins: [require('@docusaurus/remark-plugin-npm2yarn')],\n },\n blog: {\n // highlight-start\n remarkPlugins: [\n [\n require('@docusaurus/remark-plugin-npm2yarn'),\n {converters: ['pnpm']},\n ],\n ],\n // highlight-end\n // ...\n },\n },\n ],\n ],\n};\n"})}),"\n",(0,r.jsxs)(n.p,{children:["And then use it by adding the ",(0,r.jsx)(n.code,{children:"npm2yarn"})," key to the code block:"]}),"\n",(0,r.jsx)(n.pre,{children:(0,r.jsx)(n.code,{className:"language-md",children:"```bash npm2yarn\nnpm install @docusaurus/remark-plugin-npm2yarn\n```\n"})}),"\n",(0,r.jsx)(n.h4,{id:"npm2yarn-remark-plugin-configuration",children:"Configuration"}),"\n",(0,r.jsxs)(n.table,{children:[(0,r.jsx)(n.thead,{children:(0,r.jsxs)(n.tr,{children:[(0,r.jsx)(n.th,{children:"Option"}),(0,r.jsx)(n.th,{children:"Type"}),(0,r.jsx)(n.th,{children:"Default"}),(0,r.jsx)(n.th,{children:"Description"})]})}),(0,r.jsxs)(n.tbody,{children:[(0,r.jsxs)(n.tr,{children:[(0,r.jsx)(n.td,{children:(0,r.jsx)(n.code,{children:"sync"})}),(0,r.jsx)(n.td,{children:(0,r.jsx)(n.code,{children:"boolean"})}),(0,r.jsx)(n.td,{children:(0,r.jsx)(n.code,{children:"false"})}),(0,r.jsx)(n.td,{children:"Whether to sync the selected converter across all code blocks."})]}),(0,r.jsxs)(n.tr,{children:[(0,r.jsx)(n.td,{children:(0,r.jsx)(n.code,{children:"converters"})}),(0,r.jsx)(n.td,{children:(0,r.jsx)(n.code,{children:"array"})}),(0,r.jsxs)(n.td,{children:[(0,r.jsx)(n.code,{children:"'yarn'"}),", ",(0,r.jsx)(n.code,{children:"'pnpm'"})]}),(0,r.jsx)(n.td,{children:"The list of converters to use. The order of the converters is important, as the first converter will be used as the default choice."})]})]})]}),"\n",(0,r.jsx)(n.h2,{id:"usage-in-jsx",children:"Usage in JSX"}),"\n",(0,r.jsxs)(n.p,{children:["Outside of Markdown, you can use the ",(0,r.jsx)(n.code,{children:"@theme/CodeBlock"})," component to get the same output."]}),"\n",(0,r.jsx)(n.pre,{children:(0,r.jsx)(n.code,{className:"language-jsx",children:'import CodeBlock from \'@theme/CodeBlock\';\n\nexport default function MyReactPage() {\n return (\n\n\n```js\nfunction helloWorld() {\n console.log(\'Hello, world!\');\n}\n```\n\n \n\n\n```py\ndef hello_world():\n print("Hello, world!")\n```\n\n \n\n\n```java\nclass HelloWorld {\n public static void main(String args[]) {\n System.out.println("Hello, World");\n }\n}\n```\n\n \n\n {/* highlight-start */}\n\n );\n}\n'})}),"\n",(0,r.jsx)(o.Z,{children:(0,r.jsx)(c.Z,{language:"jsx",title:"/src/components/HelloCodeTitle.js",showLineNumbers:!0,children:`function HelloCodeTitle(props) { -return\n {`function HelloCodeTitle(props) {\n return \n {/* highlight-end */}\nHello, {props.name}
;\n}`}\nHello, {props.name}
; -}`})}),"\n",(0,r.jsxs)(n.p,{children:["The props accepted are ",(0,r.jsx)(n.code,{children:"language"}),", ",(0,r.jsx)(n.code,{children:"title"})," and ",(0,r.jsx)(n.code,{children:"showLineNumbers"}),", in the same way as you write Markdown code blocks."]}),"\n",(0,r.jsxs)(n.p,{children:["Although discouraged, you can also pass in a ",(0,r.jsx)(n.code,{children:"metastring"})," prop like ",(0,r.jsx)(n.code,{children:"metastring='{1-2} title=\"/src/components/HelloCodeTitle.js\" showLineNumbers'"}),", which is how Markdown code blocks are handled under the hood. However, we recommend you ",(0,r.jsx)(n.a,{href:"#highlighting-with-comments",children:"use comments for highlighting lines"}),"."]}),"\n",(0,r.jsxs)(n.p,{children:["As ",(0,r.jsx)(n.a,{href:"#using-jsx-markup",children:"previously stated"}),", syntax highlighting is only applied when the children is a simple string."]})]})}function p(e={}){let{wrapper:n}={...(0,i.a)(),...e.components};return n?(0,r.jsx)(n,{...e,children:(0,r.jsx)(m,{...e})}):m(e)}},58636:function(e,n,s){s.d(n,{Z:()=>i});var t=s(85893);s(67294);var r=s(90496);function i(e){let{children:n,hidden:s,className:i}=e;return(0,t.jsx)("div",{role:"tabpanel",className:(0,r.Z)("tabItem_pnkT",i),hidden:s,children:n})}},15398:function(e,n,s){s.d(n,{Z:()=>f});var t=s(85893),r=s(67294),i=s(90496),l=s(54947),a=s(3620),o=s(844),c=s(97486),d=s(32263),h=s(16971);function u(e){return r.Children.toArray(e).filter(e=>"\n"!==e).map(e=>{if(!e||(0,r.isValidElement)(e)&&function(e){let{props:n}=e;return!!n&&"object"==typeof n&&"value"in n}(e))return e;throw Error(`Docusaurus error: Badchild <${"string"==typeof e.type?e.type:e.type.name}>: all children of the component should be , and every should have a unique "value" prop.`)})?.filter(Boolean)??[]}function g(e){let{value:n,tabValues:s}=e;return s.some(e=>e.value===n)}var m=s(71607);function p(e){let{className:n,block:s,selectedValue:r,selectValue:a,tabValues:o}=e,c=[],{blockElementScrollPositionUntilNextRender:d}=(0,l.o5)(),h=e=>{let n=e.currentTarget,s=o[c.indexOf(n)].value;s!==r&&(d(n),a(s))},u=e=>{let n=null;switch(e.key){case"Enter":h(e);break;case"ArrowRight":{let s=c.indexOf(e.currentTarget)+1;n=c[s]??c[0];break}case"ArrowLeft":{let s=c.indexOf(e.currentTarget)-1;n=c[s]??c[c.length-1]}}n?.focus()};return(0,t.jsx)("ul",{role:"tablist","aria-orientation":"horizontal",className:(0,i.Z)("tabs",{"tabs--block":s},n),children:o.map(e=>{let{value:n,label:s,attributes:l}=e;return(0,t.jsx)("li",{role:"tab",tabIndex:r===n?0:-1,"aria-selected":r===n,ref:e=>{c.push(e)},onKeyDown:u,onClick:h,...l,className:(0,i.Z)("tabs__item","tabItem_AQgk",l?.className,{"tabs__item--active":r===n}),children:s??n},n)})})}function x(e){let{lazy:n,children:s,selectedValue:l}=e,a=(Array.isArray(s)?s:[s]).filter(Boolean);if(n){let e=a.find(e=>e.props.value===l);return e?(0,r.cloneElement)(e,{className:(0,i.Z)("margin-top--md",e.props.className)}):null}return(0,t.jsx)("div",{className:"margin-top--md",children:a.map((e,n)=>(0,r.cloneElement)(e,{key:n,hidden:e.props.value!==l}))})}function j(e){let n=function(e){let{defaultValue:n,queryString:s=!1,groupId:t}=e,i=function(e){let{values:n,children:s}=e;return(0,r.useMemo)(()=>{let e=n??u(s).map(e=>{let{props:{value:n,label:s,attributes:t,default:r}}=e;return{value:n,label:s,attributes:t,default:r}}),t=(0,d.lx)(e,(e,n)=>e.value===n.value);if(t.length>0)throw Error(`Docusaurus error: Duplicate values "${t.map(e=>e.value).join(", ")}" found in . Every value needs to be unique.`);return e},[n,s])}(e),[l,m]=(0,r.useState)(()=>(function(e){let{defaultValue:n,tabValues:s}=e;if(0===s.length)throw Error("Docusaurus error: the component requires at least one children component");if(n){if(!g({value:n,tabValues:s}))throw Error(`Docusaurus error: The has a defaultValue "${n}" but none of its children has the corresponding value. Available values are: ${s.map(e=>e.value).join(", ")}. If you intend to show no default tab, use defaultValue={null} instead.`);return n}let t=s.find(e=>e.default)??s[0];if(!t)throw Error("Unexpected error: 0 tabValues");return t.value})({defaultValue:n,tabValues:i})),[p,x]=function(e){let{queryString:n=!1,groupId:s}=e,t=(0,a.k6)(),i=function(e){let{queryString:n=!1,groupId:s}=e;if("string"==typeof n)return n;if(!1===n)return null;if(!0===n&&!s)throw Error('Docusaurus error: The component groupId prop is required if queryString=true, because this value is used as the search param name. You can also provide an explicit value such as queryString="my-search-param".');return s??null}({queryString:n,groupId:s});return[(0,c._X)(i),(0,r.useCallback)(e=>{if(!i)return;let n=new URLSearchParams(t.location.search);n.set(i,e),t.replace({...t.location,search:n.toString()})},[i,t])]}({queryString:s,groupId:t}),[j,f]=function(e){let{groupId:n}=e,s=n?`docusaurus.tab.${n}`:null,[t,i]=(0,h.Nk)(s);return[t,(0,r.useCallback)(e=>{s&&i.set(e)},[s,i])]}({groupId:t}),b=(()=>{let e=p??j;return g({value:e,tabValues:i})?e:null})();return(0,o.Z)(()=>{b&&m(b)},[b]),{selectedValue:l,selectValue:(0,r.useCallback)(e=>{if(!g({value:e,tabValues:i}))throw Error(`Can't select invalid tab value=${e}`);m(e),x(e),f(e)},[x,f,i]),tabValues:i}}(e);return(0,t.jsxs)("div",{className:(0,i.Z)("tabs-container","tabList_Qoir"),children:[(0,t.jsx)(p,{...n,...e}),(0,t.jsx)(x,{...n,...e})]})}function f(e){let n=(0,m.Z)();return(0,t.jsx)(j,{...e,children:u(e.children)},String(n))}},56497:function(e,n,s){s.d(n,{Z:()=>i});var t=s(85893);s(67294);var r=s(71607);function i(e){let{children:n,fallback:s}=e;return(0,r.Z)()?(0,t.jsx)(t.Fragment,{children:n?.()}):s??null}},14522:function(e,n,s){s.d(n,{Z:()=>a});var t=s(85893);s(67294);var r=s(90496);let i="dot_giz1",l="bar_rrRL";function a(e){let{children:n,minHeight:s,url:a="http://localhost:3000",style:o,bodyStyle:c}=e;return(0,t.jsxs)("div",{className:"browserWindow_my1Q",style:{...o,minHeight:s},children:[(0,t.jsxs)("div",{className:"browserWindowHeader_jXSR",children:[(0,t.jsxs)("div",{className:"buttons_uHc7",children:[(0,t.jsx)("span",{className:i,style:{background:"#f25f58"}}),(0,t.jsx)("span",{className:i,style:{background:"#fbbe3c"}}),(0,t.jsx)("span",{className:i,style:{background:"#58cb42"}})]}),(0,t.jsx)("div",{className:(0,r.Z)("browserWindowAddressBar_Pd8y","text--truncate"),children:a}),(0,t.jsx)("div",{className:"browserWindowMenuIcon_Vhuh",children:(0,t.jsxs)("div",{children:[(0,t.jsx)("span",{className:l}),(0,t.jsx)("span",{className:l}),(0,t.jsx)("span",{className:l})]})})]}),(0,t.jsx)("div",{className:"browserWindowBody_Idgs",style:c,children:n})]})}},93278:function(e,n,s){s.d(n,{Z:()=>eg});var t,r={};s.r(r),s.d(r,{ButtonExample:()=>L});var i=s(85893),l=s(67294),a=s(90496),o=s(71607),c=s(10075),d=s(77827),h=s(8156),u=s(56497),g=s(85108),m=s(45245),p=s(26378);function x(){let{prism:e}=(0,p.L)(),{colorMode:n}=(0,m.I)(),s=e.theme,t=e.darkTheme||s;return"dark"===n?t:s}var j=s(67490);function f(e){let{children:n}=e;return(0,i.jsx)("div",{className:(0,a.Z)("playgroundHeader_Tvsk"),children:n})}function b(){return(0,i.jsx)("div",{children:"Loading..."})}function y(){return(0,i.jsx)(u.Z,{fallback:(0,i.jsx)(b,{}),children:()=>(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(j.Z,{fallback:e=>(0,i.jsx)(g.Ac,{...e}),children:(0,i.jsx)(c.i5,{})}),(0,i.jsx)(c.IF,{})]})})}function v(){return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(f,{children:(0,i.jsx)(d.Z,{id:"theme.Playground.result",description:"The result label of the live codeblocks",children:"Result"})}),(0,i.jsx)("div",{className:"playgroundPreview_mApW",children:(0,i.jsx)(y,{})})]})}function k(){let e=(0,o.Z)();return(0,i.jsx)(c.uz,{className:"playgroundEditor_TySg"},String(e))}function w(){return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(f,{children:(0,i.jsx)(d.Z,{id:"theme.Playground.liveEditor",description:"The live editor label of the live codeblocks",children:"Live Editor"})}),(0,i.jsx)(k,{})]})}let N=e=>`${e};`;function C(e){let{children:n,transformCode:s,...t}=e,{siteConfig:{themeConfig:r}}=(0,h.Z)(),{liveCodeBlock:{playgroundPosition:l}}=r,a=x(),o=t.metastring?.includes("noInline")??!1;return(0,i.jsx)("div",{className:"playgroundContainer_6Ior",children:(0,i.jsx)(c.nu,{code:n?.replace(/\n$/,""),noInline:o,transformCode:s??N,theme:a,...t,children:"top"===l?(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(v,{}),(0,i.jsx)(w,{})]}):(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(w,{}),(0,i.jsx)(v,{})]})})})}function L(e){return(0,i.jsx)("button",{type:"button",...e,style:{backgroundColor:"white",color:"black",border:"solid red",borderRadius:20,padding:10,cursor:"pointer",...e.style}})}let T={React:l,...l,...r};var B=s(55951),I=s(6324),Z=s.n(I),S=s(50923);let D=/title=(? ["'])(?.*?)\1/,E=/\{(? [\d,-]+)\}/,H={js:{start:"\\/\\/",end:""},jsBlock:{start:"\\/\\*",end:"\\*\\/"},jsx:{start:"\\{\\s*\\/\\*",end:"\\*\\/\\s*\\}"},bash:{start:"#",end:""},html:{start:"\x3c!--",end:"--\x3e"}},M={...H,lua:{start:"--",end:""},wasm:{start:"\\;\\;",end:""},tex:{start:"%",end:""},vb:{start:"['\u2018\u2019]",end:""},vbnet:{start:"(?:_\\s*)?['\u2018\u2019]",end:""},rem:{start:"[Rr][Ee][Mm]\\b",end:""},f90:{start:"!",end:""},ml:{start:"\\(\\*",end:"\\*\\)"},cobol:{start:"\\*>",end:""}},_=Object.keys(H);function z(e,n){let s=e.map(e=>{let{start:s,end:t}=M[e];return`(?:${s}\\s*(${n.flatMap(e=>[e.line,e.block?.start,e.block?.end].filter(Boolean)).join("|")})\\s*${t})`}).join("|");return RegExp(`^\\s*(?:${s})\\s*$`)}let R=(0,l.createContext)(null);function P(e){let{metadata:n,wordWrap:s,children:t}=e,r=(0,l.useMemo)(()=>({metadata:n,wordWrap:s}),[n,s]);return(0,i.jsx)(R.Provider,{value:r,children:t})}function A(){let e=(0,l.useContext)(R);if(null===e)throw new S.i6("CodeBlockContextProvider");return e}function W(e){let{as:n,...s}=e,t=function(e){let n={color:"--prism-color",backgroundColor:"--prism-background-color"},s={};return Object.entries(e.plain).forEach(e=>{let[t,r]=e,i=n[t];i&&"string"==typeof r&&(s[i]=r)}),s}(x());return(0,i.jsx)(n,{...s,style:t,className:(0,a.Z)(s.className,"codeBlockContainer_jDV4",B.k.common.codeBlock)})}let F={codeBlock:"codeBlock_Gebt",codeBlockStandalone:"codeBlockStandalone_i_cY",codeBlockLines:"codeBlockLines_FJaf",codeBlockLinesWithNumbering:"codeBlockLinesWithNumbering_FU9Q"};function Y(e){let{children:n,className:s}=e;return(0,i.jsx)(W,{as:"pre",tabIndex:0,className:(0,a.Z)(F.codeBlockStandalone,"thin-scrollbar",s),children:(0,i.jsx)("code",{className:F.codeBlockLines,children:n})})}let $={attributes:!0,characterData:!0,childList:!0,subtree:!0};function U(e){let{children:n}=e;return n}var X=s(7316);function J(e){let{line:n,token:s,...t}=e;return(0,i.jsx)("span",{...t})}let q={codeLine:"codeLine_qRmp",codeLineNumber:"codeLineNumber_dS_J",codeLineContent:"codeLineContent_XF5l"};function O(e){let{line:n,classNames:s,showLineNumbers:t,getLineProps:r,getTokenProps:l}=e,o=function(e){let n=1===e.length&&"\n"===e[0].content?e[0]:void 0;return n?[{...n,content:""}]:e}(n),c=r({line:o,className:(0,a.Z)(s,t&&q.codeLine)}),d=o.map((e,n)=>{let s=l({token:e});return(0,i.jsx)(J,{...s,line:o,token:e,children:s.children},n)});return(0,i.jsxs)("span",{...c,children:[t?(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)("span",{className:q.codeLineNumber}),(0,i.jsx)("span",{className:q.codeLineContent,children:d})]}):d,(0,i.jsx)("br",{})]})}let V=l.forwardRef((e,n)=>(0,i.jsx)("pre",{ref:n,tabIndex:0,...e,className:(0,a.Z)(e.className,F.codeBlock,"thin-scrollbar")}));function G(e){let{metadata:n}=A();return(0,i.jsx)("code",{...e,className:(0,a.Z)(e.className,F.codeBlockLines,void 0!==n.lineNumbersStart&&F.codeBlockLinesWithNumbering),style:{...e.style,counterReset:void 0===n.lineNumbersStart?void 0:`line-count ${n.lineNumbersStart-1}`}})}function Q(e){let{className:n}=e,{metadata:s,wordWrap:t}=A(),r=x(),{code:l,language:o,lineNumbersStart:c,lineClassNames:d}=s;return(0,i.jsx)(X.y$,{theme:r,code:l,language:o,children:e=>{let{className:s,style:r,tokens:l,getLineProps:o,getTokenProps:h}=e;return(0,i.jsx)(V,{ref:t.codeBlockRef,className:(0,a.Z)(n,s),style:r,children:(0,i.jsx)(G,{children:l.map((e,n)=>(0,i.jsx)(O,{line:e,getLineProps:o,getTokenProps:h,classNames:d[n],showLineNumbers:void 0!==c},n))})})}})}var K=s(44771);function ee(e){let{className:n,...s}=e;return(0,i.jsx)("button",{type:"button",...s,className:(0,a.Z)("clean-btn",n)})}function en(e){return(0,i.jsx)("svg",{viewBox:"0 0 24 24",...e,children:(0,i.jsx)("path",{fill:"currentColor",d:"M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"})})}function es(e){return(0,i.jsx)("svg",{viewBox:"0 0 24 24",...e,children:(0,i.jsx)("path",{fill:"currentColor",d:"M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"})})}let et={copyButtonCopied:"copyButtonCopied_wDuR",copyButtonIcons:"copyButtonIcons_gMWc",copyButtonIcon:"copyButtonIcon_GXfb",copyButtonSuccessIcon:"copyButtonSuccessIcon_ktUX"};function er(e){let{className:n}=e,{copyCode:s,isCopied:t}=function(){let{metadata:{code:e}}=A(),[n,s]=(0,l.useState)(!1),t=(0,l.useRef)(void 0),r=(0,l.useCallback)(()=>{(0,K.Z)(e),s(!0),t.current=window.setTimeout(()=>{s(!1)},1e3)},[e]);return(0,l.useEffect)(()=>()=>window.clearTimeout(t.current),[]),{copyCode:r,isCopied:n}}();return(0,i.jsx)(ee,{"aria-label":t?(0,d.I)({id:"theme.CodeBlock.copied",message:"Copied",description:"The copied button label on code blocks"}):(0,d.I)({id:"theme.CodeBlock.copyButtonAriaLabel",message:"Copy code to clipboard",description:"The ARIA label for copy code blocks button"}),title:(0,d.I)({id:"theme.CodeBlock.copy",message:"Copy",description:"The copy button label on code blocks"}),className:(0,a.Z)(n,et.copyButton,t&&et.copyButtonCopied),onClick:s,children:(0,i.jsxs)("span",{className:et.copyButtonIcons,"aria-hidden":"true",children:[(0,i.jsx)(en,{className:et.copyButtonIcon}),(0,i.jsx)(es,{className:et.copyButtonSuccessIcon})]})})}function ei(e){return(0,i.jsx)("svg",{viewBox:"0 0 24 24",...e,children:(0,i.jsx)("path",{fill:"currentColor",d:"M4 19h6v-2H4v2zM20 5H4v2h16V5zm-3 6H4v2h13.25c1.1 0 2 .9 2 2s-.9 2-2 2H15v-2l-3 3l3 3v-2h2c2.21 0 4-1.79 4-4s-1.79-4-4-4z"})})}let el={wordWrapButtonIcon:"wordWrapButtonIcon___5r",wordWrapButtonEnabled:"wordWrapButtonEnabled_nam_"};function ea(e){let{className:n}=e,{wordWrap:s}=A();if(!(s.isEnabled||s.isCodeScrollable))return!1;let t=(0,d.I)({id:"theme.CodeBlock.wordWrapToggle",message:"Toggle word wrap",description:"The title attribute for toggle word wrapping button of code block lines"});return(0,i.jsx)(ee,{onClick:()=>s.toggle(),className:(0,a.Z)(n,s.isEnabled&&el.wordWrapButtonEnabled),"aria-label":t,title:t,children:(0,i.jsx)(ei,{className:el.wordWrapButtonIcon,"aria-hidden":"true"})})}function eo(e){let{className:n}=e;return(0,i.jsx)(u.Z,{children:()=>(0,i.jsxs)("div",{className:(0,a.Z)(n,"buttonGroup_KXnS"),children:[(0,i.jsx)(ea,{}),(0,i.jsx)(er,{})]})})}let ec={codeBlockContent:"codeBlockContent_cKMj",codeBlockTitle:"codeBlockTitle_U6Q0"};function ed(e){let{className:n}=e,{metadata:s}=A();return(0,i.jsxs)(W,{as:"div",className:(0,a.Z)(n,s.className),children:[s.title&&(0,i.jsx)("div",{className:ec.codeBlockTitle,children:(0,i.jsx)(U,{children:s.title})}),(0,i.jsxs)("div",{className:ec.codeBlockContent,children:[(0,i.jsx)(Q,{}),(0,i.jsx)(eo,{})]})]})}function eh(e){let n=function(e){let{prism:n}=(0,p.L)();return function(e){var n,s,t;let r=(s=(n={language:e.language,defaultLanguage:e.defaultLanguage,className:e.className}).language??function(e){if(!e)return;let n=e.split(" ").find(e=>e.startsWith("language-"));return n?.replace(/language-/,"")}(n.className)??n.defaultLanguage,s?.toLowerCase()??"text"),{lineClassNames:i,code:l}=function(e,n){let s=e.replace(/\r?\n$/,"");return function(e,n){let{metastring:s,magicComments:t}=n;if(s&&E.test(s)){let n=s.match(E).groups.range;if(0===t.length)throw Error(`A highlight range has been given in code block's metastring (\`\`\` ${s}), but no magic comment config is available. Docusaurus applies the first magic comment entry's className for metastring ranges.`);let r=t[0].className;return{lineClassNames:Object.fromEntries(Z()(n).filter(e=>e>0).map(e=>[e-1,[r]])),code:e}}return null}(s,{...n})??function(e,n){let{language:s,magicComments:t}=n;if(void 0===s)return{lineClassNames:{},code:e};let r=function(e,n){switch(e){case"js":case"javascript":case"ts":case"typescript":return z(["js","jsBlock"],n);case"jsx":case"tsx":return z(["js","jsBlock","jsx"],n);case"html":return z(["js","jsBlock","html"],n);case"python":case"py":case"bash":return z(["bash"],n);case"markdown":case"md":return z(["html","jsx","bash"],n);case"tex":case"latex":case"matlab":return z(["tex"],n);case"lua":case"haskell":return z(["lua"],n);case"sql":return z(["lua","jsBlock"],n);case"wasm":return z(["wasm"],n);case"vb":case"vba":case"visual-basic":return z(["vb","rem"],n);case"vbnet":return z(["vbnet","rem"],n);case"batch":return z(["rem"],n);case"basic":return z(["rem","f90"],n);case"fsharp":return z(["js","ml"],n);case"ocaml":case"sml":return z(["ml"],n);case"fortran":return z(["f90"],n);case"cobol":return z(["cobol"],n);default:return z(_,n)}}(s,t),i=e.split(/\r?\n/),l=Object.fromEntries(t.map(e=>[e.className,{start:0,range:""}])),a=Object.fromEntries(t.filter(e=>e.line).map(e=>{let{className:n,line:s}=e;return[s,n]})),o=Object.fromEntries(t.filter(e=>e.block).map(e=>{let{className:n,block:s}=e;return[s.start,n]})),c=Object.fromEntries(t.filter(e=>e.block).map(e=>{let{className:n,block:s}=e;return[s.end,n]}));for(let e=0;e void 0!==e);a[s]?l[a[s]].range+=`${e},`:o[s]?l[o[s]].start=e:c[s]&&(l[c[s]].range+=`${l[c[s]].start}-${e-1},`),i.splice(e,1)}let d={};return Object.entries(l).forEach(e=>{let[n,{range:s}]=e;Z()(s).forEach(e=>{d[e]??=[],d[e].push(n)})}),{code:i.join("\n"),lineClassNames:d}}(s,{...n})}(e.code,{metastring:e.metastring,magicComments:e.magicComments,language:r}),o=function(e){let{className:n,language:s}=e;return(0,a.Z)(n,s&&!n?.includes(`language-${s}`)&&`language-${s}`)}({className:e.className,language:r}),c=(t=e.metastring,(t?.match(D)?.groups.title??"")||e.title),d=function(e){let{showLineNumbers:n,metastring:s}=e;if("boolean"==typeof n)return n?1:void 0;if("number"==typeof n)return n;let t=s?.split(" ").find(e=>e.startsWith("showLineNumbers"));if(t)return t.startsWith("showLineNumbers=")?parseInt(t.replace("showLineNumbers=",""),10):1}({showLineNumbers:e.showLineNumbers,metastring:e.metastring});return{codeInput:e.code,code:l,className:o,language:r,title:c,lineNumbersStart:d,lineClassNames:i}}({code:e.children,className:e.className,metastring:e.metastring,magicComments:n.magicComments,defaultLanguage:n.defaultLanguage,language:e.language,title:e.title,showLineNumbers:e.showLineNumbers})}(e),s=function(){let[e,n]=(0,l.useState)(!1),[s,t]=(0,l.useState)(!1),r=(0,l.useRef)(null),i=(0,l.useCallback)(()=>{let s=r.current.querySelector("code");e?s.removeAttribute("style"):(s.style.whiteSpace="pre-wrap",s.style.overflowWrap="anywhere"),n(e=>!e)},[r,e]),a=(0,l.useCallback)(()=>{let{scrollWidth:e,clientWidth:n}=r.current;t(e>n||r.current.querySelector("code").hasAttribute("style"))},[r]),[o,c]=(0,l.useState)(),d=(0,l.useCallback)(()=>{c(r.current?.closest("[role=tabpanel][hidden]"))},[r,c]);return(0,l.useEffect)(()=>{d()},[d]),!function(e,n){let s=arguments.length>2&&void 0!==arguments[2]?arguments[2]:$,t=(0,S.zX)(n),r=(0,S.Ql)(s);(0,l.useEffect)(()=>{let n=new MutationObserver(t);return e&&n.observe(e,r),()=>n.disconnect()},[e,t,r])}(o,e=>{e.forEach(e=>{"attributes"===e.type&&"hidden"===e.attributeName&&(a(),d())})},{attributes:!0,characterData:!1,childList:!1,subtree:!1}),(0,l.useEffect)(()=>{a()},[e,a]),(0,l.useEffect)(()=>(window.addEventListener("resize",a,{passive:!0}),()=>{window.removeEventListener("resize",a)}),[a]),{codeBlockRef:r,isEnabled:e,isCodeScrollable:s,toggle:i}}();return(0,i.jsx)(P,{metadata:n,wordWrap:s,children:(0,i.jsx)(ed,{})})}let eu=(t=function(e){let{children:n,...s}=e,t=(0,o.Z)(),r=l.Children.toArray(n).some(e=>(0,l.isValidElement)(e))?n:Array.isArray(n)?n.join(""):n;return(0,i.jsx)("string"==typeof r?eh:Y,{...s,children:r},String(t))},function(e){return e.live?(0,i.jsx)(C,{scope:T,...e}):(0,i.jsx)(t,{...e})});function eg(e){return(0,i.jsx)(eu,{...e})}}}]); \ No newline at end of file diff --git a/assets/js/0a818389.d4d60160.js b/assets/js/0a818389.d4d60160.js new file mode 100644 index 0000000000..9e9aaecac7 --- /dev/null +++ b/assets/js/0a818389.d4d60160.js @@ -0,0 +1,3 @@ +"use strict";(self.webpackChunkwebsite=self.webpackChunkwebsite||[]).push([["51698"],{13244:function(e,n,s){s.r(n),s.d(n,{frontMatter:()=>d,default:()=>p,contentTitle:()=>h,assets:()=>u,toc:()=>g,metadata:()=>t});var t=JSON.parse('{"id":"guides/markdown-features/code-blocks","title":"Code blocks","description":"Handling code blocks in Docusaurus Markdown","source":"@site/docs/guides/markdown-features/markdown-features-code-blocks.mdx","sourceDirName":"guides/markdown-features","slug":"/markdown-features/code-blocks","permalink":"/docs/markdown-features/code-blocks","draft":false,"unlisted":false,"editUrl":"https://github.com/facebook/docusaurus/edit/main/website/docs/guides/markdown-features/markdown-features-code-blocks.mdx","tags":[],"version":"current","lastUpdatedBy":"S\xe9bastien Lorber","lastUpdatedAt":1744293302000,"frontMatter":{"id":"code-blocks","description":"Handling code blocks in Docusaurus Markdown","slug":"/markdown-features/code-blocks"},"sidebar":"docs","previous":{"title":"Tabs","permalink":"/docs/markdown-features/tabs"},"next":{"title":"Admonitions","permalink":"/docs/markdown-features/admonitions"}}'),r=s(85893),i=s(80980),l=s(15398),a=s(58636),o=s(14522),c=s(27817);let d={id:"code-blocks",description:"Handling code blocks in Docusaurus Markdown",slug:"/markdown-features/code-blocks"},h="Code blocks",u={},g=[{value:"Code title",id:"code-title",level:2},{value:"Syntax highlighting",id:"syntax-highlighting",level:2},{value:"Theming",id:"theming",level:3},{value:"Supported Languages",id:"supported-languages",level:3},{value:"Line highlighting",id:"line-highlighting",level:2},{value:"Highlighting with comments",id:"highlighting-with-comments",level:3},{value:"Highlighting with metadata string",id:"highlighting-with-metadata-string",level:3},{value:"Custom magic comments",id:"custom-magic-comments",level:3},{value:"Line numbering",id:"line-numbering",level:2},{value:"Interactive code editor",id:"interactive-code-editor",level:2},{value:"Imports",id:"imports",level:3},{value:"Imperative Rendering (noInline)",id:"imperative-rendering-noinline",level:3},{value:"Using JSX markup in code blocks",id:"using-jsx-markup",level:2},{value:"Multi-language support code blocks",id:"multi-language-support-code-blocks",level:2},{value:"Docusaurus npm2yarn remark plugin",id:"npm2yarn-remark-plugin",level:3},{value:"Configuration",id:"npm2yarn-remark-plugin-configuration",level:4},{value:"Usage in JSX",id:"usage-in-jsx",level:2}];function m(e){let n={a:"a",admonition:"admonition",code:"code",em:"em",h1:"h1",h2:"h2",h3:"h3",h4:"h4",header:"header",p:"p",pre:"pre",strong:"strong",table:"table",tbody:"tbody",td:"td",th:"th",thead:"thead",tr:"tr",...(0,i.a)(),...e.components};return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(n.header,{children:(0,r.jsx)(n.h1,{id:"code-blocks",children:"Code blocks"})}),"\n","\n",(0,r.jsx)(n.p,{children:"Code blocks within documentation are super-powered \uD83D\uDCAA."}),"\n",(0,r.jsx)(n.h2,{id:"code-title",children:"Code title"}),"\n",(0,r.jsxs)(n.p,{children:["You can add a title to the code block by adding a ",(0,r.jsx)(n.code,{children:"title"})," key after the language (leave a space between them)."]}),"\n",(0,r.jsx)(n.pre,{children:(0,r.jsx)(n.code,{className:"language-md",children:'```jsx title="/src/components/HelloCodeTitle.js"\nfunction HelloCodeTitle(props) {\n return Hello, {props.name}
;\n}\n```\n'})}),"\n",(0,r.jsx)(o.Z,{children:(0,r.jsx)(n.pre,{children:(0,r.jsx)(n.code,{className:"language-jsx",metastring:'title="/src/components/HelloCodeTitle.js"',children:"function HelloCodeTitle(props) {\n returnHello, {props.name}
;\n}\n"})})}),"\n",(0,r.jsx)(n.h2,{id:"syntax-highlighting",children:"Syntax highlighting"}),"\n",(0,r.jsxs)(n.p,{children:["Code blocks are text blocks wrapped around by strings of 3 backticks. You may check out ",(0,r.jsx)(n.a,{href:"https://mdxjs.com/docs/",children:"this reference"})," for the specifications of MDX."]}),"\n",(0,r.jsx)(n.pre,{children:(0,r.jsx)(n.code,{className:"language-md",children:"```js\nconsole.log('Every repo must come with a mascot.');\n```\n"})}),"\n",(0,r.jsxs)(n.p,{children:["Use the matching language meta string for your code block, and Docusaurus will pick up syntax highlighting automatically, powered by ",(0,r.jsx)(n.a,{href:"https://github.com/FormidableLabs/prism-react-renderer",children:"Prism React Renderer"}),"."]}),"\n",(0,r.jsx)(o.Z,{children:(0,r.jsx)(n.pre,{children:(0,r.jsx)(n.code,{className:"language-js",children:"console.log('Every repo must come with a mascot.');\n"})})}),"\n",(0,r.jsx)(n.h3,{id:"theming",children:"Theming"}),"\n",(0,r.jsxs)(n.p,{children:["By default, the Prism ",(0,r.jsx)(n.a,{href:"https://github.com/FormidableLabs/prism-react-renderer#theming",children:"syntax highlighting theme"})," we use is ",(0,r.jsx)(n.a,{href:"https://github.com/FormidableLabs/prism-react-renderer/blob/master/packages/prism-react-renderer/src/themes/palenight.ts",children:"Palenight"}),". You can change this to another theme by passing ",(0,r.jsx)(n.code,{children:"theme"})," field in ",(0,r.jsx)(n.code,{children:"prism"})," as ",(0,r.jsx)(n.code,{children:"themeConfig"})," in your docusaurus.config.js."]}),"\n",(0,r.jsxs)(n.p,{children:["For example, if you prefer to use the ",(0,r.jsx)(n.code,{children:"dracula"})," highlighting theme:"]}),"\n",(0,r.jsx)(n.pre,{children:(0,r.jsx)(n.code,{className:"language-js",metastring:'title="docusaurus.config.js"',children:"import {themes as prismThemes} from 'prism-react-renderer';\n\nexport default {\n themeConfig: {\n prism: {\n // highlight-next-line\n theme: prismThemes.dracula,\n },\n },\n};\n"})}),"\n",(0,r.jsxs)(n.p,{children:["Because a Prism theme is just a JS object, you can also write your own theme if you are not satisfied with the default. Docusaurus enhances the ",(0,r.jsx)(n.code,{children:"github"})," and ",(0,r.jsx)(n.code,{children:"vsDark"})," themes to provide richer highlight, and you can check our implementations for the ",(0,r.jsx)(n.a,{href:"https://github.com/facebook/docusaurus/blob/main/website/src/utils/prismLight.ts",children:"light"})," and ",(0,r.jsx)(n.a,{href:"https://github.com/facebook/docusaurus/blob/main/website/src/utils/prismDark.ts",children:"dark"})," code block themes."]}),"\n",(0,r.jsx)(n.h3,{id:"supported-languages",children:"Supported Languages"}),"\n",(0,r.jsxs)(n.p,{children:["By default, Docusaurus comes with a subset of ",(0,r.jsx)(n.a,{href:"https://github.com/FormidableLabs/prism-react-renderer/blob/master/packages/generate-prism-languages/index.ts#L9-L23",children:"commonly used languages"}),"."]}),"\n",(0,r.jsx)(n.admonition,{type:"warning",children:(0,r.jsx)(n.p,{children:"Some popular languages like Java, C#, or PHP are not enabled by default."})}),"\n",(0,r.jsxs)(n.p,{children:["To add syntax highlighting for any of the other ",(0,r.jsx)(n.a,{href:"https://prismjs.com/#supported-languages",children:"Prism-supported languages"}),", define it in an array of additional languages."]}),"\n",(0,r.jsx)(n.admonition,{type:"note",children:(0,r.jsxs)(n.p,{children:["Each additional language has to be a valid Prism component name. For example, Prism would map the ",(0,r.jsx)(n.em,{children:"language"})," ",(0,r.jsx)(n.code,{children:"cs"})," to ",(0,r.jsx)(n.code,{children:"csharp"}),", but only ",(0,r.jsx)(n.code,{children:"prism-csharp.js"})," exists as a ",(0,r.jsx)(n.em,{children:"component"}),", so you need to use ",(0,r.jsx)(n.code,{children:"additionalLanguages: ['csharp']"}),". You can look into ",(0,r.jsx)(n.code,{children:"node_modules/prismjs/components"})," to find all components (languages) available."]})}),"\n",(0,r.jsx)(n.p,{children:"For example, if you want to add highlighting for the PowerShell language:"}),"\n",(0,r.jsx)(n.pre,{children:(0,r.jsx)(n.code,{className:"language-js",metastring:'title="docusaurus.config.js"',children:"export default {\n // ...\n themeConfig: {\n prism: {\n // highlight-next-line\n additionalLanguages: ['powershell'],\n },\n // ...\n },\n};\n"})}),"\n",(0,r.jsxs)(n.p,{children:["After adding ",(0,r.jsx)(n.code,{children:"additionalLanguages"}),", restart Docusaurus."]}),"\n",(0,r.jsxs)(n.p,{children:["If you want to add highlighting for languages not yet supported by Prism, you can swizzle ",(0,r.jsx)(n.code,{children:"prism-include-languages"}),":"]}),"\n",(0,r.jsxs)(l.Z,{groupId:"npm2yarn",children:[(0,r.jsx)(a.Z,{value:"npm",children:(0,r.jsx)(n.pre,{children:(0,r.jsx)(n.code,{className:"language-bash",children:"npm run swizzle @docusaurus/theme-classic prism-include-languages\n"})})}),(0,r.jsx)(a.Z,{value:"yarn",label:"Yarn",children:(0,r.jsx)(n.pre,{children:(0,r.jsx)(n.code,{className:"language-bash",children:"yarn swizzle @docusaurus/theme-classic prism-include-languages\n"})})}),(0,r.jsx)(a.Z,{value:"pnpm",label:"pnpm",children:(0,r.jsx)(n.pre,{children:(0,r.jsx)(n.code,{className:"language-bash",children:"pnpm run swizzle @docusaurus/theme-classic prism-include-languages\n"})})}),(0,r.jsx)(a.Z,{value:"bun",label:"Bun",children:(0,r.jsx)(n.pre,{children:(0,r.jsx)(n.code,{className:"language-bash",children:"bun run swizzle @docusaurus/theme-classic prism-include-languages\n"})})})]}),"\n",(0,r.jsxs)(n.p,{children:["It will produce ",(0,r.jsx)(n.code,{children:"prism-include-languages.js"})," in your ",(0,r.jsx)(n.code,{children:"src/theme"})," folder. You can add highlighting support for custom languages by editing ",(0,r.jsx)(n.code,{children:"prism-include-languages.js"}),":"]}),"\n",(0,r.jsx)(n.pre,{children:(0,r.jsx)(n.code,{className:"language-js",metastring:'title="src/theme/prism-include-languages.js"',children:"const prismIncludeLanguages = (Prism) => {\n // ...\n\n additionalLanguages.forEach((lang) => {\n require(`prismjs/components/prism-${lang}`);\n });\n\n // highlight-next-line\n require('/path/to/your/prism-language-definition');\n\n // ...\n};\n"})}),"\n",(0,r.jsxs)(n.p,{children:["You can refer to ",(0,r.jsx)(n.a,{href:"https://github.com/PrismJS/prism/tree/master/components",children:"Prism's official language definitions"})," when you are writing your own language definitions."]}),"\n",(0,r.jsxs)(n.p,{children:["When adding a custom language definition, you do not need to add the language to the ",(0,r.jsx)(n.code,{children:"additionalLanguages"})," config array, since Docusaurus only looks up the ",(0,r.jsx)(n.code,{children:"additionalLanguages"})," strings in languages that Prism provides. Adding the language import in ",(0,r.jsx)(n.code,{children:"prism-include-languages.js"})," is sufficient."]}),"\n",(0,r.jsx)(n.h2,{id:"line-highlighting",children:"Line highlighting"}),"\n",(0,r.jsx)(n.h3,{id:"highlighting-with-comments",children:"Highlighting with comments"}),"\n",(0,r.jsxs)(n.p,{children:["You can use comments with ",(0,r.jsx)(n.code,{children:"highlight-next-line"}),", ",(0,r.jsx)(n.code,{children:"highlight-start"}),", and ",(0,r.jsx)(n.code,{children:"highlight-end"})," to select which lines are highlighted."]}),"\n",(0,r.jsx)(n.pre,{children:(0,r.jsx)(n.code,{className:"language-md",children:"```js\nfunction HighlightSomeText(highlight) {\n if (highlight) {\n // highlight-next-line\n return 'This text is highlighted!';\n }\n\n return 'Nothing highlighted';\n}\n\nfunction HighlightMoreText(highlight) {\n // highlight-start\n if (highlight) {\n return 'This range is highlighted!';\n }\n // highlight-end\n\n return 'Nothing highlighted';\n}\n```\n"})}),"\n",(0,r.jsx)(o.Z,{children:(0,r.jsx)(n.pre,{children:(0,r.jsx)(n.code,{className:"language-js",children:"function HighlightSomeText(highlight) {\n if (highlight) {\n // highlight-next-line\n return 'This text is highlighted!';\n }\n\n return 'Nothing highlighted';\n}\n\nfunction HighlightMoreText(highlight) {\n // highlight-start\n if (highlight) {\n return 'This range is highlighted!';\n }\n // highlight-end\n\n return 'Nothing highlighted';\n}\n"})})}),"\n",(0,r.jsx)(n.p,{children:"Supported commenting syntax:"}),"\n",(0,r.jsxs)(n.table,{children:[(0,r.jsx)(n.thead,{children:(0,r.jsxs)(n.tr,{children:[(0,r.jsx)(n.th,{children:"Style"}),(0,r.jsx)(n.th,{children:"Syntax"})]})}),(0,r.jsxs)(n.tbody,{children:[(0,r.jsxs)(n.tr,{children:[(0,r.jsx)(n.td,{children:"C-style"}),(0,r.jsxs)(n.td,{children:[(0,r.jsx)(n.code,{children:"/* ... */"})," and ",(0,r.jsx)(n.code,{children:"// ..."})]})]}),(0,r.jsxs)(n.tr,{children:[(0,r.jsx)(n.td,{children:"JSX-style"}),(0,r.jsx)(n.td,{children:(0,r.jsx)(n.code,{children:"{/* ... */}"})})]}),(0,r.jsxs)(n.tr,{children:[(0,r.jsx)(n.td,{children:"Bash-style"}),(0,r.jsx)(n.td,{children:(0,r.jsx)(n.code,{children:"# ..."})})]}),(0,r.jsxs)(n.tr,{children:[(0,r.jsx)(n.td,{children:"HTML-style"}),(0,r.jsx)(n.td,{children:(0,r.jsx)(n.code,{children:"\x3c!-- ... --\x3e"})})]})]})]}),"\n",(0,r.jsxs)(n.p,{children:["We will do our best to infer which set of comment styles to use based on the language, and default to allowing ",(0,r.jsx)(n.em,{children:"all"})," comment styles. If there's a comment style that is not currently supported, we are open to adding them! Pull requests welcome. Note that different comment styles have no semantic difference, only their content does."]}),"\n",(0,r.jsxs)(n.p,{children:["You can set your own background color for highlighted code line in your ",(0,r.jsx)(n.code,{children:"src/css/custom.css"})," which will better fit to your selected syntax highlighting theme. The color given below works for the default highlighting theme (Palenight), so if you are using another theme, you will have to tweak the color accordingly."]}),"\n",(0,r.jsx)(n.pre,{children:(0,r.jsx)(n.code,{className:"language-css",metastring:'title="/src/css/custom.css"',children:":root {\n --docusaurus-highlighted-code-line-bg: rgb(72, 77, 91);\n}\n\n/* If you have a different syntax highlighting theme for dark mode. */\n[data-theme='dark'] {\n /* Color which works with dark mode syntax highlighting theme */\n --docusaurus-highlighted-code-line-bg: rgb(100, 100, 100);\n}\n"})}),"\n",(0,r.jsxs)(n.p,{children:["If you also need to style the highlighted code line in some other way, you can target on ",(0,r.jsx)(n.code,{children:"theme-code-block-highlighted-line"})," CSS class."]}),"\n",(0,r.jsx)(n.h3,{id:"highlighting-with-metadata-string",children:"Highlighting with metadata string"}),"\n",(0,r.jsxs)(n.p,{children:["You can also specify highlighted line ranges within the language meta string (leave a space after the language). To highlight multiple lines, separate the line numbers by commas or use the range syntax to select a chunk of lines. This feature uses the ",(0,r.jsx)(n.code,{children:"parse-number-range"})," library and you can find ",(0,r.jsx)(n.a,{href:"https://www.npmjs.com/package/parse-numeric-range",children:"more syntax"})," on their project details."]}),"\n",(0,r.jsx)(n.pre,{children:(0,r.jsx)(n.code,{className:"language-md",children:"```jsx {1,4-6,11}\nimport React from 'react';\n\nfunction MyComponent(props) {\n if (props.isBar) {\n returnBar;\n }\n\n returnFoo;\n}\n\nexport default MyComponent;\n```\n"})}),"\n",(0,r.jsx)(o.Z,{children:(0,r.jsx)(n.pre,{children:(0,r.jsx)(n.code,{className:"language-jsx",metastring:"{1,4-6,11}",children:"import React from 'react';\n\nfunction MyComponent(props) {\n if (props.isBar) {\n returnBar;\n }\n\n returnFoo;\n}\n\nexport default MyComponent;\n"})})}),"\n",(0,r.jsxs)(n.admonition,{title:"prefer comments",type:"tip",children:[(0,r.jsx)(n.p,{children:"Prefer highlighting with comments where you can. By inlining highlight in the code, you don't have to manually count the lines if your code block becomes long. If you add/remove lines, you also don't have to offset your line ranges."}),(0,r.jsx)(n.pre,{children:(0,r.jsx)(n.code,{className:"language-diff",children:"- ```jsx {3}\n+ ```jsx {4}\n function HighlightSomeText(highlight) {\n if (highlight) {\n+ console.log('Highlighted text found');\n return 'This text is highlighted!';\n }\n\n return 'Nothing highlighted';\n }\n ```\n"})}),(0,r.jsx)(n.p,{children:"Below, we will introduce how the magic comment system can be extended to define custom directives and their functionalities. The magic comments would only be parsed if a highlight metastring is not present."})]}),"\n",(0,r.jsx)(n.h3,{id:"custom-magic-comments",children:"Custom magic comments"}),"\n",(0,r.jsxs)(n.p,{children:[(0,r.jsx)(n.code,{children:"// highlight-next-line"})," and ",(0,r.jsx)(n.code,{children:"// highlight-start"}),' etc. are called "magic comments", because they will be parsed and removed, and their purposes are to add metadata to the next line, or the section that the pair of start- and end-comments enclose.']}),"\n",(0,r.jsxs)(n.p,{children:["You can declare custom magic comments through theme config. For example, you can register another magic comment that adds a ",(0,r.jsx)(n.code,{children:"code-block-error-line"})," class name:"]}),"\n",(0,r.jsxs)(l.Z,{children:[(0,r.jsx)(a.Z,{value:"docusaurus.config.js",children:(0,r.jsx)(n.pre,{children:(0,r.jsx)(n.code,{className:"language-js",children:"export default {\n themeConfig: {\n prism: {\n magicComments: [\n // Remember to extend the default highlight class name as well!\n {\n className: 'theme-code-block-highlighted-line',\n line: 'highlight-next-line',\n block: {start: 'highlight-start', end: 'highlight-end'},\n },\n // highlight-start\n {\n className: 'code-block-error-line',\n line: 'This will error',\n },\n // highlight-end\n ],\n },\n },\n};\n"})})}),(0,r.jsx)(a.Z,{value:"src/css/custom.css",children:(0,r.jsx)(n.pre,{children:(0,r.jsx)(n.code,{className:"language-css",children:".code-block-error-line {\n background-color: #ff000020;\n display: block;\n margin: 0 calc(-1 * var(--ifm-pre-padding));\n padding: 0 var(--ifm-pre-padding);\n border-left: 3px solid #ff000080;\n}\n"})})}),(0,r.jsx)(a.Z,{value:"myDoc.md",children:(0,r.jsx)(n.pre,{children:(0,r.jsx)(n.code,{className:"language-md",children:"In JavaScript, trying to access properties on `null` will error.\n\n```js\nconst name = null;\n// This will error\nconsole.log(name.toUpperCase());\n// Uncaught TypeError: Cannot read properties of null (reading 'toUpperCase')\n```\n"})})})]}),"\n",(0,r.jsxs)(o.Z,{children:[(0,r.jsxs)(n.p,{children:["In JavaScript, trying to access properties on ",(0,r.jsx)(n.code,{children:"null"})," will error."]}),(0,r.jsx)(n.pre,{children:(0,r.jsx)(n.code,{className:"language-js",children:"const name = null;\n// This will error\nconsole.log(name.toUpperCase());\n// Uncaught TypeError: Cannot read properties of null (reading 'toUpperCase')\n"})})]}),"\n",(0,r.jsxs)(n.p,{children:["If you use number ranges in metastring (the ",(0,r.jsx)(n.code,{children:"{1,3-4}"})," syntax), Docusaurus will apply the ",(0,r.jsxs)(n.strong,{children:["first ",(0,r.jsx)(n.code,{children:"magicComments"})," entry"]}),"'s class name. This, by default, is ",(0,r.jsx)(n.code,{children:"theme-code-block-highlighted-line"}),", but if you change the ",(0,r.jsx)(n.code,{children:"magicComments"})," config and use a different entry as the first one, the meaning of the metastring range will change as well."]}),"\n",(0,r.jsxs)(n.p,{children:["You can disable the default line highlighting comments with ",(0,r.jsx)(n.code,{children:"magicComments: []"}),". If there's no magic comment config, but Docusaurus encounters a code block containing a metastring range, it will error because there will be no class name to apply\u2014the highlighting class name, after all, is just a magic comment entry."]}),"\n",(0,r.jsxs)(n.p,{children:["Every magic comment entry will contain three keys: ",(0,r.jsx)(n.code,{children:"className"})," (required), ",(0,r.jsx)(n.code,{children:"line"}),", which applies to the directly next line, or ",(0,r.jsx)(n.code,{children:"block"})," (containing ",(0,r.jsx)(n.code,{children:"start"})," and ",(0,r.jsx)(n.code,{children:"end"}),"), which applies to the entire block enclosed by the two comments."]}),"\n",(0,r.jsxs)(n.p,{children:["Using CSS to target the class can already do a lot, but you can unlock the full potential of this feature through ",(0,r.jsx)(n.a,{href:"/docs/swizzling",children:"swizzling"}),"."]}),"\n",(0,r.jsxs)(l.Z,{groupId:"npm2yarn",children:[(0,r.jsx)(a.Z,{value:"npm",children:(0,r.jsx)(n.pre,{children:(0,r.jsx)(n.code,{className:"language-bash",children:"npm run swizzle @docusaurus/theme-classic CodeBlock/Line\n"})})}),(0,r.jsx)(a.Z,{value:"yarn",label:"Yarn",children:(0,r.jsx)(n.pre,{children:(0,r.jsx)(n.code,{className:"language-bash",children:"yarn swizzle @docusaurus/theme-classic CodeBlock/Line\n"})})}),(0,r.jsx)(a.Z,{value:"pnpm",label:"pnpm",children:(0,r.jsx)(n.pre,{children:(0,r.jsx)(n.code,{className:"language-bash",children:"pnpm run swizzle @docusaurus/theme-classic CodeBlock/Line\n"})})}),(0,r.jsx)(a.Z,{value:"bun",label:"Bun",children:(0,r.jsx)(n.pre,{children:(0,r.jsx)(n.code,{className:"language-bash",children:"bun run swizzle @docusaurus/theme-classic CodeBlock/Line\n"})})})]}),"\n",(0,r.jsxs)(n.p,{children:["The ",(0,r.jsx)(n.code,{children:"Line"})," component will receive the list of class names, based on which you can conditionally render different markup."]}),"\n",(0,r.jsx)(n.h2,{id:"line-numbering",children:"Line numbering"}),"\n",(0,r.jsxs)(n.p,{children:["You can enable line numbering for your code block by using ",(0,r.jsx)(n.code,{children:"showLineNumbers"})," key within the language meta string (don't forget to add space directly before the key)."]}),"\n",(0,r.jsx)(n.pre,{children:(0,r.jsx)(n.code,{className:"language-md",children:"```jsx showLineNumbers\nimport React from 'react';\n\nexport default function MyComponent(props) {\n returnFoo;\n}\n```\n"})}),"\n",(0,r.jsx)(o.Z,{children:(0,r.jsx)(n.pre,{children:(0,r.jsx)(n.code,{className:"language-jsx",metastring:"showLineNumbers",children:"import React from 'react';\n\nexport default function MyComponent(props) {\n returnFoo;\n}\n"})})}),"\n",(0,r.jsx)(n.p,{children:"By default, the counter starts at line number 1. It's possible to pass a custom counter start value to split large code blocks for readability:"}),"\n",(0,r.jsx)(n.pre,{children:(0,r.jsx)(n.code,{className:"language-md",children:"```jsx showLineNumbers=3\nexport default function MyComponent(props) {\n returnFoo;\n}\n```\n"})}),"\n",(0,r.jsx)(o.Z,{children:(0,r.jsx)(n.pre,{children:(0,r.jsx)(n.code,{className:"language-jsx",metastring:"showLineNumbers=3",children:"export default function MyComponent(props) {\n returnFoo;\n}\n"})})}),"\n",(0,r.jsx)(n.h2,{id:"interactive-code-editor",children:"Interactive code editor"}),"\n",(0,r.jsxs)(n.p,{children:["(Powered by ",(0,r.jsx)(n.a,{href:"https://github.com/FormidableLabs/react-live",children:"React Live"}),")"]}),"\n",(0,r.jsxs)(n.p,{children:["You can create an interactive coding editor with the ",(0,r.jsx)(n.code,{children:"@docusaurus/theme-live-codeblock"})," plugin. First, add the plugin to your package."]}),"\n",(0,r.jsxs)(l.Z,{groupId:"npm2yarn",children:[(0,r.jsx)(a.Z,{value:"npm",children:(0,r.jsx)(n.pre,{children:(0,r.jsx)(n.code,{className:"language-bash",children:"npm install --save @docusaurus/theme-live-codeblock\n"})})}),(0,r.jsx)(a.Z,{value:"yarn",label:"Yarn",children:(0,r.jsx)(n.pre,{children:(0,r.jsx)(n.code,{className:"language-bash",children:"yarn add @docusaurus/theme-live-codeblock\n"})})}),(0,r.jsx)(a.Z,{value:"pnpm",label:"pnpm",children:(0,r.jsx)(n.pre,{children:(0,r.jsx)(n.code,{className:"language-bash",children:"pnpm add @docusaurus/theme-live-codeblock\n"})})}),(0,r.jsx)(a.Z,{value:"bun",label:"Bun",children:(0,r.jsx)(n.pre,{children:(0,r.jsx)(n.code,{className:"language-bash",children:"bun add @docusaurus/theme-live-codeblock\n"})})})]}),"\n",(0,r.jsxs)(n.p,{children:["You will also need to add the plugin to your ",(0,r.jsx)(n.code,{children:"docusaurus.config.js"}),"."]}),"\n",(0,r.jsx)(n.pre,{children:(0,r.jsx)(n.code,{className:"language-js",metastring:"{3}",children:"export default {\n // ...\n themes: ['@docusaurus/theme-live-codeblock'],\n // ...\n};\n"})}),"\n",(0,r.jsxs)(n.p,{children:["To use the plugin, create a code block with ",(0,r.jsx)(n.code,{children:"live"})," attached to the language meta string."]}),"\n",(0,r.jsx)(n.pre,{children:(0,r.jsx)(n.code,{className:"language-md",children:"```jsx live\nfunction Clock(props) {\n const [date, setDate] = useState(new Date());\n useEffect(() => {\n const timerID = setInterval(() => tick(), 1000);\n\n return function cleanup() {\n clearInterval(timerID);\n };\n });\n\n function tick() {\n setDate(new Date());\n }\n\n return (\n\n\n );\n}\n```\n"})}),"\n",(0,r.jsx)(n.p,{children:"The code block will be rendered as an interactive editor. Changes to the code will reflect on the result panel live."}),"\n",(0,r.jsx)(o.Z,{children:(0,r.jsx)(n.pre,{children:(0,r.jsx)(n.code,{className:"language-jsx",metastring:"live",live:!0,children:"function Clock(props) {\n const [date, setDate] = useState(new Date());\n useEffect(() => {\n const timerID = setInterval(() => tick(), 1000);\n\n return function cleanup() {\n clearInterval(timerID);\n };\n });\n\n function tick() {\n setDate(new Date());\n }\n\n return (\nIt is {date.toLocaleTimeString()}.
\n\n\n );\n}\n"})})}),"\n",(0,r.jsx)(n.h3,{id:"imports",children:"Imports"}),"\n",(0,r.jsx)(n.admonition,{title:"react-live and imports",type:"warning",children:(0,r.jsx)(n.p,{children:"It is not possible to import components directly from the react-live code editor, you have to define available imports upfront."})}),"\n",(0,r.jsx)(n.p,{children:"By default, all React imports are available. If you need more imports available, swizzle the react-live scope:"}),"\n",(0,r.jsxs)(l.Z,{groupId:"npm2yarn",children:[(0,r.jsx)(a.Z,{value:"npm",children:(0,r.jsx)(n.pre,{children:(0,r.jsx)(n.code,{className:"language-bash",children:"npm run swizzle @docusaurus/theme-live-codeblock ReactLiveScope -- --eject\n"})})}),(0,r.jsx)(a.Z,{value:"yarn",label:"Yarn",children:(0,r.jsx)(n.pre,{children:(0,r.jsx)(n.code,{className:"language-bash",children:"yarn swizzle @docusaurus/theme-live-codeblock ReactLiveScope --eject\n"})})}),(0,r.jsx)(a.Z,{value:"pnpm",label:"pnpm",children:(0,r.jsx)(n.pre,{children:(0,r.jsx)(n.code,{className:"language-bash",children:"pnpm run swizzle @docusaurus/theme-live-codeblock ReactLiveScope --eject\n"})})}),(0,r.jsx)(a.Z,{value:"bun",label:"Bun",children:(0,r.jsx)(n.pre,{children:(0,r.jsx)(n.code,{className:"language-bash",children:"bun run swizzle @docusaurus/theme-live-codeblock ReactLiveScope --eject\n"})})})]}),"\n",(0,r.jsx)(n.pre,{children:(0,r.jsx)(n.code,{className:"language-jsx",metastring:'title="src/theme/ReactLiveScope/index.js"',children:"import React from 'react';\n\n// highlight-start\nconst ButtonExample = (props) => (\n \n);\n// highlight-end\n\n// Add react-live imports you need here\nconst ReactLiveScope = {\n React,\n ...React,\n // highlight-next-line\n ButtonExample,\n};\n\nexport default ReactLiveScope;\n"})}),"\n",(0,r.jsxs)(n.p,{children:["The ",(0,r.jsx)(n.code,{children:"ButtonExample"})," component is now available to use:"]}),"\n",(0,r.jsx)(o.Z,{children:(0,r.jsx)(n.pre,{children:(0,r.jsx)(n.code,{className:"language-jsx",metastring:"live",live:!0,children:"function MyPlayground(props) {\n return (\nIt is {date.toLocaleTimeString()}.
\n\n\n );\n}\n"})})}),"\n",(0,r.jsx)(n.h3,{id:"imperative-rendering-noinline",children:"Imperative Rendering (noInline)"}),"\n",(0,r.jsxs)(n.p,{children:["The ",(0,r.jsx)(n.code,{children:"noInline"})," option should be used to avoid errors when your code spans multiple components or variables."]}),"\n",(0,r.jsx)(n.pre,{children:(0,r.jsx)(n.code,{className:"language-md",children:"```jsx live noInline\nconst project = 'Docusaurus';\n\nconst Greeting = () =>alert('hey!')}>Click me \nHello {project}!
;\n\nrender();\n```\n"})}),"\n",(0,r.jsxs)(n.p,{children:["Unlike an ordinary interactive code block, when using ",(0,r.jsx)(n.code,{children:"noInline"})," React Live won't wrap your code in an inline function to render it."]}),"\n",(0,r.jsxs)(n.p,{children:["You will need to explicitly call ",(0,r.jsx)(n.code,{children:"render()"})," at the end of your code to display the output."]}),"\n",(0,r.jsx)(o.Z,{children:(0,r.jsx)(n.pre,{children:(0,r.jsx)(n.code,{className:"language-jsx",metastring:"live noInline",live:!0,children:'const project = "Docusaurus";\n\nconst Greeting = () => (\n Hello {project}!
\n);\n\nrender(\n\n);\n'})})}),"\n",(0,r.jsx)(n.h2,{id:"using-jsx-markup",children:"Using JSX markup in code blocks"}),"\n",(0,r.jsx)(n.p,{children:"Code block in Markdown always preserves its content as plain text, meaning you can't do something like:"}),"\n",(0,r.jsx)(n.pre,{children:(0,r.jsx)(n.code,{className:"language-ts",children:'type EditUrlFunction = (params: {\n // This doesn\'t turn into a link (for good reason!)\n version: Version;\n versionDocsDirPath: string;\n docPath: string;\n permalink: string;\n locale: string;\n}) => string | undefined;\n'})}),"\n",(0,r.jsxs)(n.p,{children:["If you want to embed HTML markup such as anchor links or bold type, you can use the ",(0,r.jsx)(n.code,{children:" "})," tag, ",(0,r.jsx)(n.code,{children:""})," tag, or ",(0,r.jsx)(n.code,{children:"
"})," component."]}),"\n",(0,r.jsx)(n.pre,{children:(0,r.jsx)(n.code,{className:"language-jsx",children:" \n Input: 1 2 3 4{'\\n'}\n Output: \"366300745\"{'\\n'}\n\n"})}),"\n",(0,r.jsx)(o.Z,{children:(0,r.jsxs)("pre",{children:[(0,r.jsx)("b",{children:"Input: "}),"1 2 3 4\n",(0,r.jsx)("b",{children:"Output: "}),'"366300745"\n']})}),"\n",(0,r.jsx)(n.admonition,{title:"MDX is whitespace insensitive",type:"warning",children:(0,r.jsxs)(n.p,{children:["MDX is in line with JSX behavior: line break characters, even when inside ",(0,r.jsx)(n.code,{children:""}),", are turned into spaces. You have to explicitly write the new line character for it to be printed out."]})}),"\n",(0,r.jsx)(n.admonition,{type:"warning",children:(0,r.jsx)(n.p,{children:"Syntax highlighting only works on plain strings. Docusaurus will not attempt to parse code block content containing JSX children."})}),"\n",(0,r.jsx)(n.h2,{id:"multi-language-support-code-blocks",children:"Multi-language support code blocks"}),"\n",(0,r.jsx)(n.p,{children:"With MDX, you can easily create interactive components within your documentation, for example, to display code in multiple programming languages and switch between them using a tabs component."}),"\n",(0,r.jsxs)(n.p,{children:["Instead of implementing a dedicated component for multi-language support code blocks, we've implemented a general-purpose ",(0,r.jsx)(n.a,{href:"/docs/markdown-features/tabs",children:(0,r.jsx)(n.code,{children:""})})," component in the classic theme so that you can use it for other non-code scenarios as well."]}),"\n",(0,r.jsxs)(n.p,{children:["The following example is how you can have multi-language code tabs in your docs. Note that the empty lines above and below each language block are ",(0,r.jsx)(n.strong,{children:"intentional"}),". This is a ",(0,r.jsx)(n.a,{href:"/docs/markdown-features/react#markdown-and-jsx-interoperability",children:"current limitation of MDX"}),": you have to leave empty lines around Markdown syntax for the MDX parser to know that it's Markdown syntax and not JSX."]}),"\n",(0,r.jsx)(n.pre,{children:(0,r.jsx)(n.code,{className:"language-jsx",children:'import Tabs from \'@theme/Tabs\';\nimport TabItem from \'@theme/TabItem\';\n\n \n \n'})}),"\n",(0,r.jsx)(n.p,{children:"And you will get the following:"}),"\n",(0,r.jsx)(o.Z,{children:(0,r.jsxs)(l.Z,{children:[(0,r.jsx)(a.Z,{value:"js",label:"JavaScript",children:(0,r.jsx)(n.pre,{children:(0,r.jsx)(n.code,{className:"language-js",children:"function helloWorld() {\n console.log('Hello, world!');\n}\n"})})}),(0,r.jsx)(a.Z,{value:"py",label:"Python",children:(0,r.jsx)(n.pre,{children:(0,r.jsx)(n.code,{className:"language-py",children:'def hello_world():\n print("Hello, world!")\n'})})}),(0,r.jsx)(a.Z,{value:"java",label:"Java",children:(0,r.jsx)(n.pre,{children:(0,r.jsx)(n.code,{className:"language-java",children:'class HelloWorld {\n public static void main(String args[]) {\n System.out.println("Hello, World");\n }\n}\n'})})})]})}),"\n",(0,r.jsxs)(n.p,{children:["If you have multiple of these multi-language code tabs, and you want to sync the selection across the tab instances, refer to the ",(0,r.jsx)(n.a,{href:"/docs/markdown-features/tabs#syncing-tab-choices",children:"Syncing tab choices section"}),"."]}),"\n",(0,r.jsx)(n.h3,{id:"npm2yarn-remark-plugin",children:"Docusaurus npm2yarn remark plugin"}),"\n",(0,r.jsx)(n.p,{children:"Displaying CLI commands in both npm and Yarn is a very common need, for example:"}),"\n",(0,r.jsxs)(l.Z,{groupId:"npm2yarn",children:[(0,r.jsx)(a.Z,{value:"npm",children:(0,r.jsx)(n.pre,{children:(0,r.jsx)(n.code,{className:"language-bash",children:"npm install @docusaurus/remark-plugin-npm2yarn\n"})})}),(0,r.jsx)(a.Z,{value:"yarn",label:"Yarn",children:(0,r.jsx)(n.pre,{children:(0,r.jsx)(n.code,{className:"language-bash",children:"yarn add @docusaurus/remark-plugin-npm2yarn\n"})})}),(0,r.jsx)(a.Z,{value:"pnpm",label:"pnpm",children:(0,r.jsx)(n.pre,{children:(0,r.jsx)(n.code,{className:"language-bash",children:"pnpm add @docusaurus/remark-plugin-npm2yarn\n"})})}),(0,r.jsx)(a.Z,{value:"bun",label:"Bun",children:(0,r.jsx)(n.pre,{children:(0,r.jsx)(n.code,{className:"language-bash",children:"bun add @docusaurus/remark-plugin-npm2yarn\n"})})})]}),"\n",(0,r.jsxs)(n.p,{children:["Docusaurus provides such a utility out of the box, freeing you from using the ",(0,r.jsx)(n.code,{children:"Tabs"})," component every time. To enable this feature, first install the ",(0,r.jsx)(n.code,{children:"@docusaurus/remark-plugin-npm2yarn"})," package as above, and then in ",(0,r.jsx)(n.code,{children:"docusaurus.config.js"}),", for the plugins where you need this feature (doc, blog, pages, etc.), register it in the ",(0,r.jsx)(n.code,{children:"remarkPlugins"})," option. (See ",(0,r.jsx)(n.a,{href:"/docs/api/plugins/@docusaurus/plugin-content-docs#ex-config",children:"Docs configuration"})," for more details on configuration format)"]}),"\n",(0,r.jsx)(n.pre,{children:(0,r.jsx)(n.code,{className:"language-js",metastring:'title="docusaurus.config.js"',children:"export default {\n // ...\n presets: [\n [\n '@docusaurus/preset-classic',\n {\n docs: {\n // highlight-start\n remarkPlugins: [\n [require('@docusaurus/remark-plugin-npm2yarn'), {sync: true}],\n ],\n // highlight-end\n },\n pages: {\n // highlight-next-line\n remarkPlugins: [require('@docusaurus/remark-plugin-npm2yarn')],\n },\n blog: {\n // highlight-start\n remarkPlugins: [\n [\n require('@docusaurus/remark-plugin-npm2yarn'),\n {converters: ['pnpm']},\n ],\n ],\n // highlight-end\n // ...\n },\n },\n ],\n ],\n};\n"})}),"\n",(0,r.jsxs)(n.p,{children:["And then use it by adding the ",(0,r.jsx)(n.code,{children:"npm2yarn"})," key to the code block:"]}),"\n",(0,r.jsx)(n.pre,{children:(0,r.jsx)(n.code,{className:"language-md",children:"```bash npm2yarn\nnpm install @docusaurus/remark-plugin-npm2yarn\n```\n"})}),"\n",(0,r.jsx)(n.h4,{id:"npm2yarn-remark-plugin-configuration",children:"Configuration"}),"\n",(0,r.jsxs)(n.table,{children:[(0,r.jsx)(n.thead,{children:(0,r.jsxs)(n.tr,{children:[(0,r.jsx)(n.th,{children:"Option"}),(0,r.jsx)(n.th,{children:"Type"}),(0,r.jsx)(n.th,{children:"Default"}),(0,r.jsx)(n.th,{children:"Description"})]})}),(0,r.jsxs)(n.tbody,{children:[(0,r.jsxs)(n.tr,{children:[(0,r.jsx)(n.td,{children:(0,r.jsx)(n.code,{children:"sync"})}),(0,r.jsx)(n.td,{children:(0,r.jsx)(n.code,{children:"boolean"})}),(0,r.jsx)(n.td,{children:(0,r.jsx)(n.code,{children:"false"})}),(0,r.jsx)(n.td,{children:"Whether to sync the selected converter across all code blocks."})]}),(0,r.jsxs)(n.tr,{children:[(0,r.jsx)(n.td,{children:(0,r.jsx)(n.code,{children:"converters"})}),(0,r.jsx)(n.td,{children:(0,r.jsx)(n.code,{children:"array"})}),(0,r.jsxs)(n.td,{children:[(0,r.jsx)(n.code,{children:"'yarn'"}),", ",(0,r.jsx)(n.code,{children:"'pnpm'"})]}),(0,r.jsx)(n.td,{children:"The list of converters to use. The order of the converters is important, as the first converter will be used as the default choice."})]})]})]}),"\n",(0,r.jsx)(n.h2,{id:"usage-in-jsx",children:"Usage in JSX"}),"\n",(0,r.jsxs)(n.p,{children:["Outside of Markdown, you can use the ",(0,r.jsx)(n.code,{children:"@theme/CodeBlock"})," component to get the same output."]}),"\n",(0,r.jsx)(n.pre,{children:(0,r.jsx)(n.code,{className:"language-jsx",children:'import CodeBlock from \'@theme/CodeBlock\';\n\nexport default function MyReactPage() {\n return (\n\n\n```js\nfunction helloWorld() {\n console.log(\'Hello, world!\');\n}\n```\n\n \n\n\n```py\ndef hello_world():\n print("Hello, world!")\n```\n\n \n\n\n```java\nclass HelloWorld {\n public static void main(String args[]) {\n System.out.println("Hello, World");\n }\n}\n```\n\n \n\n {/* highlight-start */}\n\n );\n}\n'})}),"\n",(0,r.jsx)(o.Z,{children:(0,r.jsx)(c.Z,{language:"jsx",title:"/src/components/HelloCodeTitle.js",showLineNumbers:!0,children:`function HelloCodeTitle(props) { +return\n {`function HelloCodeTitle(props) {\n return \n {/* highlight-end */}\nHello, {props.name}
;\n}`}\nHello, {props.name}
; +}`})}),"\n",(0,r.jsxs)(n.p,{children:["The props accepted are ",(0,r.jsx)(n.code,{children:"language"}),", ",(0,r.jsx)(n.code,{children:"title"})," and ",(0,r.jsx)(n.code,{children:"showLineNumbers"}),", in the same way as you write Markdown code blocks."]}),"\n",(0,r.jsxs)(n.p,{children:["Although discouraged, you can also pass in a ",(0,r.jsx)(n.code,{children:"metastring"})," prop like ",(0,r.jsx)(n.code,{children:"metastring='{1-2} title=\"/src/components/HelloCodeTitle.js\" showLineNumbers'"}),", which is how Markdown code blocks are handled under the hood. However, we recommend you ",(0,r.jsx)(n.a,{href:"#highlighting-with-comments",children:"use comments for highlighting lines"}),"."]}),"\n",(0,r.jsxs)(n.p,{children:["As ",(0,r.jsx)(n.a,{href:"#using-jsx-markup",children:"previously stated"}),", syntax highlighting is only applied when the children is a simple string."]})]})}function p(e={}){let{wrapper:n}={...(0,i.a)(),...e.components};return n?(0,r.jsx)(n,{...e,children:(0,r.jsx)(m,{...e})}):m(e)}},58636:function(e,n,s){s.d(n,{Z:()=>i});var t=s(85893);s(67294);var r=s(90496);function i(e){let{children:n,hidden:s,className:i}=e;return(0,t.jsx)("div",{role:"tabpanel",className:(0,r.Z)("tabItem_pnkT",i),hidden:s,children:n})}},15398:function(e,n,s){s.d(n,{Z:()=>f});var t=s(85893),r=s(67294),i=s(90496),l=s(54947),a=s(3620),o=s(844),c=s(97486),d=s(32263),h=s(16971);function u(e){return r.Children.toArray(e).filter(e=>"\n"!==e).map(e=>{if(!e||(0,r.isValidElement)(e)&&function(e){let{props:n}=e;return!!n&&"object"==typeof n&&"value"in n}(e))return e;throw Error(`Docusaurus error: Badchild <${"string"==typeof e.type?e.type:e.type.name}>: all children of the component should be , and every should have a unique "value" prop.`)})?.filter(Boolean)??[]}function g(e){let{value:n,tabValues:s}=e;return s.some(e=>e.value===n)}var m=s(71607);function p(e){let{className:n,block:s,selectedValue:r,selectValue:a,tabValues:o}=e,c=[],{blockElementScrollPositionUntilNextRender:d}=(0,l.o5)(),h=e=>{let n=e.currentTarget,s=o[c.indexOf(n)].value;s!==r&&(d(n),a(s))},u=e=>{let n=null;switch(e.key){case"Enter":h(e);break;case"ArrowRight":{let s=c.indexOf(e.currentTarget)+1;n=c[s]??c[0];break}case"ArrowLeft":{let s=c.indexOf(e.currentTarget)-1;n=c[s]??c[c.length-1]}}n?.focus()};return(0,t.jsx)("ul",{role:"tablist","aria-orientation":"horizontal",className:(0,i.Z)("tabs",{"tabs--block":s},n),children:o.map(e=>{let{value:n,label:s,attributes:l}=e;return(0,t.jsx)("li",{role:"tab",tabIndex:r===n?0:-1,"aria-selected":r===n,ref:e=>{c.push(e)},onKeyDown:u,onClick:h,...l,className:(0,i.Z)("tabs__item","tabItem_AQgk",l?.className,{"tabs__item--active":r===n}),children:s??n},n)})})}function x(e){let{lazy:n,children:s,selectedValue:l}=e,a=(Array.isArray(s)?s:[s]).filter(Boolean);if(n){let e=a.find(e=>e.props.value===l);return e?(0,r.cloneElement)(e,{className:(0,i.Z)("margin-top--md",e.props.className)}):null}return(0,t.jsx)("div",{className:"margin-top--md",children:a.map((e,n)=>(0,r.cloneElement)(e,{key:n,hidden:e.props.value!==l}))})}function j(e){let n=function(e){let{defaultValue:n,queryString:s=!1,groupId:t}=e,i=function(e){let{values:n,children:s}=e;return(0,r.useMemo)(()=>{let e=n??u(s).map(e=>{let{props:{value:n,label:s,attributes:t,default:r}}=e;return{value:n,label:s,attributes:t,default:r}}),t=(0,d.lx)(e,(e,n)=>e.value===n.value);if(t.length>0)throw Error(`Docusaurus error: Duplicate values "${t.map(e=>e.value).join(", ")}" found in . Every value needs to be unique.`);return e},[n,s])}(e),[l,m]=(0,r.useState)(()=>(function(e){let{defaultValue:n,tabValues:s}=e;if(0===s.length)throw Error("Docusaurus error: the component requires at least one children component");if(n){if(!g({value:n,tabValues:s}))throw Error(`Docusaurus error: The has a defaultValue "${n}" but none of its children has the corresponding value. Available values are: ${s.map(e=>e.value).join(", ")}. If you intend to show no default tab, use defaultValue={null} instead.`);return n}let t=s.find(e=>e.default)??s[0];if(!t)throw Error("Unexpected error: 0 tabValues");return t.value})({defaultValue:n,tabValues:i})),[p,x]=function(e){let{queryString:n=!1,groupId:s}=e,t=(0,a.k6)(),i=function(e){let{queryString:n=!1,groupId:s}=e;if("string"==typeof n)return n;if(!1===n)return null;if(!0===n&&!s)throw Error('Docusaurus error: The component groupId prop is required if queryString=true, because this value is used as the search param name. You can also provide an explicit value such as queryString="my-search-param".');return s??null}({queryString:n,groupId:s});return[(0,c._X)(i),(0,r.useCallback)(e=>{if(!i)return;let n=new URLSearchParams(t.location.search);n.set(i,e),t.replace({...t.location,search:n.toString()})},[i,t])]}({queryString:s,groupId:t}),[j,f]=function(e){let{groupId:n}=e,s=n?`docusaurus.tab.${n}`:null,[t,i]=(0,h.Nk)(s);return[t,(0,r.useCallback)(e=>{s&&i.set(e)},[s,i])]}({groupId:t}),b=(()=>{let e=p??j;return g({value:e,tabValues:i})?e:null})();return(0,o.Z)(()=>{b&&m(b)},[b]),{selectedValue:l,selectValue:(0,r.useCallback)(e=>{if(!g({value:e,tabValues:i}))throw Error(`Can't select invalid tab value=${e}`);m(e),x(e),f(e)},[x,f,i]),tabValues:i}}(e);return(0,t.jsxs)("div",{className:(0,i.Z)("tabs-container","tabList_Qoir"),children:[(0,t.jsx)(p,{...n,...e}),(0,t.jsx)(x,{...n,...e})]})}function f(e){let n=(0,m.Z)();return(0,t.jsx)(j,{...e,children:u(e.children)},String(n))}},56497:function(e,n,s){s.d(n,{Z:()=>i});var t=s(85893);s(67294);var r=s(71607);function i(e){let{children:n,fallback:s}=e;return(0,r.Z)()?(0,t.jsx)(t.Fragment,{children:n?.()}):s??null}},14522:function(e,n,s){s.d(n,{Z:()=>a});var t=s(85893);s(67294);var r=s(90496);let i="dot_giz1",l="bar_rrRL";function a(e){let{children:n,minHeight:s,url:a="http://localhost:3000",style:o,bodyStyle:c}=e;return(0,t.jsxs)("div",{className:"browserWindow_my1Q",style:{...o,minHeight:s},children:[(0,t.jsxs)("div",{className:"browserWindowHeader_jXSR",children:[(0,t.jsxs)("div",{className:"buttons_uHc7",children:[(0,t.jsx)("span",{className:i,style:{background:"#f25f58"}}),(0,t.jsx)("span",{className:i,style:{background:"#fbbe3c"}}),(0,t.jsx)("span",{className:i,style:{background:"#58cb42"}})]}),(0,t.jsx)("div",{className:(0,r.Z)("browserWindowAddressBar_Pd8y","text--truncate"),children:a}),(0,t.jsx)("div",{className:"browserWindowMenuIcon_Vhuh",children:(0,t.jsxs)("div",{children:[(0,t.jsx)("span",{className:l}),(0,t.jsx)("span",{className:l}),(0,t.jsx)("span",{className:l})]})})]}),(0,t.jsx)("div",{className:"browserWindowBody_Idgs",style:c,children:n})]})}},27817:function(e,n,s){s.d(n,{Z:()=>ep});var t={};s.r(t),s.d(t,{ButtonExample:()=>eh});var r=s(85893),i=s(67294),l=s(71607),a=s(90496),o=s(45245),c=s(26378);function d(){let{prism:e}=(0,c.L)(),{colorMode:n}=(0,o.I)(),s=e.theme,t=e.darkTheme||s;return"dark"===n?t:s}var h=s(55951),u=s(6324),g=s.n(u),m=s(50923);let p=/title=(? ["'])(?.*?)\1/,x=/\{(? [\d,-]+)\}/,j={js:{start:"\\/\\/",end:""},jsBlock:{start:"\\/\\*",end:"\\*\\/"},jsx:{start:"\\{\\s*\\/\\*",end:"\\*\\/\\s*\\}"},bash:{start:"#",end:""},html:{start:"\x3c!--",end:"--\x3e"}},f={...j,lua:{start:"--",end:""},wasm:{start:"\\;\\;",end:""},tex:{start:"%",end:""},vb:{start:"['\u2018\u2019]",end:""},vbnet:{start:"(?:_\\s*)?['\u2018\u2019]",end:""},rem:{start:"[Rr][Ee][Mm]\\b",end:""},f90:{start:"!",end:""},ml:{start:"\\(\\*",end:"\\*\\)"},cobol:{start:"\\*>",end:""}},b=Object.keys(j);function y(e,n){let s=e.map(e=>{let{start:s,end:t}=f[e];return`(?:${s}\\s*(${n.flatMap(e=>[e.line,e.block?.start,e.block?.end].filter(Boolean)).join("|")})\\s*${t})`}).join("|");return RegExp(`^\\s*(?:${s})\\s*$`)}let v=(0,i.createContext)(null);function w(e){let{metadata:n,wordWrap:s,children:t}=e,l=(0,i.useMemo)(()=>({metadata:n,wordWrap:s}),[n,s]);return(0,r.jsx)(v.Provider,{value:l,children:t})}function k(){let e=(0,i.useContext)(v);if(null===e)throw new m.i6("CodeBlockContextProvider");return e}function N(e){let{as:n,...s}=e,t=function(e){let n={color:"--prism-color",backgroundColor:"--prism-background-color"},s={};return Object.entries(e.plain).forEach(e=>{let[t,r]=e,i=n[t];i&&"string"==typeof r&&(s[i]=r)}),s}(d());return(0,r.jsx)(n,{...s,style:t,className:(0,a.Z)(s.className,"codeBlockContainer_jDV4",h.k.common.codeBlock)})}let C={codeBlock:"codeBlock_Gebt",codeBlockStandalone:"codeBlockStandalone_i_cY",codeBlockLines:"codeBlockLines_FJaf",codeBlockLinesWithNumbering:"codeBlockLinesWithNumbering_FU9Q"};function L(e){let{children:n,className:s}=e;return(0,r.jsx)(N,{as:"pre",tabIndex:0,className:(0,a.Z)(C.codeBlockStandalone,"thin-scrollbar",s),children:(0,r.jsx)("code",{className:C.codeBlockLines,children:n})})}let T={attributes:!0,characterData:!0,childList:!0,subtree:!0};function B(e){let{children:n}=e;return n}var I=s(7316);function Z(e){let{line:n,token:s,...t}=e;return(0,r.jsx)("span",{...t})}let S={codeLine:"codeLine_qRmp",codeLineNumber:"codeLineNumber_dS_J",codeLineContent:"codeLineContent_XF5l"};function D(e){let{line:n,classNames:s,showLineNumbers:t,getLineProps:i,getTokenProps:l}=e,o=function(e){let n=1===e.length&&"\n"===e[0].content?e[0]:void 0;return n?[{...n,content:""}]:e}(n),c=i({line:o,className:(0,a.Z)(s,t&&S.codeLine)}),d=o.map((e,n)=>{let s=l({token:e});return(0,r.jsx)(Z,{...s,line:o,token:e,children:s.children},n)});return(0,r.jsxs)("span",{...c,children:[t?(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)("span",{className:S.codeLineNumber}),(0,r.jsx)("span",{className:S.codeLineContent,children:d})]}):d,(0,r.jsx)("br",{})]})}let E=i.forwardRef((e,n)=>(0,r.jsx)("pre",{ref:n,tabIndex:0,...e,className:(0,a.Z)(e.className,C.codeBlock,"thin-scrollbar")}));function H(e){let{metadata:n}=k();return(0,r.jsx)("code",{...e,className:(0,a.Z)(e.className,C.codeBlockLines,void 0!==n.lineNumbersStart&&C.codeBlockLinesWithNumbering),style:{...e.style,counterReset:void 0===n.lineNumbersStart?void 0:`line-count ${n.lineNumbersStart-1}`}})}function M(e){let{className:n}=e,{metadata:s,wordWrap:t}=k(),i=d(),{code:l,language:o,lineNumbersStart:c,lineClassNames:h}=s;return(0,r.jsx)(I.y$,{theme:i,code:l,language:o,children:e=>{let{className:s,style:i,tokens:l,getLineProps:o,getTokenProps:d}=e;return(0,r.jsx)(E,{ref:t.codeBlockRef,className:(0,a.Z)(n,s),style:i,children:(0,r.jsx)(H,{children:l.map((e,n)=>(0,r.jsx)(D,{line:e,getLineProps:o,getTokenProps:d,classNames:h[n],showLineNumbers:void 0!==c},n))})})}})}var _=s(56497),z=s(44771),R=s(77827);function P(e){let{className:n,...s}=e;return(0,r.jsx)("button",{type:"button",...s,className:(0,a.Z)("clean-btn",n)})}function A(e){return(0,r.jsx)("svg",{viewBox:"0 0 24 24",...e,children:(0,r.jsx)("path",{fill:"currentColor",d:"M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"})})}function W(e){return(0,r.jsx)("svg",{viewBox:"0 0 24 24",...e,children:(0,r.jsx)("path",{fill:"currentColor",d:"M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"})})}let F={copyButtonCopied:"copyButtonCopied_wDuR",copyButtonIcons:"copyButtonIcons_gMWc",copyButtonIcon:"copyButtonIcon_GXfb",copyButtonSuccessIcon:"copyButtonSuccessIcon_ktUX"};function Y(e){let{className:n}=e,{copyCode:s,isCopied:t}=function(){let{metadata:{code:e}}=k(),[n,s]=(0,i.useState)(!1),t=(0,i.useRef)(void 0),r=(0,i.useCallback)(()=>{(0,z.Z)(e),s(!0),t.current=window.setTimeout(()=>{s(!1)},1e3)},[e]);return(0,i.useEffect)(()=>()=>window.clearTimeout(t.current),[]),{copyCode:r,isCopied:n}}();return(0,r.jsx)(P,{"aria-label":t?(0,R.I)({id:"theme.CodeBlock.copied",message:"Copied",description:"The copied button label on code blocks"}):(0,R.I)({id:"theme.CodeBlock.copyButtonAriaLabel",message:"Copy code to clipboard",description:"The ARIA label for copy code blocks button"}),title:(0,R.I)({id:"theme.CodeBlock.copy",message:"Copy",description:"The copy button label on code blocks"}),className:(0,a.Z)(n,F.copyButton,t&&F.copyButtonCopied),onClick:s,children:(0,r.jsxs)("span",{className:F.copyButtonIcons,"aria-hidden":"true",children:[(0,r.jsx)(A,{className:F.copyButtonIcon}),(0,r.jsx)(W,{className:F.copyButtonSuccessIcon})]})})}function $(e){return(0,r.jsx)("svg",{viewBox:"0 0 24 24",...e,children:(0,r.jsx)("path",{fill:"currentColor",d:"M4 19h6v-2H4v2zM20 5H4v2h16V5zm-3 6H4v2h13.25c1.1 0 2 .9 2 2s-.9 2-2 2H15v-2l-3 3l3 3v-2h2c2.21 0 4-1.79 4-4s-1.79-4-4-4z"})})}let U={wordWrapButtonIcon:"wordWrapButtonIcon___5r",wordWrapButtonEnabled:"wordWrapButtonEnabled_nam_"};function X(e){let{className:n}=e,{wordWrap:s}=k();if(!(s.isEnabled||s.isCodeScrollable))return!1;let t=(0,R.I)({id:"theme.CodeBlock.wordWrapToggle",message:"Toggle word wrap",description:"The title attribute for toggle word wrapping button of code block lines"});return(0,r.jsx)(P,{onClick:()=>s.toggle(),className:(0,a.Z)(n,s.isEnabled&&U.wordWrapButtonEnabled),"aria-label":t,title:t,children:(0,r.jsx)($,{className:U.wordWrapButtonIcon,"aria-hidden":"true"})})}function J(e){let{className:n}=e;return(0,r.jsx)(_.Z,{children:()=>(0,r.jsxs)("div",{className:(0,a.Z)(n,"buttonGroup_KXnS"),children:[(0,r.jsx)(X,{}),(0,r.jsx)(Y,{})]})})}let q={codeBlockContent:"codeBlockContent_cKMj",codeBlockTitle:"codeBlockTitle_U6Q0"};function O(e){let{className:n}=e,{metadata:s}=k();return(0,r.jsxs)(N,{as:"div",className:(0,a.Z)(n,s.className),children:[s.title&&(0,r.jsx)("div",{className:q.codeBlockTitle,children:(0,r.jsx)(B,{children:s.title})}),(0,r.jsxs)("div",{className:q.codeBlockContent,children:[(0,r.jsx)(M,{}),(0,r.jsx)(J,{})]})]})}function V(e){let n=function(e){let{prism:n}=(0,c.L)();return function(e){var n,s,t;let r=(s=(n={language:e.language,defaultLanguage:e.defaultLanguage,className:e.className}).language??function(e){if(!e)return;let n=e.split(" ").find(e=>e.startsWith("language-"));return n?.replace(/language-/,"")}(n.className)??n.defaultLanguage,s?.toLowerCase()??"text"),{lineClassNames:i,code:l}=function(e,n){let s=e.replace(/\r?\n$/,"");return function(e,n){let{metastring:s,magicComments:t}=n;if(s&&x.test(s)){let n=s.match(x).groups.range;if(0===t.length)throw Error(`A highlight range has been given in code block's metastring (\`\`\` ${s}), but no magic comment config is available. Docusaurus applies the first magic comment entry's className for metastring ranges.`);let r=t[0].className;return{lineClassNames:Object.fromEntries(g()(n).filter(e=>e>0).map(e=>[e-1,[r]])),code:e}}return null}(s,{...n})??function(e,n){let{language:s,magicComments:t}=n;if(void 0===s)return{lineClassNames:{},code:e};let r=function(e,n){switch(e){case"js":case"javascript":case"ts":case"typescript":return y(["js","jsBlock"],n);case"jsx":case"tsx":return y(["js","jsBlock","jsx"],n);case"html":return y(["js","jsBlock","html"],n);case"python":case"py":case"bash":return y(["bash"],n);case"markdown":case"md":return y(["html","jsx","bash"],n);case"tex":case"latex":case"matlab":return y(["tex"],n);case"lua":case"haskell":return y(["lua"],n);case"sql":return y(["lua","jsBlock"],n);case"wasm":return y(["wasm"],n);case"vb":case"vba":case"visual-basic":return y(["vb","rem"],n);case"vbnet":return y(["vbnet","rem"],n);case"batch":return y(["rem"],n);case"basic":return y(["rem","f90"],n);case"fsharp":return y(["js","ml"],n);case"ocaml":case"sml":return y(["ml"],n);case"fortran":return y(["f90"],n);case"cobol":return y(["cobol"],n);default:return y(b,n)}}(s,t),i=e.split(/\r?\n/),l=Object.fromEntries(t.map(e=>[e.className,{start:0,range:""}])),a=Object.fromEntries(t.filter(e=>e.line).map(e=>{let{className:n,line:s}=e;return[s,n]})),o=Object.fromEntries(t.filter(e=>e.block).map(e=>{let{className:n,block:s}=e;return[s.start,n]})),c=Object.fromEntries(t.filter(e=>e.block).map(e=>{let{className:n,block:s}=e;return[s.end,n]}));for(let e=0;e void 0!==e);a[s]?l[a[s]].range+=`${e},`:o[s]?l[o[s]].start=e:c[s]&&(l[c[s]].range+=`${l[c[s]].start}-${e-1},`),i.splice(e,1)}let d={};return Object.entries(l).forEach(e=>{let[n,{range:s}]=e;g()(s).forEach(e=>{d[e]??=[],d[e].push(n)})}),{code:i.join("\n"),lineClassNames:d}}(s,{...n})}(e.code,{metastring:e.metastring,magicComments:e.magicComments,language:r}),o=function(e){let{className:n,language:s}=e;return(0,a.Z)(n,s&&!n?.includes(`language-${s}`)&&`language-${s}`)}({className:e.className,language:r}),c=(t=e.metastring,(t?.match(p)?.groups.title??"")||e.title),d=function(e){let{showLineNumbers:n,metastring:s}=e;if("boolean"==typeof n)return n?1:void 0;if("number"==typeof n)return n;let t=s?.split(" ").find(e=>e.startsWith("showLineNumbers"));if(t)return t.startsWith("showLineNumbers=")?parseInt(t.replace("showLineNumbers=",""),10):1}({showLineNumbers:e.showLineNumbers,metastring:e.metastring});return{codeInput:e.code,code:l,className:o,language:r,title:c,lineNumbersStart:d,lineClassNames:i}}({code:e.children,className:e.className,metastring:e.metastring,magicComments:n.magicComments,defaultLanguage:n.defaultLanguage,language:e.language,title:e.title,showLineNumbers:e.showLineNumbers})}(e),s=function(){let[e,n]=(0,i.useState)(!1),[s,t]=(0,i.useState)(!1),r=(0,i.useRef)(null),l=(0,i.useCallback)(()=>{let s=r.current.querySelector("code");e?s.removeAttribute("style"):(s.style.whiteSpace="pre-wrap",s.style.overflowWrap="anywhere"),n(e=>!e)},[r,e]),a=(0,i.useCallback)(()=>{let{scrollWidth:e,clientWidth:n}=r.current;t(e>n||r.current.querySelector("code").hasAttribute("style"))},[r]),[o,c]=(0,i.useState)(),d=(0,i.useCallback)(()=>{c(r.current?.closest("[role=tabpanel][hidden]"))},[r,c]);return(0,i.useEffect)(()=>{d()},[d]),!function(e,n){let s=arguments.length>2&&void 0!==arguments[2]?arguments[2]:T,t=(0,m.zX)(n),r=(0,m.Ql)(s);(0,i.useEffect)(()=>{let n=new MutationObserver(t);return e&&n.observe(e,r),()=>n.disconnect()},[e,t,r])}(o,e=>{e.forEach(e=>{"attributes"===e.type&&"hidden"===e.attributeName&&(a(),d())})},{attributes:!0,characterData:!1,childList:!1,subtree:!1}),(0,i.useEffect)(()=>{a()},[e,a]),(0,i.useEffect)(()=>(window.addEventListener("resize",a,{passive:!0}),()=>{window.removeEventListener("resize",a)}),[a]),{codeBlockRef:r,isEnabled:e,isCodeScrollable:s,toggle:l}}();return(0,r.jsx)(w,{metadata:n,wordWrap:s,children:(0,r.jsx)(O,{})})}function G(e){let{children:n,...s}=e,t=(0,l.Z)(),a=i.Children.toArray(n).some(e=>(0,i.isValidElement)(e))?n:Array.isArray(n)?n.join(""):n;return(0,r.jsx)("string"==typeof a?V:L,{...s,children:a},String(t))}var Q=s(10075);let K=e=>`${e};`;function ee(e){let{code:n,children:s,...t}=e,i=d(),l=t.metastring?.includes("noInline")??!1;return(0,r.jsx)(Q.nu,{noInline:l,theme:i,...t,code:n?.replace(/\n$/,""),transformCode:t.transformCode??K,children:s})}function en(e){let{children:n}=e;return(0,r.jsx)("div",{className:"playgroundContainer_TDLX",children:n})}var es=s(85108),et=s(67490);function er(e){let{children:n}=e;return(0,r.jsx)("div",{className:(0,a.Z)("playgroundHeader_h_Hu"),children:n})}function ei(){return(0,r.jsx)("div",{children:"Loading..."})}function el(){return(0,r.jsx)(_.Z,{fallback:(0,r.jsx)(ei,{}),children:()=>(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(et.Z,{fallback:e=>(0,r.jsx)(es.Ac,{...e}),children:(0,r.jsx)(Q.i5,{})}),(0,r.jsx)(Q.IF,{})]})})}function ea(){return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(er,{children:(0,r.jsx)(R.Z,{id:"theme.Playground.result",description:"The result label of the live codeblocks",children:"Result"})}),(0,r.jsx)("div",{className:"playgroundPreview_u2xE",children:(0,r.jsx)(el,{})})]})}function eo(){let e=(0,l.Z)();return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(er,{children:(0,r.jsx)(R.Z,{id:"theme.Playground.liveEditor",description:"The live editor label of the live codeblocks",children:"Live Editor"})}),(0,r.jsx)(Q.uz,{className:"playgroundEditor_uqZ4"},String(e))]})}function ec(){let{playgroundPosition:e}=(0,c.L)().liveCodeBlock;return(0,r.jsx)(r.Fragment,{children:"top"===e?(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(ea,{}),(0,r.jsx)(eo,{})]}):(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(eo,{}),(0,r.jsx)(ea,{})]})})}function ed(e){let{children:n,transformCode:s,...t}=e;return(0,r.jsx)(en,{children:(0,r.jsx)(ee,{code:n,...t,children:(0,r.jsx)(ec,{})})})}function eh(e){return(0,r.jsx)("button",{type:"button",...e,style:{backgroundColor:"white",color:"black",border:"solid red",borderRadius:20,padding:10,cursor:"pointer",...e.style}})}let eu={React:i,...i,...t};function eg(e){return(0,r.jsx)(ed,{scope:eu,...e})}function em(e){return e.live?(0,r.jsx)(eg,{...e}):(0,r.jsx)(G,{...e})}function ep(e){return(0,r.jsx)(em,{...e})}}}]); \ No newline at end of file diff --git a/assets/js/0b6cd89a.09056649.js b/assets/js/0b6cd89a.09056649.js deleted file mode 100644 index 291dd9fdde..0000000000 --- a/assets/js/0b6cd89a.09056649.js +++ /dev/null @@ -1,22 +0,0 @@ -"use strict";(self.webpackChunkwebsite=self.webpackChunkwebsite||[]).push([["25467"],{84645:function(e,n,t){t.d(n,{ZP:()=>l,d$:()=>i});var s=t(85893),r=t(80980);let i=[{value:"Tags File",id:"tags-file",level:2},{value:"Types",id:"tags-file-types",level:3},{value:"Example",id:"tags-file-example",level:3}];function d(e){let n={a:"a",admonition:"admonition",code:"code",h2:"h2",h3:"h3",p:"p",pre:"pre",...(0,r.a)(),...e.components};return(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(n.h2,{id:"tags-file",children:"Tags File"}),"\n",(0,s.jsxs)(n.p,{children:["Use the ",(0,s.jsxs)(n.a,{href:"#tags",children:[(0,s.jsx)(n.code,{children:"tags"})," plugin option"]})," to configure the path of a YAML tags file."]}),"\n",(0,s.jsxs)(n.p,{children:["By convention, the plugin will look for a ",(0,s.jsx)(n.code,{children:"tags.yml"})," file at the root of your content folder(s)."]}),"\n",(0,s.jsxs)(n.p,{children:["This file can contain a list of predefined tags. You can reference these tags by their keys in Markdown files thanks to the ",(0,s.jsxs)(n.a,{href:"#markdown-front-matter",children:[(0,s.jsx)(n.code,{children:"tags"})," front matter"]}),"."]}),"\n",(0,s.jsx)(n.admonition,{title:"Keeping tags consistent",type:"tip",children:(0,s.jsxs)(n.p,{children:["Using a tags file, you can ensure that your tags usage is consistent across your plugin content set. Use the ",(0,s.jsx)(n.a,{href:"#onInlineTags",children:(0,s.jsx)(n.code,{children:"onInlineTags: 'throw'"})})," plugin option to enforce this consistency and prevent usage of inline tags declared on the fly."]})}),"\n",(0,s.jsx)(n.h3,{id:"tags-file-types",children:"Types"}),"\n",(0,s.jsx)(n.p,{children:"The YAML content of the provided tags file should respect the following shape:"}),"\n",(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-tsx",children:"type Tag = {\n label?: string; // Tag display label\n permalink?: string; // Tag URL pathname segment\n description?: string; // Tag description displayed in the tag page\n};\n\ntype TagsFileInput = Record | null>;\n"})}),"\n",(0,s.jsx)(n.h3,{id:"tags-file-example",children:"Example"}),"\n",(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-yml",metastring:'title="tags.yml"',children:"releases:\n label: 'Product releases'\n permalink: '/product-releases'\n description: 'Content related to product releases.'\n\n# A partial tag definition is also valid\nannouncements:\n label: 'Announcements'\n\n# An empty tag definition is also valid\n# Other attributes will be inferred from the key\nemptyTag:\n"})}),"\n",(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-md",metastring:'title="content.md"',children:"---\ntags: [releases, announcements, emptyTag]\n---\n\n# Title\n\nContent\n"})})]})}function l(e={}){let{wrapper:n}={...(0,r.a)(),...e.components};return n?(0,s.jsx)(n,{...e,children:(0,s.jsx)(d,{...e})}):d(e)}},17918:function(e,n,t){t.r(n),t.d(n,{frontMatter:()=>h,default:()=>g,contentTitle:()=>u,assets:()=>x,toc:()=>j,metadata:()=>s});var s=JSON.parse('{"id":"api/plugins/plugin-content-docs","title":"\uD83D\uDCE6 plugin-content-docs","description":"Provides the Docs functionality and is the default docs plugin for Docusaurus.","source":"@site/docs/api/plugins/plugin-content-docs.mdx","sourceDirName":"api/plugins","slug":"/api/plugins/@docusaurus/plugin-content-docs","permalink":"/docs/api/plugins/@docusaurus/plugin-content-docs","draft":false,"unlisted":false,"editUrl":"https://github.com/facebook/docusaurus/edit/main/website/docs/api/plugins/plugin-content-docs.mdx","tags":[],"version":"current","lastUpdatedBy":"Ben McCann","lastUpdatedAt":1744155424000,"sidebarPosition":1,"frontMatter":{"sidebar_position":1,"slug":"/api/plugins/@docusaurus/plugin-content-docs"},"sidebar":"api","previous":{"title":"Plugins overview","permalink":"/docs/api/plugins"},"next":{"title":"\uD83D\uDCE6 plugin-content-blog","permalink":"/docs/api/plugins/@docusaurus/plugin-content-blog"}}'),r=t(85893),i=t(80980),d=t(15398),l=t(58636),o=t(32240),c=t(66359),a=t(84645);let h={sidebar_position:1,slug:"/api/plugins/@docusaurus/plugin-content-docs"},u="\uD83D\uDCE6 plugin-content-docs",x={},j=[{value:"Installation",id:"installation",level:2},{value:"Configuration",id:"configuration",level:2},{value:"Types",id:"types",level:3},{value:" EditUrlFunction
",id:"EditUrlFunction",level:4},{value:"PrefixParser
",id:"PrefixParser",level:4},{value:"SidebarGenerator
",id:"SidebarGenerator",level:4},{value:"VersionsConfig
",id:"VersionsConfig",level:4},{value:"Example configuration",id:"ex-config",level:3},{value:"Markdown front matter",id:"markdown-front-matter",level:2},...a.d$,{value:"i18n",id:"i18n",level:2},{value:"Translation files location",id:"translation-files-location",level:3},{value:"Example file-system structure",id:"example-file-system-structure",level:3}];function p(e){let n={a:"a",admonition:"admonition",code:"code",em:"em",h1:"h1",h2:"h2",h3:"h3",h4:"h4",header:"header",li:"li",p:"p",pre:"pre",strong:"strong",table:"table",tbody:"tbody",td:"td",th:"th",thead:"thead",tr:"tr",ul:"ul",...(0,i.a)(),...e.components};return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(n.header,{children:(0,r.jsx)(n.h1,{id:"-plugin-content-docs",children:"\uD83D\uDCE6 plugin-content-docs"})}),"\n","\n",(0,r.jsxs)(n.p,{children:["Provides the ",(0,r.jsx)(n.a,{href:"/docs/docs-introduction",children:"Docs"})," functionality and is the default docs plugin for Docusaurus."]}),"\n",(0,r.jsx)(n.h2,{id:"installation",children:"Installation"}),"\n",(0,r.jsxs)(d.Z,{groupId:"npm2yarn",children:[(0,r.jsx)(l.Z,{value:"npm",children:(0,r.jsx)(n.pre,{children:(0,r.jsx)(n.code,{className:"language-bash",children:"npm install --save @docusaurus/plugin-content-docs\n"})})}),(0,r.jsx)(l.Z,{value:"yarn",label:"Yarn",children:(0,r.jsx)(n.pre,{children:(0,r.jsx)(n.code,{className:"language-bash",children:"yarn add @docusaurus/plugin-content-docs\n"})})}),(0,r.jsx)(l.Z,{value:"pnpm",label:"pnpm",children:(0,r.jsx)(n.pre,{children:(0,r.jsx)(n.code,{className:"language-bash",children:"pnpm add @docusaurus/plugin-content-docs\n"})})}),(0,r.jsx)(l.Z,{value:"bun",label:"Bun",children:(0,r.jsx)(n.pre,{children:(0,r.jsx)(n.code,{className:"language-bash",children:"bun add @docusaurus/plugin-content-docs\n"})})})]}),"\n",(0,r.jsxs)(n.admonition,{type:"tip",children:[(0,r.jsxs)(n.p,{children:["If you use the preset ",(0,r.jsx)(n.code,{children:"@docusaurus/preset-classic"}),", you don't need to install this plugin as a dependency."]}),(0,r.jsxs)(n.p,{children:["You can configure this plugin through the ",(0,r.jsx)(n.a,{href:"/docs/using-plugins#docusauruspreset-classic",children:"preset options"}),"."]})]}),"\n",(0,r.jsx)(n.h2,{id:"configuration",children:"Configuration"}),"\n",(0,r.jsx)(n.p,{children:"Accepted fields:"}),"\n",(0,r.jsx)(o.Z,{children:(0,r.jsxs)(n.table,{children:[(0,r.jsx)(n.thead,{children:(0,r.jsxs)(n.tr,{children:[(0,r.jsx)(n.th,{children:"Name"}),(0,r.jsx)(n.th,{children:"Type"}),(0,r.jsx)(n.th,{children:"Default"}),(0,r.jsx)(n.th,{children:"Description"})]})}),(0,r.jsxs)(n.tbody,{children:[(0,r.jsxs)(n.tr,{children:[(0,r.jsx)(n.td,{children:(0,r.jsx)(n.code,{children:"path"})}),(0,r.jsx)(n.td,{children:(0,r.jsx)(n.code,{children:"string"})}),(0,r.jsx)(n.td,{children:(0,r.jsx)(n.code,{children:"'docs'"})}),(0,r.jsx)(n.td,{children:"Path to the docs content directory on the file system, relative to site directory."})]}),(0,r.jsxs)(n.tr,{children:[(0,r.jsx)(n.td,{children:(0,r.jsx)(n.code,{children:"editUrl"})}),(0,r.jsx)(n.td,{children:(0,r.jsxs)("code",{children:["string | ",(0,r.jsx)(n.a,{href:"#EditUrlFunction",children:"EditUrlFunction"})]})}),(0,r.jsx)(n.td,{children:(0,r.jsx)(n.code,{children:"undefined"})}),(0,r.jsxs)(n.td,{children:["Base URL to edit your site. The final URL is computed by ",(0,r.jsx)(n.code,{children:"editUrl + relativeDocPath"}),". Using a function allows more nuanced control for each file. Omitting this variable entirely will disable edit links."]})]}),(0,r.jsxs)(n.tr,{children:[(0,r.jsx)(n.td,{children:(0,r.jsx)(n.code,{children:"editLocalizedFiles"})}),(0,r.jsx)(n.td,{children:(0,r.jsx)(n.code,{children:"boolean"})}),(0,r.jsx)(n.td,{children:(0,r.jsx)(n.code,{children:"false"})}),(0,r.jsxs)(n.td,{children:["The edit URL will target the localized file, instead of the original unlocalized file. Ignored when ",(0,r.jsx)(n.code,{children:"editUrl"})," is a function."]})]}),(0,r.jsxs)(n.tr,{children:[(0,r.jsx)(n.td,{children:(0,r.jsx)(n.code,{children:"editCurrentVersion"})}),(0,r.jsx)(n.td,{children:(0,r.jsx)(n.code,{children:"boolean"})}),(0,r.jsx)(n.td,{children:(0,r.jsx)(n.code,{children:"false"})}),(0,r.jsxs)(n.td,{children:["The edit URL will always target the current version doc instead of older versions. Ignored when ",(0,r.jsx)(n.code,{children:"editUrl"})," is a function."]})]}),(0,r.jsxs)(n.tr,{children:[(0,r.jsx)(n.td,{children:(0,r.jsx)(n.code,{children:"routeBasePath"})}),(0,r.jsx)(n.td,{children:(0,r.jsx)(n.code,{children:"string"})}),(0,r.jsx)(n.td,{children:(0,r.jsx)(n.code,{children:"'docs'"})}),(0,r.jsxs)(n.td,{children:["URL route for the docs section of your site. ",(0,r.jsx)(n.strong,{children:"DO NOT"})," include a trailing slash. Use ",(0,r.jsx)(n.code,{children:"/"})," for shipping docs without base path."]})]}),(0,r.jsxs)(n.tr,{children:[(0,r.jsx)(n.td,{children:(0,r.jsx)(n.code,{children:"tagsBasePath"})}),(0,r.jsx)(n.td,{children:(0,r.jsx)(n.code,{children:"string"})}),(0,r.jsx)(n.td,{children:(0,r.jsx)(n.code,{children:"'tags'"})}),(0,r.jsxs)(n.td,{children:["URL route for the tags list page of your site. It is prepended to the ",(0,r.jsx)(n.code,{children:"routeBasePath"}),"."]})]}),(0,r.jsxs)(n.tr,{children:[(0,r.jsx)(n.td,{children:(0,r.jsx)(n.code,{children:"include"})}),(0,r.jsx)(n.td,{children:(0,r.jsx)(n.code,{children:"string[]"})}),(0,r.jsx)(n.td,{children:(0,r.jsx)(n.code,{children:"['**/*.{md,mdx}']"})}),(0,r.jsx)(n.td,{children:"Array of glob patterns matching Markdown files to be built, relative to the content path."})]}),(0,r.jsxs)(n.tr,{children:[(0,r.jsx)(n.td,{children:(0,r.jsx)(n.code,{children:"exclude"})}),(0,r.jsx)(n.td,{children:(0,r.jsx)(n.code,{children:"string[]"})}),(0,r.jsx)(n.td,{children:(0,r.jsx)(n.em,{children:"See example configuration"})}),(0,r.jsxs)(n.td,{children:["Array of glob patterns matching Markdown files to be excluded. Serves as refinement based on the ",(0,r.jsx)(n.code,{children:"include"})," option."]})]}),(0,r.jsxs)(n.tr,{children:[(0,r.jsx)(n.td,{children:(0,r.jsx)(n.code,{children:"sidebarPath"})}),(0,r.jsx)(n.td,{children:(0,r.jsx)("code",{children:"false | string"})}),(0,r.jsx)(n.td,{children:(0,r.jsx)(n.code,{children:"undefined"})}),(0,r.jsxs)(n.td,{children:["Path to a sidebars configuration file, loaded in a Node.js context. Use ",(0,r.jsx)(n.code,{children:"false"})," to disable sidebars, or ",(0,r.jsx)(n.code,{children:"undefined"})," to create a fully autogenerated sidebar."]})]}),(0,r.jsxs)(n.tr,{children:[(0,r.jsx)(n.td,{children:(0,r.jsx)(n.code,{children:"sidebarCollapsible"})}),(0,r.jsx)(n.td,{children:(0,r.jsx)(n.code,{children:"boolean"})}),(0,r.jsx)(n.td,{children:(0,r.jsx)(n.code,{children:"true"})}),(0,r.jsxs)(n.td,{children:["Whether sidebar categories are collapsible by default. See also ",(0,r.jsx)(n.a,{href:"/docs/sidebar/items#collapsible-categories",children:"Collapsible categories"})]})]}),(0,r.jsxs)(n.tr,{children:[(0,r.jsx)(n.td,{children:(0,r.jsx)(n.code,{children:"sidebarCollapsed"})}),(0,r.jsx)(n.td,{children:(0,r.jsx)(n.code,{children:"boolean"})}),(0,r.jsx)(n.td,{children:(0,r.jsx)(n.code,{children:"true"})}),(0,r.jsxs)(n.td,{children:["Whether sidebar categories are collapsed by default. See also ",(0,r.jsx)(n.a,{href:"/docs/sidebar/items#expanded-categories-by-default",children:"Expanded categories by default"})]})]}),(0,r.jsxs)(n.tr,{children:[(0,r.jsx)(n.td,{children:(0,r.jsx)(n.code,{children:"sidebarItemsGenerator"})}),(0,r.jsx)(n.td,{children:(0,r.jsx)("code",{children:(0,r.jsx)(n.a,{href:"#SidebarGenerator",children:"SidebarGenerator"})})}),(0,r.jsx)(n.td,{children:(0,r.jsx)(n.em,{children:"Omitted"})}),(0,r.jsxs)(n.td,{children:["Function used to replace the sidebar items of type ",(0,r.jsx)(n.code,{children:"'autogenerated'"})," with real sidebar items (docs, categories, links...). See also ",(0,r.jsx)(n.a,{href:"/docs/sidebar/autogenerated#customize-the-sidebar-items-generator",children:"Customize the sidebar items generator"})]})]}),(0,r.jsxs)(n.tr,{children:[(0,r.jsx)(n.td,{children:(0,r.jsx)(n.code,{children:"numberPrefixParser"})}),(0,r.jsx)(n.td,{children:(0,r.jsxs)("code",{children:["boolean | ",(0,r.jsx)(n.a,{href:"#PrefixParser",children:"PrefixParser"})]})}),(0,r.jsx)(n.td,{children:(0,r.jsx)(n.em,{children:"Omitted"})}),(0,r.jsxs)(n.td,{children:["Custom parsing logic to extract number prefixes from file names. Use ",(0,r.jsx)(n.code,{children:"false"})," to disable this behavior and leave the docs untouched, and ",(0,r.jsx)(n.code,{children:"true"})," to use the default parser. See also ",(0,r.jsx)(n.a,{href:"/docs/sidebar/autogenerated#using-number-prefixes",children:"Using number prefixes"})]})]}),(0,r.jsxs)(n.tr,{children:[(0,r.jsx)(n.td,{children:(0,r.jsx)(n.code,{children:"docsRootComponent"})}),(0,r.jsx)(n.td,{children:(0,r.jsx)(n.code,{children:"string"})}),(0,r.jsx)(n.td,{children:(0,r.jsx)(n.code,{children:"'@theme/DocsRoot'"})}),(0,r.jsx)(n.td,{children:"Parent component of all the docs plugin pages (including all versions). Stays mounted when navigation between docs pages and versions."})]}),(0,r.jsxs)(n.tr,{children:[(0,r.jsx)(n.td,{children:(0,r.jsx)(n.code,{children:"docVersionRootComponent"})}),(0,r.jsx)(n.td,{children:(0,r.jsx)(n.code,{children:"string"})}),(0,r.jsx)(n.td,{children:(0,r.jsx)(n.code,{children:"'@theme/DocVersionLayout'"})}),(0,r.jsx)(n.td,{children:"Parent component of all docs pages of an individual version (doc pages with sidebars, tags pages). Stays mounted when navigation between pages of that specific version."})]}),(0,r.jsxs)(n.tr,{children:[(0,r.jsx)(n.td,{children:(0,r.jsx)(n.code,{children:"docRootComponent"})}),(0,r.jsx)(n.td,{children:(0,r.jsx)(n.code,{children:"string"})}),(0,r.jsx)(n.td,{children:(0,r.jsx)(n.code,{children:"'@theme/DocRoot'"})}),(0,r.jsx)(n.td,{children:"Parent component of all doc pages with sidebars (regular docs pages, category generated index pages). Stays mounted when navigation between such pages."})]}),(0,r.jsxs)(n.tr,{children:[(0,r.jsx)(n.td,{children:(0,r.jsx)(n.code,{children:"docItemComponent"})}),(0,r.jsx)(n.td,{children:(0,r.jsx)(n.code,{children:"string"})}),(0,r.jsx)(n.td,{children:(0,r.jsx)(n.code,{children:"'@theme/DocItem'"})}),(0,r.jsx)(n.td,{children:"Main doc container, with TOC, pagination, etc."})]}),(0,r.jsxs)(n.tr,{children:[(0,r.jsx)(n.td,{children:(0,r.jsx)(n.code,{children:"docTagsListComponent"})}),(0,r.jsx)(n.td,{children:(0,r.jsx)(n.code,{children:"string"})}),(0,r.jsx)(n.td,{children:(0,r.jsx)(n.code,{children:"'@theme/DocTagsListPage'"})}),(0,r.jsx)(n.td,{children:"Root component of the tags list page"})]}),(0,r.jsxs)(n.tr,{children:[(0,r.jsx)(n.td,{children:(0,r.jsx)(n.code,{children:"docTagDocListComponent"})}),(0,r.jsx)(n.td,{children:(0,r.jsx)(n.code,{children:"string"})}),(0,r.jsx)(n.td,{children:(0,r.jsx)(n.code,{children:"'@theme/DocTagDocListPage'"})}),(0,r.jsx)(n.td,{children:'Root component of the "docs containing tag X" page.'})]}),(0,r.jsxs)(n.tr,{children:[(0,r.jsx)(n.td,{children:(0,r.jsx)(n.code,{children:"docCategoryGeneratedIndexComponent"})}),(0,r.jsx)(n.td,{children:(0,r.jsx)(n.code,{children:"string"})}),(0,r.jsx)(n.td,{children:(0,r.jsx)(n.code,{children:"'@theme/DocCategoryGeneratedIndexPage'"})}),(0,r.jsx)(n.td,{children:"Root component of the generated category index page."})]}),(0,r.jsxs)(n.tr,{children:[(0,r.jsx)(n.td,{children:(0,r.jsx)(n.code,{children:"remarkPlugins"})}),(0,r.jsx)(n.td,{children:(0,r.jsx)(n.code,{children:"any[]"})}),(0,r.jsx)(n.td,{children:(0,r.jsx)(n.code,{children:"[]"})}),(0,r.jsx)(n.td,{children:"Remark plugins passed to MDX."})]}),(0,r.jsxs)(n.tr,{children:[(0,r.jsx)(n.td,{children:(0,r.jsx)(n.code,{children:"rehypePlugins"})}),(0,r.jsx)(n.td,{children:(0,r.jsx)(n.code,{children:"any[]"})}),(0,r.jsx)(n.td,{children:(0,r.jsx)(n.code,{children:"[]"})}),(0,r.jsx)(n.td,{children:"Rehype plugins passed to MDX."})]}),(0,r.jsxs)(n.tr,{children:[(0,r.jsx)(n.td,{children:(0,r.jsx)(n.code,{children:"rehypePlugins"})}),(0,r.jsx)(n.td,{children:(0,r.jsx)(n.code,{children:"any[]"})}),(0,r.jsx)(n.td,{children:(0,r.jsx)(n.code,{children:"[]"})}),(0,r.jsx)(n.td,{children:"Recma plugins passed to MDX."})]}),(0,r.jsxs)(n.tr,{children:[(0,r.jsx)(n.td,{children:(0,r.jsx)(n.code,{children:"beforeDefaultRemarkPlugins"})}),(0,r.jsx)(n.td,{children:(0,r.jsx)(n.code,{children:"any[]"})}),(0,r.jsx)(n.td,{children:(0,r.jsx)(n.code,{children:"[]"})}),(0,r.jsx)(n.td,{children:"Custom Remark plugins passed to MDX before the default Docusaurus Remark plugins."})]}),(0,r.jsxs)(n.tr,{children:[(0,r.jsx)(n.td,{children:(0,r.jsx)(n.code,{children:"beforeDefaultRehypePlugins"})}),(0,r.jsx)(n.td,{children:(0,r.jsx)(n.code,{children:"any[]"})}),(0,r.jsx)(n.td,{children:(0,r.jsx)(n.code,{children:"[]"})}),(0,r.jsx)(n.td,{children:"Custom Rehype plugins passed to MDX before the default Docusaurus Rehype plugins."})]}),(0,r.jsxs)(n.tr,{children:[(0,r.jsx)(n.td,{children:(0,r.jsx)(n.code,{children:"showLastUpdateAuthor"})}),(0,r.jsx)(n.td,{children:(0,r.jsx)(n.code,{children:"boolean"})}),(0,r.jsx)(n.td,{children:(0,r.jsx)(n.code,{children:"false"})}),(0,r.jsx)(n.td,{children:"Whether to display the author who last updated the doc."})]}),(0,r.jsxs)(n.tr,{children:[(0,r.jsx)(n.td,{children:(0,r.jsx)(n.code,{children:"showLastUpdateTime"})}),(0,r.jsx)(n.td,{children:(0,r.jsx)(n.code,{children:"boolean"})}),(0,r.jsx)(n.td,{children:(0,r.jsx)(n.code,{children:"false"})}),(0,r.jsxs)(n.td,{children:["Whether to display the last date the doc was updated. This requires access to git history during the build, so will not work correctly with shallow clones (a common default for CI systems). With GitHub ",(0,r.jsx)(n.code,{children:"actions/checkout"}),", use",(0,r.jsx)(n.code,{children:"fetch-depth: 0"}),"."]})]}),(0,r.jsxs)(n.tr,{children:[(0,r.jsx)(n.td,{children:(0,r.jsx)(n.code,{children:"breadcrumbs"})}),(0,r.jsx)(n.td,{children:(0,r.jsx)(n.code,{children:"boolean"})}),(0,r.jsx)(n.td,{children:(0,r.jsx)(n.code,{children:"true"})}),(0,r.jsx)(n.td,{children:"Enable or disable the breadcrumbs on doc pages."})]}),(0,r.jsxs)(n.tr,{children:[(0,r.jsx)(n.td,{children:(0,r.jsx)(n.code,{children:"disableVersioning"})}),(0,r.jsx)(n.td,{children:(0,r.jsx)(n.code,{children:"boolean"})}),(0,r.jsx)(n.td,{children:(0,r.jsx)(n.code,{children:"false"})}),(0,r.jsxs)(n.td,{children:["Explicitly disable versioning even when multiple versions exist. This will make the site only include the current version. Will error if ",(0,r.jsx)(n.code,{children:"includeCurrentVersion: false"})," and ",(0,r.jsx)(n.code,{children:"disableVersioning: true"}),"."]})]}),(0,r.jsxs)(n.tr,{children:[(0,r.jsx)(n.td,{children:(0,r.jsx)(n.code,{children:"includeCurrentVersion"})}),(0,r.jsx)(n.td,{children:(0,r.jsx)(n.code,{children:"boolean"})}),(0,r.jsx)(n.td,{children:(0,r.jsx)(n.code,{children:"true"})}),(0,r.jsx)(n.td,{children:"Include the current version of your docs."})]}),(0,r.jsxs)(n.tr,{children:[(0,r.jsx)(n.td,{children:(0,r.jsx)(n.code,{children:"lastVersion"})}),(0,r.jsx)(n.td,{children:(0,r.jsx)(n.code,{children:"string"})}),(0,r.jsxs)(n.td,{children:["First version in ",(0,r.jsx)(n.code,{children:"versions.json"})]}),(0,r.jsx)(n.td,{children:"The version navigated to in priority and displayed by default for docs navbar items."})]}),(0,r.jsxs)(n.tr,{children:[(0,r.jsx)(n.td,{children:(0,r.jsx)(n.code,{children:"onlyIncludeVersions"})}),(0,r.jsx)(n.td,{children:(0,r.jsx)(n.code,{children:"string[]"})}),(0,r.jsx)(n.td,{children:"All versions available"}),(0,r.jsx)(n.td,{children:"Only include a subset of all available versions."})]}),(0,r.jsxs)(n.tr,{children:[(0,r.jsx)(n.td,{children:(0,r.jsx)(n.code,{children:"versions"})}),(0,r.jsx)(n.td,{children:(0,r.jsx)("code",{children:(0,r.jsx)(n.a,{href:"#VersionsConfig",children:"VersionsConfig"})})}),(0,r.jsx)(n.td,{children:(0,r.jsx)(n.code,{children:"{}"})}),(0,r.jsx)(n.td,{children:"Independent customization of each version's properties."})]}),(0,r.jsxs)(n.tr,{children:[(0,r.jsx)(n.td,{children:(0,r.jsx)(n.code,{children:"tags"})}),(0,r.jsx)(n.td,{children:(0,r.jsx)(n.code,{children:"string | false | null | undefined"})}),(0,r.jsx)(n.td,{children:(0,r.jsx)(n.code,{children:"tags.yml"})}),(0,r.jsx)(n.td,{children:"Path to a YAML file listing pre-defined tags. Relative to the docs version content directories."})]}),(0,r.jsxs)(n.tr,{children:[(0,r.jsx)(n.td,{children:(0,r.jsx)(n.code,{children:"onInlineTags"})}),(0,r.jsx)(n.td,{children:(0,r.jsx)(n.code,{children:"'ignore' | 'log' | 'warn' | 'throw'"})}),(0,r.jsx)(n.td,{children:(0,r.jsx)(n.code,{children:"warn"})}),(0,r.jsxs)(n.td,{children:["The plugin behavior when docs contain inline tags (not appearing in the list of pre-defined tags, usually ",(0,r.jsx)(n.code,{children:"docs/tags.yml"}),")."]})]})]})]})}),"\n",(0,r.jsx)(n.h3,{id:"types",children:"Types"}),"\n",(0,r.jsx)(n.h4,{id:"EditUrlFunction",children:(0,r.jsx)(n.code,{children:"EditUrlFunction"})}),"\n",(0,r.jsx)(n.pre,{children:(0,r.jsx)(n.code,{className:"language-ts",children:"type EditUrlFunction = (params: {\n version: string;\n versionDocsDirPath: string;\n docPath: string;\n permalink: string;\n locale: string;\n}) => string | undefined;\n"})}),"\n",(0,r.jsx)(n.h4,{id:"PrefixParser",children:(0,r.jsx)(n.code,{children:"PrefixParser"})}),"\n",(0,r.jsx)(n.pre,{children:(0,r.jsx)(n.code,{className:"language-ts",children:"type PrefixParser = (filename: string) => {\n filename: string;\n numberPrefix?: number;\n};\n"})}),"\n",(0,r.jsx)(n.h4,{id:"SidebarGenerator",children:(0,r.jsx)(n.code,{children:"SidebarGenerator"})}),"\n",(0,r.jsx)(n.pre,{children:(0,r.jsx)(n.code,{className:"language-ts",children:"type SidebarGenerator = (generatorArgs: {\n /** The sidebar item with type \"autogenerated\" to be transformed. */\n item: {type: 'autogenerated'; dirName: string};\n /** Useful metadata for the version this sidebar belongs to. */\n version: {contentPath: string; versionName: string};\n /** All the docs of that version (unfiltered). */\n docs: {\n id: string;\n title: string;\n frontMatter: DocFrontMatter & Record;\n source: string;\n sourceDirName: string;\n sidebarPosition?: number | undefined;\n }[];\n /** Number prefix parser configured for this plugin. */\n numberPrefixParser: PrefixParser;\n /** The default category index matcher which you can override. */\n isCategoryIndex: CategoryIndexMatcher;\n /**\n * key is the path relative to the doc content directory, value is the\n * category metadata file's content.\n */\n categoriesMetadata: {[filePath: string]: CategoryMetadata};\n /**\n * Useful to re-use/enhance the default sidebar generation logic from\n * Docusaurus.\n */\n defaultSidebarItemsGenerator: SidebarGenerator;\n // Returns an array of sidebar items \u2014 same as what you can declare in\n // sidebars.js, except for shorthands. See https://docusaurus.io/docs/sidebar/items\n}) => Promise ;\n\ntype CategoryIndexMatcher = (param: {\n /** The file name, without extension */\n fileName: string;\n /**\n * The list of directories, from lowest level to highest.\n * If there's no dir name, directories is ['.']\n */\n directories: string[];\n /** The extension, with a leading dot */\n extension: string;\n}) => boolean;\n"})}),"\n",(0,r.jsx)(n.h4,{id:"VersionsConfig",children:(0,r.jsx)(n.code,{children:"VersionsConfig"})}),"\n",(0,r.jsx)(n.pre,{children:(0,r.jsx)(n.code,{className:"language-ts",children:"type VersionConfig = {\n /**\n * The base path of the version, will be appended to `baseUrl` +\n * `routeBasePath`.\n */\n path?: string;\n /** The label of the version to be used in badges, dropdowns, etc. */\n label?: string;\n /** The banner to show at the top of a doc of that version. */\n banner?: 'none' | 'unreleased' | 'unmaintained';\n /** Show a badge with the version label at the top of each doc. */\n badge?: boolean;\n /** Prevents search engines from indexing this version */\n noIndex?: boolean;\n /** Add a custom class name to the element of each doc */\n className?: string;\n};\n\ntype VersionsConfig = {[versionName: string]: VersionConfig};\n"})}),"\n",(0,r.jsx)(n.h3,{id:"ex-config",children:"Example configuration"}),"\n",(0,r.jsx)(n.p,{children:"You can configure this plugin through preset options or plugin options."}),"\n",(0,r.jsx)(n.admonition,{type:"tip",children:(0,r.jsx)(n.p,{children:"Most Docusaurus users configure this plugin through the preset options."})}),"\n","\n",(0,r.jsx)(c.Z,{pluginName:"@docusaurus/plugin-content-docs",presetOptionName:"docs",code:"{\n path: 'docs',\n breadcrumbs: true,\n // Simple use-case: string editUrl\n // editUrl: 'https://github.com/facebook/docusaurus/edit/main/website/',\n // Advanced use-case: functional editUrl\n editUrl: ({versionDocsDirPath, docPath}) =>\n `https://github.com/facebook/docusaurus/edit/main/website/${versionDocsDirPath}/${docPath}`,\n editLocalizedFiles: false,\n editCurrentVersion: false,\n routeBasePath: 'docs',\n include: ['**/*.md', '**/*.mdx'],\n exclude: [\n '**/_*.{js,jsx,ts,tsx,md,mdx}',\n '**/_*/**',\n '**/*.test.{js,jsx,ts,tsx}',\n '**/__tests__/**',\n ],\n sidebarPath: 'sidebars.js',\n async sidebarItemsGenerator({\n defaultSidebarItemsGenerator,\n numberPrefixParser,\n item,\n version,\n docs,\n isCategoryIndex,\n }) {\n // Use the provided data to generate a custom sidebar slice\n return [\n {type: 'doc', id: 'intro'},\n {\n type: 'category',\n label: 'Tutorials',\n items: [\n {type: 'doc', id: 'tutorial1'},\n {type: 'doc', id: 'tutorial2'},\n ],\n },\n ];\n },\n numberPrefixParser(filename) {\n // Implement your own logic to extract a potential number prefix\n const numberPrefix = findNumberPrefix(filename);\n // Prefix found: return it with the cleaned filename\n if (numberPrefix) {\n return {\n numberPrefix,\n filename: filename.replace(prefix, ''),\n };\n }\n // No number prefix found\n return {numberPrefix: undefined, filename};\n },\n docsRootComponent: '@theme/DocsRoot',\n docVersionRootComponent: '@theme/DocVersionRoot',\n docRootComponent: '@theme/DocRoot',\n docItemComponent: '@theme/DocItem',\n remarkPlugins: [require('./my-remark-plugin')],\n rehypePlugins: [],\n beforeDefaultRemarkPlugins: [],\n beforeDefaultRehypePlugins: [],\n showLastUpdateAuthor: false,\n showLastUpdateTime: false,\n disableVersioning: false,\n includeCurrentVersion: true,\n lastVersion: undefined,\n versions: {\n current: {\n label: 'Android SDK v2.0.0 (WIP)',\n path: 'android-2.0.0',\n banner: 'none',\n },\n '1.0.0': {\n label: 'Android SDK v1.0.0',\n path: 'android-1.0.0',\n banner: 'unmaintained',\n },\n },\n onlyIncludeVersions: ['current', '1.0.0', '2.0.0'],\n}"}),"\n",(0,r.jsx)(n.h2,{id:"markdown-front-matter",children:"Markdown front matter"}),"\n",(0,r.jsxs)(n.p,{children:["Markdown documents can use the following Markdown ",(0,r.jsx)(n.a,{href:"/docs/markdown-features#front-matter",children:"front matter"})," metadata fields, enclosed by a line ",(0,r.jsx)(n.code,{children:"---"})," on either side."]}),"\n",(0,r.jsx)(n.p,{children:"Accepted fields:"}),"\n",(0,r.jsx)(o.Z,{children:(0,r.jsxs)(n.table,{children:[(0,r.jsx)(n.thead,{children:(0,r.jsxs)(n.tr,{children:[(0,r.jsx)(n.th,{children:"Name"}),(0,r.jsx)(n.th,{children:"Type"}),(0,r.jsx)(n.th,{children:"Default"}),(0,r.jsx)(n.th,{children:"Description"})]})}),(0,r.jsxs)(n.tbody,{children:[(0,r.jsxs)(n.tr,{children:[(0,r.jsx)(n.td,{children:(0,r.jsx)(n.code,{children:"id"})}),(0,r.jsx)(n.td,{children:(0,r.jsx)(n.code,{children:"string"})}),(0,r.jsx)(n.td,{children:"file path (including folders, without the extension)"}),(0,r.jsx)(n.td,{children:"A unique document ID."})]}),(0,r.jsxs)(n.tr,{children:[(0,r.jsx)(n.td,{children:(0,r.jsx)(n.code,{children:"title"})}),(0,r.jsx)(n.td,{children:(0,r.jsx)(n.code,{children:"string"})}),(0,r.jsxs)(n.td,{children:["Markdown title or ",(0,r.jsx)(n.code,{children:"id"})]}),(0,r.jsx)(n.td,{children:"The text title of your document. Used for the page metadata and as a fallback value in multiple places (sidebar, next/previous buttons...). Automatically added at the top of your doc if it does not contain any Markdown title."})]}),(0,r.jsxs)(n.tr,{children:[(0,r.jsx)(n.td,{children:(0,r.jsx)(n.code,{children:"pagination_label"})}),(0,r.jsx)(n.td,{children:(0,r.jsx)(n.code,{children:"string"})}),(0,r.jsxs)(n.td,{children:[(0,r.jsx)(n.code,{children:"sidebar_label"})," or ",(0,r.jsx)(n.code,{children:"title"})]}),(0,r.jsx)(n.td,{children:"The text used in the document next/previous buttons for this document."})]}),(0,r.jsxs)(n.tr,{children:[(0,r.jsx)(n.td,{children:(0,r.jsx)(n.code,{children:"sidebar_label"})}),(0,r.jsx)(n.td,{children:(0,r.jsx)(n.code,{children:"string"})}),(0,r.jsx)(n.td,{children:(0,r.jsx)(n.code,{children:"title"})}),(0,r.jsx)(n.td,{children:"The text shown in the document sidebar for this document."})]}),(0,r.jsxs)(n.tr,{children:[(0,r.jsx)(n.td,{children:(0,r.jsx)(n.code,{children:"sidebar_position"})}),(0,r.jsx)(n.td,{children:(0,r.jsx)(n.code,{children:"number"})}),(0,r.jsx)(n.td,{children:"Default ordering"}),(0,r.jsxs)(n.td,{children:["Controls the position of a doc inside the generated sidebar slice when using ",(0,r.jsx)(n.code,{children:"autogenerated"})," sidebar items. See also ",(0,r.jsx)(n.a,{href:"/docs/sidebar/autogenerated#autogenerated-sidebar-metadata",children:"Autogenerated sidebar metadata"}),"."]})]}),(0,r.jsxs)(n.tr,{children:[(0,r.jsx)(n.td,{children:(0,r.jsx)(n.code,{children:"sidebar_class_name"})}),(0,r.jsx)(n.td,{children:(0,r.jsx)(n.code,{children:"string"})}),(0,r.jsx)(n.td,{children:(0,r.jsx)(n.code,{children:"undefined"})}),(0,r.jsx)(n.td,{children:"Gives the corresponding sidebar label a special class name when using autogenerated sidebars."})]}),(0,r.jsxs)(n.tr,{children:[(0,r.jsx)(n.td,{children:(0,r.jsx)(n.code,{children:"sidebar_custom_props"})}),(0,r.jsx)(n.td,{children:(0,r.jsx)(n.code,{children:"object"})}),(0,r.jsx)(n.td,{children:(0,r.jsx)(n.code,{children:"undefined"})}),(0,r.jsxs)(n.td,{children:["Assign ",(0,r.jsx)(n.a,{href:"/docs/sidebar#passing-custom-props",children:"custom props"})," to the sidebar item referencing this doc"]})]}),(0,r.jsxs)(n.tr,{children:[(0,r.jsx)(n.td,{children:(0,r.jsx)(n.code,{children:"displayed_sidebar"})}),(0,r.jsx)(n.td,{children:(0,r.jsx)(n.code,{children:"string"})}),(0,r.jsx)(n.td,{children:(0,r.jsx)(n.code,{children:"undefined"})}),(0,r.jsxs)(n.td,{children:["Force the display of a given sidebar when browsing the current document. Read the ",(0,r.jsx)(n.a,{href:"/docs/sidebar/multiple-sidebars",children:"multiple sidebars guide"})," for details."]})]}),(0,r.jsxs)(n.tr,{children:[(0,r.jsx)(n.td,{children:(0,r.jsx)(n.code,{children:"hide_title"})}),(0,r.jsx)(n.td,{children:(0,r.jsx)(n.code,{children:"boolean"})}),(0,r.jsx)(n.td,{children:(0,r.jsx)(n.code,{children:"false"})}),(0,r.jsx)(n.td,{children:"Whether to hide the title at the top of the doc. It only hides a title declared through the front matter, and have no effect on a Markdown title at the top of your document."})]}),(0,r.jsxs)(n.tr,{children:[(0,r.jsx)(n.td,{children:(0,r.jsx)(n.code,{children:"hide_table_of_contents"})}),(0,r.jsx)(n.td,{children:(0,r.jsx)(n.code,{children:"boolean"})}),(0,r.jsx)(n.td,{children:(0,r.jsx)(n.code,{children:"false"})}),(0,r.jsx)(n.td,{children:"Whether to hide the table of contents to the right."})]}),(0,r.jsxs)(n.tr,{children:[(0,r.jsx)(n.td,{children:(0,r.jsx)(n.code,{children:"toc_min_heading_level"})}),(0,r.jsx)(n.td,{children:(0,r.jsx)(n.code,{children:"number"})}),(0,r.jsx)(n.td,{children:(0,r.jsx)(n.code,{children:"2"})}),(0,r.jsx)(n.td,{children:"The minimum heading level shown in the table of contents. Must be between 2 and 6 and lower or equal to the max value."})]}),(0,r.jsxs)(n.tr,{children:[(0,r.jsx)(n.td,{children:(0,r.jsx)(n.code,{children:"toc_max_heading_level"})}),(0,r.jsx)(n.td,{children:(0,r.jsx)(n.code,{children:"number"})}),(0,r.jsx)(n.td,{children:(0,r.jsx)(n.code,{children:"3"})}),(0,r.jsx)(n.td,{children:"The max heading level shown in the table of contents. Must be between 2 and 6."})]}),(0,r.jsxs)(n.tr,{children:[(0,r.jsx)(n.td,{children:(0,r.jsx)(n.code,{children:"pagination_next"})}),(0,r.jsx)(n.td,{children:(0,r.jsx)("code",{children:"string | null"})}),(0,r.jsx)(n.td,{children:"Next doc in the sidebar"}),(0,r.jsxs)(n.td,{children:['The ID of the documentation you want the "Next" pagination to link to. Use ',(0,r.jsx)(n.code,{children:"null"}),' to disable showing "Next" for this page.']})]}),(0,r.jsxs)(n.tr,{children:[(0,r.jsx)(n.td,{children:(0,r.jsx)(n.code,{children:"pagination_prev"})}),(0,r.jsx)(n.td,{children:(0,r.jsx)("code",{children:"string | null"})}),(0,r.jsx)(n.td,{children:"Previous doc in the sidebar"}),(0,r.jsxs)(n.td,{children:['The ID of the documentation you want the "Previous" pagination to link to. Use ',(0,r.jsx)(n.code,{children:"null"}),' to disable showing "Previous" for this page.']})]}),(0,r.jsxs)(n.tr,{children:[(0,r.jsx)(n.td,{children:(0,r.jsx)(n.code,{children:"parse_number_prefixes"})}),(0,r.jsx)(n.td,{children:(0,r.jsx)(n.code,{children:"boolean"})}),(0,r.jsxs)(n.td,{children:[(0,r.jsx)(n.code,{children:"numberPrefixParser"})," plugin option"]}),(0,r.jsxs)(n.td,{children:["Whether number prefix parsing is disabled on this doc. See also ",(0,r.jsx)(n.a,{href:"/docs/sidebar/autogenerated#using-number-prefixes",children:"Using number prefixes"}),"."]})]}),(0,r.jsxs)(n.tr,{children:[(0,r.jsx)(n.td,{children:(0,r.jsx)(n.code,{children:"custom_edit_url"})}),(0,r.jsx)(n.td,{children:(0,r.jsx)("code",{children:"string | null"})}),(0,r.jsxs)(n.td,{children:["Computed using the ",(0,r.jsx)(n.code,{children:"editUrl"})," plugin option"]}),(0,r.jsxs)(n.td,{children:["The URL for editing this document. Use ",(0,r.jsx)(n.code,{children:"null"}),' to disable showing "Edit this page" for this page.']})]}),(0,r.jsxs)(n.tr,{children:[(0,r.jsx)(n.td,{children:(0,r.jsx)(n.code,{children:"keywords"})}),(0,r.jsx)(n.td,{children:(0,r.jsx)(n.code,{children:"string[]"})}),(0,r.jsx)(n.td,{children:(0,r.jsx)(n.code,{children:"undefined"})}),(0,r.jsx)(n.td,{children:"Keywords meta tag for the document page, for search engines."})]}),(0,r.jsxs)(n.tr,{children:[(0,r.jsx)(n.td,{children:(0,r.jsx)(n.code,{children:"description"})}),(0,r.jsx)(n.td,{children:(0,r.jsx)(n.code,{children:"string"})}),(0,r.jsx)(n.td,{children:"The first line of Markdown content"}),(0,r.jsxs)(n.td,{children:["The description of your document, which will become the ",(0,r.jsx)(n.code,{children:''})," and ",(0,r.jsx)(n.code,{children:''})," in ",(0,r.jsx)(n.code,{children:""}),", used by search engines."]})]}),(0,r.jsxs)(n.tr,{children:[(0,r.jsx)(n.td,{children:(0,r.jsx)(n.code,{children:"image"})}),(0,r.jsx)(n.td,{children:(0,r.jsx)(n.code,{children:"string"})}),(0,r.jsx)(n.td,{children:(0,r.jsx)(n.code,{children:"undefined"})}),(0,r.jsxs)(n.td,{children:["Cover or thumbnail image that will be used as the ",(0,r.jsx)(n.code,{children:''})," in the ",(0,r.jsx)(n.code,{children:""}),", enhancing link previews on social media and messaging platforms."]})]}),(0,r.jsxs)(n.tr,{children:[(0,r.jsx)(n.td,{children:(0,r.jsx)(n.code,{children:"slug"})}),(0,r.jsx)(n.td,{children:(0,r.jsx)(n.code,{children:"string"})}),(0,r.jsx)(n.td,{children:"File path"}),(0,r.jsxs)(n.td,{children:["Allows to customize the document URL (",(0,r.jsx)(n.code,{children:"/ / "}),"). Support multiple patterns: ",(0,r.jsx)(n.code,{children:"slug: my-doc"}),", ",(0,r.jsx)(n.code,{children:"slug: /my/path/myDoc"}),", ",(0,r.jsx)(n.code,{children:"slug: /"}),"."]})]}),(0,r.jsxs)(n.tr,{children:[(0,r.jsx)(n.td,{children:(0,r.jsx)(n.code,{children:"tags"})}),(0,r.jsx)(n.td,{children:(0,r.jsx)(n.code,{children:"Tag[]"})}),(0,r.jsx)(n.td,{children:(0,r.jsx)(n.code,{children:"undefined"})}),(0,r.jsxs)(n.td,{children:["A list of strings or objects of two string fields ",(0,r.jsx)(n.code,{children:"label"})," and ",(0,r.jsx)(n.code,{children:"permalink"})," to tag to your docs. Strings can be a reference to keys of a ",(0,r.jsx)(n.a,{href:"#tags-file",children:"tags file"})," (usually ",(0,r.jsx)(n.code,{children:"tags.yml"}),")"]})]}),(0,r.jsxs)(n.tr,{children:[(0,r.jsx)(n.td,{children:(0,r.jsx)(n.code,{children:"draft"})}),(0,r.jsx)(n.td,{children:(0,r.jsx)(n.code,{children:"boolean"})}),(0,r.jsx)(n.td,{children:(0,r.jsx)(n.code,{children:"false"})}),(0,r.jsx)(n.td,{children:"Draft documents will only be available during development."})]}),(0,r.jsxs)(n.tr,{children:[(0,r.jsx)(n.td,{children:(0,r.jsx)(n.code,{children:"unlisted"})}),(0,r.jsx)(n.td,{children:(0,r.jsx)(n.code,{children:"boolean"})}),(0,r.jsx)(n.td,{children:(0,r.jsx)(n.code,{children:"false"})}),(0,r.jsx)(n.td,{children:'Unlisted documents will be available in both development and production. They will be "hidden" in production, not indexed, excluded from sitemaps, and can only be accessed by users having a direct link.'})]}),(0,r.jsxs)(n.tr,{children:[(0,r.jsx)(n.td,{children:(0,r.jsx)(n.code,{children:"last_update"})}),(0,r.jsx)(n.td,{children:(0,r.jsx)(n.code,{children:"FrontMatterLastUpdate"})}),(0,r.jsx)(n.td,{children:(0,r.jsx)(n.code,{children:"undefined"})}),(0,r.jsxs)(n.td,{children:["Allows overriding the last update author/date. Date can be any ",(0,r.jsx)(n.a,{href:"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/parse",children:"parsable date string"}),"."]})]})]})]})}),"\n",(0,r.jsx)(n.pre,{children:(0,r.jsx)(n.code,{className:"language-ts",children:"type FrontMatterLastUpdate = {date?: string; author?: string};\n\ntype Tag = string | {label: string; permalink: string};\n"})}),"\n",(0,r.jsx)(n.p,{children:"Example:"}),"\n",(0,r.jsx)(n.pre,{children:(0,r.jsx)(n.code,{className:"language-md",children:"---\nid: doc-markdown\ntitle: Docs Markdown Features\nhide_title: false\nhide_table_of_contents: false\nsidebar_label: Markdown\nsidebar_position: 3\npagination_label: Markdown features\ncustom_edit_url: https://github.com/facebook/docusaurus/edit/main/docs/api-doc-markdown.md\ndescription: How do I find you when I cannot solve this problem\nkeywords:\n - docs\n - docusaurus\ntags: [docusaurus]\nimage: https://i.imgur.com/mErPwqL.png\nslug: /myDoc\nlast_update:\n date: 1/1/2000\n author: custom author name\n---\n\n# Markdown Features\n\nMy Document Markdown content\n"})}),"\n","\n",(0,r.jsx)(a.ZP,{}),"\n",(0,r.jsx)(n.h2,{id:"i18n",children:"i18n"}),"\n",(0,r.jsxs)(n.p,{children:["Read the ",(0,r.jsx)(n.a,{href:"/docs/i18n/introduction",children:"i18n introduction"})," first."]}),"\n",(0,r.jsx)(n.h3,{id:"translation-files-location",children:"Translation files location"}),"\n",(0,r.jsxs)(n.ul,{children:["\n",(0,r.jsxs)(n.li,{children:[(0,r.jsx)(n.strong,{children:"Base path"}),": ",(0,r.jsx)(n.code,{children:"website/i18n/[locale]/docusaurus-plugin-content-docs"})]}),"\n",(0,r.jsxs)(n.li,{children:[(0,r.jsx)(n.strong,{children:"Multi-instance path"}),": ",(0,r.jsx)(n.code,{children:"website/i18n/[locale]/docusaurus-plugin-content-docs-[pluginId]"})]}),"\n",(0,r.jsxs)(n.li,{children:[(0,r.jsx)(n.strong,{children:"JSON files"}),": extracted with ",(0,r.jsx)(n.a,{href:"/docs/cli#docusaurus-write-translations-sitedir",children:(0,r.jsx)(n.code,{children:"docusaurus write-translations"})})]}),"\n",(0,r.jsxs)(n.li,{children:[(0,r.jsx)(n.strong,{children:"Markdown files"}),": ",(0,r.jsx)(n.code,{children:"website/i18n/[locale]/docusaurus-plugin-content-docs/[versionName]"})]}),"\n"]}),"\n",(0,r.jsx)(n.h3,{id:"example-file-system-structure",children:"Example file-system structure"}),"\n",(0,r.jsx)(n.pre,{children:(0,r.jsx)(n.code,{className:"language-bash",children:"website/i18n/[locale]/docusaurus-plugin-content-docs\n\u2502\n\u2502 # translations for website/docs\n\u251C\u2500\u2500 current\n\u2502 \u251C\u2500\u2500 api\n\u2502 \u2502 \u2514\u2500\u2500 config.md\n\u2502 \u2514\u2500\u2500 getting-started.md\n\u251C\u2500\u2500 current.json\n\u2502\n\u2502 # translations for website/versioned_docs/version-1.0.0\n\u251C\u2500\u2500 version-1.0.0\n\u2502 \u251C\u2500\u2500 api\n\u2502 \u2502 \u2514\u2500\u2500 config.md\n\u2502 \u2514\u2500\u2500 getting-started.md\n\u2514\u2500\u2500 version-1.0.0.json\n"})})]})}function g(e={}){let{wrapper:n}={...(0,i.a)(),...e.components};return n?(0,r.jsx)(n,{...e,children:(0,r.jsx)(p,{...e})}):p(e)}},58636:function(e,n,t){t.d(n,{Z:()=>i});var s=t(85893);t(67294);var r=t(90496);function i(e){let{children:n,hidden:t,className:i}=e;return(0,s.jsx)("div",{role:"tabpanel",className:(0,r.Z)("tabItem_pnkT",i),hidden:t,children:n})}},15398:function(e,n,t){t.d(n,{Z:()=>f});var s=t(85893),r=t(67294),i=t(90496),d=t(54947),l=t(3620),o=t(844),c=t(97486),a=t(32263),h=t(16971);function u(e){return r.Children.toArray(e).filter(e=>"\n"!==e).map(e=>{if(!e||(0,r.isValidElement)(e)&&function(e){let{props:n}=e;return!!n&&"object"==typeof n&&"value"in n}(e))return e;throw Error(`Docusaurus error: Bad child <${"string"==typeof e.type?e.type:e.type.name}>: all children of the component should be , and every should have a unique "value" prop.`)})?.filter(Boolean)??[]}function x(e){let{value:n,tabValues:t}=e;return t.some(e=>e.value===n)}var j=t(71607);function p(e){let{className:n,block:t,selectedValue:r,selectValue:l,tabValues:o}=e,c=[],{blockElementScrollPositionUntilNextRender:a}=(0,d.o5)(),h=e=>{let n=e.currentTarget,t=o[c.indexOf(n)].value;t!==r&&(a(n),l(t))},u=e=>{let n=null;switch(e.key){case"Enter":h(e);break;case"ArrowRight":{let t=c.indexOf(e.currentTarget)+1;n=c[t]??c[0];break}case"ArrowLeft":{let t=c.indexOf(e.currentTarget)-1;n=c[t]??c[c.length-1]}}n?.focus()};return(0,s.jsx)("ul",{role:"tablist","aria-orientation":"horizontal",className:(0,i.Z)("tabs",{"tabs--block":t},n),children:o.map(e=>{let{value:n,label:t,attributes:d}=e;return(0,s.jsx)("li",{role:"tab",tabIndex:r===n?0:-1,"aria-selected":r===n,ref:e=>{c.push(e)},onKeyDown:u,onClick:h,...d,className:(0,i.Z)("tabs__item","tabItem_AQgk",d?.className,{"tabs__item--active":r===n}),children:t??n},n)})})}function g(e){let{lazy:n,children:t,selectedValue:d}=e,l=(Array.isArray(t)?t:[t]).filter(Boolean);if(n){let e=l.find(e=>e.props.value===d);return e?(0,r.cloneElement)(e,{className:(0,i.Z)("margin-top--md",e.props.className)}):null}return(0,s.jsx)("div",{className:"margin-top--md",children:l.map((e,n)=>(0,r.cloneElement)(e,{key:n,hidden:e.props.value!==d}))})}function m(e){let n=function(e){let{defaultValue:n,queryString:t=!1,groupId:s}=e,i=function(e){let{values:n,children:t}=e;return(0,r.useMemo)(()=>{let e=n??u(t).map(e=>{let{props:{value:n,label:t,attributes:s,default:r}}=e;return{value:n,label:t,attributes:s,default:r}}),s=(0,a.lx)(e,(e,n)=>e.value===n.value);if(s.length>0)throw Error(`Docusaurus error: Duplicate values "${s.map(e=>e.value).join(", ")}" found in . Every value needs to be unique.`);return e},[n,t])}(e),[d,j]=(0,r.useState)(()=>(function(e){let{defaultValue:n,tabValues:t}=e;if(0===t.length)throw Error("Docusaurus error: the component requires at least one children component");if(n){if(!x({value:n,tabValues:t}))throw Error(`Docusaurus error: The has a defaultValue "${n}" but none of its children has the corresponding value. Available values are: ${t.map(e=>e.value).join(", ")}. If you intend to show no default tab, use defaultValue={null} instead.`);return n}let s=t.find(e=>e.default)??t[0];if(!s)throw Error("Unexpected error: 0 tabValues");return s.value})({defaultValue:n,tabValues:i})),[p,g]=function(e){let{queryString:n=!1,groupId:t}=e,s=(0,l.k6)(),i=function(e){let{queryString:n=!1,groupId:t}=e;if("string"==typeof n)return n;if(!1===n)return null;if(!0===n&&!t)throw Error('Docusaurus error: The component groupId prop is required if queryString=true, because this value is used as the search param name. You can also provide an explicit value such as queryString="my-search-param".');return t??null}({queryString:n,groupId:t});return[(0,c._X)(i),(0,r.useCallback)(e=>{if(!i)return;let n=new URLSearchParams(s.location.search);n.set(i,e),s.replace({...s.location,search:n.toString()})},[i,s])]}({queryString:t,groupId:s}),[m,f]=function(e){let{groupId:n}=e,t=n?`docusaurus.tab.${n}`:null,[s,i]=(0,h.Nk)(t);return[s,(0,r.useCallback)(e=>{t&&i.set(e)},[t,i])]}({groupId:s}),b=(()=>{let e=p??m;return x({value:e,tabValues:i})?e:null})();return(0,o.Z)(()=>{b&&j(b)},[b]),{selectedValue:d,selectValue:(0,r.useCallback)(e=>{if(!x({value:e,tabValues:i}))throw Error(`Can't select invalid tab value=${e}`);j(e),g(e),f(e)},[g,f,i]),tabValues:i}}(e);return(0,s.jsxs)("div",{className:(0,i.Z)("tabs-container","tabList_Qoir"),children:[(0,s.jsx)(p,{...n,...e}),(0,s.jsx)(g,{...n,...e})]})}function f(e){let n=(0,j.Z)();return(0,s.jsx)(m,{...e,children:u(e.children)},String(n))}},56497:function(e,n,t){t.d(n,{Z:()=>i});var s=t(85893);t(67294);var r=t(71607);function i(e){let{children:n,fallback:t}=e;return(0,r.Z)()?(0,s.jsx)(s.Fragment,{children:n?.()}):t??null}},32240:function(e,n,t){t.d(n,{Z:()=>o});var s=t(85893),r=t(67294),i=t(96700),d=t(3620);let l=r.forwardRef(function(e,n){let{name:t,children:l}=e,o=function(e){let n=e;for(;(0,r.isValidElement)(n);)[n]=r.Children.toArray(n.props.children);if("string"!=typeof n)throw Error(`Could not extract APITable row name from JSX tree: -${JSON.stringify(e,null,2)}`);return n}(l),c=t?`${t}-${o}`:o,a=`#${c}`,h=(0,d.k6)();return(0,i.Z)().collectAnchor(c),(0,s.jsx)("tr",{id:c,tabIndex:0,ref:h.location.hash===a?n:void 0,onClick:e=>{let n="TD"===e.target.tagName.toUpperCase(),t=!!window.getSelection()?.toString();n&&!t&&h.push(a)},onKeyDown:e=>{"Enter"===e.key&&h.push(a)},children:l.props.children})});function o(e){let{children:n,name:t}=e;if("table"!==n.type)throw Error("Bad usage of APITable component.\nIt is probably that your Markdown table is malformed.\nMake sure to double-check you have the appropriate number of columns for each table row.");let[i,d]=r.Children.toArray(n.props.children),o=(0,r.useRef)(null);(0,r.useEffect)(()=>{o.current?.focus()},[o]);let c=r.Children.map(d.props.children,e=>(0,s.jsx)(l,{name:t,ref:o,children:e}));return(0,s.jsxs)("table",{className:"apiTable_e8hp",children:[i,(0,s.jsx)("tbody",{children:c})]})}},66359:function(e,n,t){t.d(n,{Z:()=>h});var s=t(85893);t(67294);var r=t(35363),i=t(90158),d=t(77827),l=t(15398),o=t(58636),c=t(93278);let a=void 0;function h(e){let{code:n,pluginName:t,presetOptionName:h}=e,u=(0,i.zu)(a).path;return(0,s.jsxs)(l.Z,{groupId:"api-config-ex",children:[(0,s.jsxs)(o.Z,{value:"preset",label:(0,d.I)({message:"Preset options"}),children:[(0,s.jsx)("p",{children:(0,s.jsx)(d.Z,{id:"apiDocs.configTabs.presetOptions.description",values:{presetLink:(0,s.jsx)(r.Z,{to:`${u}/using-plugins#docusauruspreset-classic`,children:(0,s.jsx)(d.Z,{children:"preset options"})})},children:"If you use a preset, configure this plugin through the {presetLink}:"})}),(0,s.jsx)(c.Z,{language:"js",title:"docusaurus.config.js",children:`module.exports = { - presets: [ - [ - '@docusaurus/preset-classic', - { - // highlight-start - ${h}: ${n.replace(/\n/g,"\n ")}, - // highlight-end - }, - ], - ], -};`})]}),(0,s.jsxs)(o.Z,{value:"plugin",label:(0,d.I)({message:"Plugin options"}),children:[(0,s.jsx)("p",{children:(0,s.jsx)(d.Z,{children:"If you are using a standalone plugin, provide options directly to the plugin:"})}),(0,s.jsx)(c.Z,{language:"js",title:"docusaurus.config.js",children:`module.exports = { - plugins: [ - [ - '${t}', - // highlight-start - ${n.replace(/\n/g,"\n ")}, - // highlight-end - ], - ], -};`})]})]})}},93278:function(e,n,t){t.d(n,{Z:()=>ex});var s,r={};t.r(r),t.d(r,{ButtonExample:()=>T});var i=t(85893),d=t(67294),l=t(90496),o=t(71607),c=t(10075),a=t(77827),h=t(8156),u=t(56497),x=t(85108),j=t(45245),p=t(26378);function g(){let{prism:e}=(0,p.L)(),{colorMode:n}=(0,j.I)(),t=e.theme,s=e.darkTheme||t;return"dark"===n?s:t}var m=t(67490);function f(e){let{children:n}=e;return(0,i.jsx)("div",{className:(0,l.Z)("playgroundHeader_Tvsk"),children:n})}function b(){return(0,i.jsx)("div",{children:"Loading..."})}function v(){return(0,i.jsx)(u.Z,{fallback:(0,i.jsx)(b,{}),children:()=>(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(m.Z,{fallback:e=>(0,i.jsx)(x.Ac,{...e}),children:(0,i.jsx)(c.i5,{})}),(0,i.jsx)(c.IF,{})]})})}function y(){return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(f,{children:(0,i.jsx)(a.Z,{id:"theme.Playground.result",description:"The result label of the live codeblocks",children:"Result"})}),(0,i.jsx)("div",{className:"playgroundPreview_mApW",children:(0,i.jsx)(v,{})})]})}function w(){let e=(0,o.Z)();return(0,i.jsx)(c.uz,{className:"playgroundEditor_TySg"},String(e))}function k(){return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(f,{children:(0,i.jsx)(a.Z,{id:"theme.Playground.liveEditor",description:"The live editor label of the live codeblocks",children:"Live Editor"})}),(0,i.jsx)(w,{})]})}let C=e=>`${e};`;function N(e){let{children:n,transformCode:t,...s}=e,{siteConfig:{themeConfig:r}}=(0,h.Z)(),{liveCodeBlock:{playgroundPosition:d}}=r,l=g(),o=s.metastring?.includes("noInline")??!1;return(0,i.jsx)("div",{className:"playgroundContainer_6Ior",children:(0,i.jsx)(c.nu,{code:n?.replace(/\n$/,""),noInline:o,transformCode:t??C,theme:l,...s,children:"top"===d?(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(y,{}),(0,i.jsx)(k,{})]}):(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(k,{}),(0,i.jsx)(y,{})]})})})}function T(e){return(0,i.jsx)("button",{type:"button",...e,style:{backgroundColor:"white",color:"black",border:"solid red",borderRadius:20,padding:10,cursor:"pointer",...e.style}})}let P={React:d,...d,...r};var I=t(55951),_=t(6324),L=t.n(_),B=t(50923);let D=/title=(? ["'])(?.*?)\1/,E=/\{(? [\d,-]+)\}/,S={js:{start:"\\/\\/",end:""},jsBlock:{start:"\\/\\*",end:"\\*\\/"},jsx:{start:"\\{\\s*\\/\\*",end:"\\*\\/\\s*\\}"},bash:{start:"#",end:""},html:{start:"\x3c!--",end:"--\x3e"}},U={...S,lua:{start:"--",end:""},wasm:{start:"\\;\\;",end:""},tex:{start:"%",end:""},vb:{start:"['\u2018\u2019]",end:""},vbnet:{start:"(?:_\\s*)?['\u2018\u2019]",end:""},rem:{start:"[Rr][Ee][Mm]\\b",end:""},f90:{start:"!",end:""},ml:{start:"\\(\\*",end:"\\*\\)"},cobol:{start:"\\*>",end:""}},R=Object.keys(S);function Z(e,n){let t=e.map(e=>{let{start:t,end:s}=U[e];return`(?:${t}\\s*(${n.flatMap(e=>[e.line,e.block?.start,e.block?.end].filter(Boolean)).join("|")})\\s*${s})`}).join("|");return RegExp(`^\\s*(?:${t})\\s*$`)}let M=(0,d.createContext)(null);function A(e){let{metadata:n,wordWrap:t,children:s}=e,r=(0,d.useMemo)(()=>({metadata:n,wordWrap:t}),[n,t]);return(0,i.jsx)(M.Provider,{value:r,children:s})}function V(){let e=(0,d.useContext)(M);if(null===e)throw new B.i6("CodeBlockContextProvider");return e}function $(e){let{as:n,...t}=e,s=function(e){let n={color:"--prism-color",backgroundColor:"--prism-background-color"},t={};return Object.entries(e.plain).forEach(e=>{let[s,r]=e,i=n[s];i&&"string"==typeof r&&(t[i]=r)}),t}(g());return(0,i.jsx)(n,{...t,style:s,className:(0,l.Z)(t.className,"codeBlockContainer_jDV4",I.k.common.codeBlock)})}let F={codeBlock:"codeBlock_Gebt",codeBlockStandalone:"codeBlockStandalone_i_cY",codeBlockLines:"codeBlockLines_FJaf",codeBlockLinesWithNumbering:"codeBlockLinesWithNumbering_FU9Q"};function W(e){let{children:n,className:t}=e;return(0,i.jsx)($,{as:"pre",tabIndex:0,className:(0,l.Z)(F.codeBlockStandalone,"thin-scrollbar",t),children:(0,i.jsx)("code",{className:F.codeBlockLines,children:n})})}let O={attributes:!0,characterData:!0,childList:!0,subtree:!0};function G(e){let{children:n}=e;return n}var z=t(7316);function q(e){let{line:n,token:t,...s}=e;return(0,i.jsx)("span",{...s})}let H={codeLine:"codeLine_qRmp",codeLineNumber:"codeLineNumber_dS_J",codeLineContent:"codeLineContent_XF5l"};function X(e){let{line:n,classNames:t,showLineNumbers:s,getLineProps:r,getTokenProps:d}=e,o=function(e){let n=1===e.length&&"\n"===e[0].content?e[0]:void 0;return n?[{...n,content:""}]:e}(n),c=r({line:o,className:(0,l.Z)(t,s&&H.codeLine)}),a=o.map((e,n)=>{let t=d({token:e});return(0,i.jsx)(q,{...t,line:o,token:e,children:t.children},n)});return(0,i.jsxs)("span",{...c,children:[s?(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)("span",{className:H.codeLineNumber}),(0,i.jsx)("span",{className:H.codeLineContent,children:a})]}):a,(0,i.jsx)("br",{})]})}let Y=d.forwardRef((e,n)=>(0,i.jsx)("pre",{ref:n,tabIndex:0,...e,className:(0,l.Z)(e.className,F.codeBlock,"thin-scrollbar")}));function K(e){let{metadata:n}=V();return(0,i.jsx)("code",{...e,className:(0,l.Z)(e.className,F.codeBlockLines,void 0!==n.lineNumbersStart&&F.codeBlockLinesWithNumbering),style:{...e.style,counterReset:void 0===n.lineNumbersStart?void 0:`line-count ${n.lineNumbersStart-1}`}})}function J(e){let{className:n}=e,{metadata:t,wordWrap:s}=V(),r=g(),{code:d,language:o,lineNumbersStart:c,lineClassNames:a}=t;return(0,i.jsx)(z.y$,{theme:r,code:d,language:o,children:e=>{let{className:t,style:r,tokens:d,getLineProps:o,getTokenProps:h}=e;return(0,i.jsx)(Y,{ref:s.codeBlockRef,className:(0,l.Z)(n,t),style:r,children:(0,i.jsx)(K,{children:d.map((e,n)=>(0,i.jsx)(X,{line:e,getLineProps:o,getTokenProps:h,classNames:a[n],showLineNumbers:void 0!==c},n))})})}})}var Q=t(44771);function ee(e){let{className:n,...t}=e;return(0,i.jsx)("button",{type:"button",...t,className:(0,l.Z)("clean-btn",n)})}function en(e){return(0,i.jsx)("svg",{viewBox:"0 0 24 24",...e,children:(0,i.jsx)("path",{fill:"currentColor",d:"M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"})})}function et(e){return(0,i.jsx)("svg",{viewBox:"0 0 24 24",...e,children:(0,i.jsx)("path",{fill:"currentColor",d:"M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"})})}let es={copyButtonCopied:"copyButtonCopied_wDuR",copyButtonIcons:"copyButtonIcons_gMWc",copyButtonIcon:"copyButtonIcon_GXfb",copyButtonSuccessIcon:"copyButtonSuccessIcon_ktUX"};function er(e){let{className:n}=e,{copyCode:t,isCopied:s}=function(){let{metadata:{code:e}}=V(),[n,t]=(0,d.useState)(!1),s=(0,d.useRef)(void 0),r=(0,d.useCallback)(()=>{(0,Q.Z)(e),t(!0),s.current=window.setTimeout(()=>{t(!1)},1e3)},[e]);return(0,d.useEffect)(()=>()=>window.clearTimeout(s.current),[]),{copyCode:r,isCopied:n}}();return(0,i.jsx)(ee,{"aria-label":s?(0,a.I)({id:"theme.CodeBlock.copied",message:"Copied",description:"The copied button label on code blocks"}):(0,a.I)({id:"theme.CodeBlock.copyButtonAriaLabel",message:"Copy code to clipboard",description:"The ARIA label for copy code blocks button"}),title:(0,a.I)({id:"theme.CodeBlock.copy",message:"Copy",description:"The copy button label on code blocks"}),className:(0,l.Z)(n,es.copyButton,s&&es.copyButtonCopied),onClick:t,children:(0,i.jsxs)("span",{className:es.copyButtonIcons,"aria-hidden":"true",children:[(0,i.jsx)(en,{className:es.copyButtonIcon}),(0,i.jsx)(et,{className:es.copyButtonSuccessIcon})]})})}function ei(e){return(0,i.jsx)("svg",{viewBox:"0 0 24 24",...e,children:(0,i.jsx)("path",{fill:"currentColor",d:"M4 19h6v-2H4v2zM20 5H4v2h16V5zm-3 6H4v2h13.25c1.1 0 2 .9 2 2s-.9 2-2 2H15v-2l-3 3l3 3v-2h2c2.21 0 4-1.79 4-4s-1.79-4-4-4z"})})}let ed={wordWrapButtonIcon:"wordWrapButtonIcon___5r",wordWrapButtonEnabled:"wordWrapButtonEnabled_nam_"};function el(e){let{className:n}=e,{wordWrap:t}=V();if(!(t.isEnabled||t.isCodeScrollable))return!1;let s=(0,a.I)({id:"theme.CodeBlock.wordWrapToggle",message:"Toggle word wrap",description:"The title attribute for toggle word wrapping button of code block lines"});return(0,i.jsx)(ee,{onClick:()=>t.toggle(),className:(0,l.Z)(n,t.isEnabled&&ed.wordWrapButtonEnabled),"aria-label":s,title:s,children:(0,i.jsx)(ei,{className:ed.wordWrapButtonIcon,"aria-hidden":"true"})})}function eo(e){let{className:n}=e;return(0,i.jsx)(u.Z,{children:()=>(0,i.jsxs)("div",{className:(0,l.Z)(n,"buttonGroup_KXnS"),children:[(0,i.jsx)(el,{}),(0,i.jsx)(er,{})]})})}let ec={codeBlockContent:"codeBlockContent_cKMj",codeBlockTitle:"codeBlockTitle_U6Q0"};function ea(e){let{className:n}=e,{metadata:t}=V();return(0,i.jsxs)($,{as:"div",className:(0,l.Z)(n,t.className),children:[t.title&&(0,i.jsx)("div",{className:ec.codeBlockTitle,children:(0,i.jsx)(G,{children:t.title})}),(0,i.jsxs)("div",{className:ec.codeBlockContent,children:[(0,i.jsx)(J,{}),(0,i.jsx)(eo,{})]})]})}function eh(e){let n=function(e){let{prism:n}=(0,p.L)();return function(e){var n,t,s;let r=(t=(n={language:e.language,defaultLanguage:e.defaultLanguage,className:e.className}).language??function(e){if(!e)return;let n=e.split(" ").find(e=>e.startsWith("language-"));return n?.replace(/language-/,"")}(n.className)??n.defaultLanguage,t?.toLowerCase()??"text"),{lineClassNames:i,code:d}=function(e,n){let t=e.replace(/\r?\n$/,"");return function(e,n){let{metastring:t,magicComments:s}=n;if(t&&E.test(t)){let n=t.match(E).groups.range;if(0===s.length)throw Error(`A highlight range has been given in code block's metastring (\`\`\` ${t}), but no magic comment config is available. Docusaurus applies the first magic comment entry's className for metastring ranges.`);let r=s[0].className;return{lineClassNames:Object.fromEntries(L()(n).filter(e=>e>0).map(e=>[e-1,[r]])),code:e}}return null}(t,{...n})??function(e,n){let{language:t,magicComments:s}=n;if(void 0===t)return{lineClassNames:{},code:e};let r=function(e,n){switch(e){case"js":case"javascript":case"ts":case"typescript":return Z(["js","jsBlock"],n);case"jsx":case"tsx":return Z(["js","jsBlock","jsx"],n);case"html":return Z(["js","jsBlock","html"],n);case"python":case"py":case"bash":return Z(["bash"],n);case"markdown":case"md":return Z(["html","jsx","bash"],n);case"tex":case"latex":case"matlab":return Z(["tex"],n);case"lua":case"haskell":return Z(["lua"],n);case"sql":return Z(["lua","jsBlock"],n);case"wasm":return Z(["wasm"],n);case"vb":case"vba":case"visual-basic":return Z(["vb","rem"],n);case"vbnet":return Z(["vbnet","rem"],n);case"batch":return Z(["rem"],n);case"basic":return Z(["rem","f90"],n);case"fsharp":return Z(["js","ml"],n);case"ocaml":case"sml":return Z(["ml"],n);case"fortran":return Z(["f90"],n);case"cobol":return Z(["cobol"],n);default:return Z(R,n)}}(t,s),i=e.split(/\r?\n/),d=Object.fromEntries(s.map(e=>[e.className,{start:0,range:""}])),l=Object.fromEntries(s.filter(e=>e.line).map(e=>{let{className:n,line:t}=e;return[t,n]})),o=Object.fromEntries(s.filter(e=>e.block).map(e=>{let{className:n,block:t}=e;return[t.start,n]})),c=Object.fromEntries(s.filter(e=>e.block).map(e=>{let{className:n,block:t}=e;return[t.end,n]}));for(let e=0;e void 0!==e);l[t]?d[l[t]].range+=`${e},`:o[t]?d[o[t]].start=e:c[t]&&(d[c[t]].range+=`${d[c[t]].start}-${e-1},`),i.splice(e,1)}let a={};return Object.entries(d).forEach(e=>{let[n,{range:t}]=e;L()(t).forEach(e=>{a[e]??=[],a[e].push(n)})}),{code:i.join("\n"),lineClassNames:a}}(t,{...n})}(e.code,{metastring:e.metastring,magicComments:e.magicComments,language:r}),o=function(e){let{className:n,language:t}=e;return(0,l.Z)(n,t&&!n?.includes(`language-${t}`)&&`language-${t}`)}({className:e.className,language:r}),c=(s=e.metastring,(s?.match(D)?.groups.title??"")||e.title),a=function(e){let{showLineNumbers:n,metastring:t}=e;if("boolean"==typeof n)return n?1:void 0;if("number"==typeof n)return n;let s=t?.split(" ").find(e=>e.startsWith("showLineNumbers"));if(s)return s.startsWith("showLineNumbers=")?parseInt(s.replace("showLineNumbers=",""),10):1}({showLineNumbers:e.showLineNumbers,metastring:e.metastring});return{codeInput:e.code,code:d,className:o,language:r,title:c,lineNumbersStart:a,lineClassNames:i}}({code:e.children,className:e.className,metastring:e.metastring,magicComments:n.magicComments,defaultLanguage:n.defaultLanguage,language:e.language,title:e.title,showLineNumbers:e.showLineNumbers})}(e),t=function(){let[e,n]=(0,d.useState)(!1),[t,s]=(0,d.useState)(!1),r=(0,d.useRef)(null),i=(0,d.useCallback)(()=>{let t=r.current.querySelector("code");e?t.removeAttribute("style"):(t.style.whiteSpace="pre-wrap",t.style.overflowWrap="anywhere"),n(e=>!e)},[r,e]),l=(0,d.useCallback)(()=>{let{scrollWidth:e,clientWidth:n}=r.current;s(e>n||r.current.querySelector("code").hasAttribute("style"))},[r]),[o,c]=(0,d.useState)(),a=(0,d.useCallback)(()=>{c(r.current?.closest("[role=tabpanel][hidden]"))},[r,c]);return(0,d.useEffect)(()=>{a()},[a]),!function(e,n){let t=arguments.length>2&&void 0!==arguments[2]?arguments[2]:O,s=(0,B.zX)(n),r=(0,B.Ql)(t);(0,d.useEffect)(()=>{let n=new MutationObserver(s);return e&&n.observe(e,r),()=>n.disconnect()},[e,s,r])}(o,e=>{e.forEach(e=>{"attributes"===e.type&&"hidden"===e.attributeName&&(l(),a())})},{attributes:!0,characterData:!1,childList:!1,subtree:!1}),(0,d.useEffect)(()=>{l()},[e,l]),(0,d.useEffect)(()=>(window.addEventListener("resize",l,{passive:!0}),()=>{window.removeEventListener("resize",l)}),[l]),{codeBlockRef:r,isEnabled:e,isCodeScrollable:t,toggle:i}}();return(0,i.jsx)(A,{metadata:n,wordWrap:t,children:(0,i.jsx)(ea,{})})}let eu=(s=function(e){let{children:n,...t}=e,s=(0,o.Z)(),r=d.Children.toArray(n).some(e=>(0,d.isValidElement)(e))?n:Array.isArray(n)?n.join(""):n;return(0,i.jsx)("string"==typeof r?eh:W,{...t,children:r},String(s))},function(e){return e.live?(0,i.jsx)(N,{scope:P,...e}):(0,i.jsx)(s,{...e})});function ex(e){return(0,i.jsx)(eu,{...e})}}}]); \ No newline at end of file diff --git a/assets/js/0b6cd89a.dc50d096.js b/assets/js/0b6cd89a.dc50d096.js new file mode 100644 index 0000000000..fb2f35de6b --- /dev/null +++ b/assets/js/0b6cd89a.dc50d096.js @@ -0,0 +1,22 @@ +"use strict";(self.webpackChunkwebsite=self.webpackChunkwebsite||[]).push([["25467"],{84645:function(e,n,t){t.d(n,{ZP:()=>l,d$:()=>i});var s=t(85893),r=t(80980);let i=[{value:"Tags File",id:"tags-file",level:2},{value:"Types",id:"tags-file-types",level:3},{value:"Example",id:"tags-file-example",level:3}];function d(e){let n={a:"a",admonition:"admonition",code:"code",h2:"h2",h3:"h3",p:"p",pre:"pre",...(0,r.a)(),...e.components};return(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(n.h2,{id:"tags-file",children:"Tags File"}),"\n",(0,s.jsxs)(n.p,{children:["Use the ",(0,s.jsxs)(n.a,{href:"#tags",children:[(0,s.jsx)(n.code,{children:"tags"})," plugin option"]})," to configure the path of a YAML tags file."]}),"\n",(0,s.jsxs)(n.p,{children:["By convention, the plugin will look for a ",(0,s.jsx)(n.code,{children:"tags.yml"})," file at the root of your content folder(s)."]}),"\n",(0,s.jsxs)(n.p,{children:["This file can contain a list of predefined tags. You can reference these tags by their keys in Markdown files thanks to the ",(0,s.jsxs)(n.a,{href:"#markdown-front-matter",children:[(0,s.jsx)(n.code,{children:"tags"})," front matter"]}),"."]}),"\n",(0,s.jsx)(n.admonition,{title:"Keeping tags consistent",type:"tip",children:(0,s.jsxs)(n.p,{children:["Using a tags file, you can ensure that your tags usage is consistent across your plugin content set. Use the ",(0,s.jsx)(n.a,{href:"#onInlineTags",children:(0,s.jsx)(n.code,{children:"onInlineTags: 'throw'"})})," plugin option to enforce this consistency and prevent usage of inline tags declared on the fly."]})}),"\n",(0,s.jsx)(n.h3,{id:"tags-file-types",children:"Types"}),"\n",(0,s.jsx)(n.p,{children:"The YAML content of the provided tags file should respect the following shape:"}),"\n",(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-tsx",children:"type Tag = {\n label?: string; // Tag display label\n permalink?: string; // Tag URL pathname segment\n description?: string; // Tag description displayed in the tag page\n};\n\ntype TagsFileInput = Record | null>;\n"})}),"\n",(0,s.jsx)(n.h3,{id:"tags-file-example",children:"Example"}),"\n",(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-yml",metastring:'title="tags.yml"',children:"releases:\n label: 'Product releases'\n permalink: '/product-releases'\n description: 'Content related to product releases.'\n\n# A partial tag definition is also valid\nannouncements:\n label: 'Announcements'\n\n# An empty tag definition is also valid\n# Other attributes will be inferred from the key\nemptyTag:\n"})}),"\n",(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-md",metastring:'title="content.md"',children:"---\ntags: [releases, announcements, emptyTag]\n---\n\n# Title\n\nContent\n"})})]})}function l(e={}){let{wrapper:n}={...(0,r.a)(),...e.components};return n?(0,s.jsx)(n,{...e,children:(0,s.jsx)(d,{...e})}):d(e)}},17918:function(e,n,t){t.r(n),t.d(n,{frontMatter:()=>h,default:()=>g,contentTitle:()=>u,assets:()=>x,toc:()=>j,metadata:()=>s});var s=JSON.parse('{"id":"api/plugins/plugin-content-docs","title":"\uD83D\uDCE6 plugin-content-docs","description":"Provides the Docs functionality and is the default docs plugin for Docusaurus.","source":"@site/docs/api/plugins/plugin-content-docs.mdx","sourceDirName":"api/plugins","slug":"/api/plugins/@docusaurus/plugin-content-docs","permalink":"/docs/api/plugins/@docusaurus/plugin-content-docs","draft":false,"unlisted":false,"editUrl":"https://github.com/facebook/docusaurus/edit/main/website/docs/api/plugins/plugin-content-docs.mdx","tags":[],"version":"current","lastUpdatedBy":"S\xe9bastien Lorber","lastUpdatedAt":1744293302000,"sidebarPosition":1,"frontMatter":{"sidebar_position":1,"slug":"/api/plugins/@docusaurus/plugin-content-docs"},"sidebar":"api","previous":{"title":"Plugins overview","permalink":"/docs/api/plugins"},"next":{"title":"\uD83D\uDCE6 plugin-content-blog","permalink":"/docs/api/plugins/@docusaurus/plugin-content-blog"}}'),r=t(85893),i=t(80980),d=t(15398),l=t(58636),o=t(32240),c=t(66359),a=t(84645);let h={sidebar_position:1,slug:"/api/plugins/@docusaurus/plugin-content-docs"},u="\uD83D\uDCE6 plugin-content-docs",x={},j=[{value:"Installation",id:"installation",level:2},{value:"Configuration",id:"configuration",level:2},{value:"Types",id:"types",level:3},{value:" EditUrlFunction
",id:"EditUrlFunction",level:4},{value:"PrefixParser
",id:"PrefixParser",level:4},{value:"SidebarGenerator
",id:"SidebarGenerator",level:4},{value:"VersionsConfig
",id:"VersionsConfig",level:4},{value:"Example configuration",id:"ex-config",level:3},{value:"Markdown front matter",id:"markdown-front-matter",level:2},...a.d$,{value:"i18n",id:"i18n",level:2},{value:"Translation files location",id:"translation-files-location",level:3},{value:"Example file-system structure",id:"example-file-system-structure",level:3}];function p(e){let n={a:"a",admonition:"admonition",code:"code",em:"em",h1:"h1",h2:"h2",h3:"h3",h4:"h4",header:"header",li:"li",p:"p",pre:"pre",strong:"strong",table:"table",tbody:"tbody",td:"td",th:"th",thead:"thead",tr:"tr",ul:"ul",...(0,i.a)(),...e.components};return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(n.header,{children:(0,r.jsx)(n.h1,{id:"-plugin-content-docs",children:"\uD83D\uDCE6 plugin-content-docs"})}),"\n","\n",(0,r.jsxs)(n.p,{children:["Provides the ",(0,r.jsx)(n.a,{href:"/docs/docs-introduction",children:"Docs"})," functionality and is the default docs plugin for Docusaurus."]}),"\n",(0,r.jsx)(n.h2,{id:"installation",children:"Installation"}),"\n",(0,r.jsxs)(d.Z,{groupId:"npm2yarn",children:[(0,r.jsx)(l.Z,{value:"npm",children:(0,r.jsx)(n.pre,{children:(0,r.jsx)(n.code,{className:"language-bash",children:"npm install --save @docusaurus/plugin-content-docs\n"})})}),(0,r.jsx)(l.Z,{value:"yarn",label:"Yarn",children:(0,r.jsx)(n.pre,{children:(0,r.jsx)(n.code,{className:"language-bash",children:"yarn add @docusaurus/plugin-content-docs\n"})})}),(0,r.jsx)(l.Z,{value:"pnpm",label:"pnpm",children:(0,r.jsx)(n.pre,{children:(0,r.jsx)(n.code,{className:"language-bash",children:"pnpm add @docusaurus/plugin-content-docs\n"})})}),(0,r.jsx)(l.Z,{value:"bun",label:"Bun",children:(0,r.jsx)(n.pre,{children:(0,r.jsx)(n.code,{className:"language-bash",children:"bun add @docusaurus/plugin-content-docs\n"})})})]}),"\n",(0,r.jsxs)(n.admonition,{type:"tip",children:[(0,r.jsxs)(n.p,{children:["If you use the preset ",(0,r.jsx)(n.code,{children:"@docusaurus/preset-classic"}),", you don't need to install this plugin as a dependency."]}),(0,r.jsxs)(n.p,{children:["You can configure this plugin through the ",(0,r.jsx)(n.a,{href:"/docs/using-plugins#docusauruspreset-classic",children:"preset options"}),"."]})]}),"\n",(0,r.jsx)(n.h2,{id:"configuration",children:"Configuration"}),"\n",(0,r.jsx)(n.p,{children:"Accepted fields:"}),"\n",(0,r.jsx)(o.Z,{children:(0,r.jsxs)(n.table,{children:[(0,r.jsx)(n.thead,{children:(0,r.jsxs)(n.tr,{children:[(0,r.jsx)(n.th,{children:"Name"}),(0,r.jsx)(n.th,{children:"Type"}),(0,r.jsx)(n.th,{children:"Default"}),(0,r.jsx)(n.th,{children:"Description"})]})}),(0,r.jsxs)(n.tbody,{children:[(0,r.jsxs)(n.tr,{children:[(0,r.jsx)(n.td,{children:(0,r.jsx)(n.code,{children:"path"})}),(0,r.jsx)(n.td,{children:(0,r.jsx)(n.code,{children:"string"})}),(0,r.jsx)(n.td,{children:(0,r.jsx)(n.code,{children:"'docs'"})}),(0,r.jsx)(n.td,{children:"Path to the docs content directory on the file system, relative to site directory."})]}),(0,r.jsxs)(n.tr,{children:[(0,r.jsx)(n.td,{children:(0,r.jsx)(n.code,{children:"editUrl"})}),(0,r.jsx)(n.td,{children:(0,r.jsxs)("code",{children:["string | ",(0,r.jsx)(n.a,{href:"#EditUrlFunction",children:"EditUrlFunction"})]})}),(0,r.jsx)(n.td,{children:(0,r.jsx)(n.code,{children:"undefined"})}),(0,r.jsxs)(n.td,{children:["Base URL to edit your site. The final URL is computed by ",(0,r.jsx)(n.code,{children:"editUrl + relativeDocPath"}),". Using a function allows more nuanced control for each file. Omitting this variable entirely will disable edit links."]})]}),(0,r.jsxs)(n.tr,{children:[(0,r.jsx)(n.td,{children:(0,r.jsx)(n.code,{children:"editLocalizedFiles"})}),(0,r.jsx)(n.td,{children:(0,r.jsx)(n.code,{children:"boolean"})}),(0,r.jsx)(n.td,{children:(0,r.jsx)(n.code,{children:"false"})}),(0,r.jsxs)(n.td,{children:["The edit URL will target the localized file, instead of the original unlocalized file. Ignored when ",(0,r.jsx)(n.code,{children:"editUrl"})," is a function."]})]}),(0,r.jsxs)(n.tr,{children:[(0,r.jsx)(n.td,{children:(0,r.jsx)(n.code,{children:"editCurrentVersion"})}),(0,r.jsx)(n.td,{children:(0,r.jsx)(n.code,{children:"boolean"})}),(0,r.jsx)(n.td,{children:(0,r.jsx)(n.code,{children:"false"})}),(0,r.jsxs)(n.td,{children:["The edit URL will always target the current version doc instead of older versions. Ignored when ",(0,r.jsx)(n.code,{children:"editUrl"})," is a function."]})]}),(0,r.jsxs)(n.tr,{children:[(0,r.jsx)(n.td,{children:(0,r.jsx)(n.code,{children:"routeBasePath"})}),(0,r.jsx)(n.td,{children:(0,r.jsx)(n.code,{children:"string"})}),(0,r.jsx)(n.td,{children:(0,r.jsx)(n.code,{children:"'docs'"})}),(0,r.jsxs)(n.td,{children:["URL route for the docs section of your site. ",(0,r.jsx)(n.strong,{children:"DO NOT"})," include a trailing slash. Use ",(0,r.jsx)(n.code,{children:"/"})," for shipping docs without base path."]})]}),(0,r.jsxs)(n.tr,{children:[(0,r.jsx)(n.td,{children:(0,r.jsx)(n.code,{children:"tagsBasePath"})}),(0,r.jsx)(n.td,{children:(0,r.jsx)(n.code,{children:"string"})}),(0,r.jsx)(n.td,{children:(0,r.jsx)(n.code,{children:"'tags'"})}),(0,r.jsxs)(n.td,{children:["URL route for the tags list page of your site. It is prepended to the ",(0,r.jsx)(n.code,{children:"routeBasePath"}),"."]})]}),(0,r.jsxs)(n.tr,{children:[(0,r.jsx)(n.td,{children:(0,r.jsx)(n.code,{children:"include"})}),(0,r.jsx)(n.td,{children:(0,r.jsx)(n.code,{children:"string[]"})}),(0,r.jsx)(n.td,{children:(0,r.jsx)(n.code,{children:"['**/*.{md,mdx}']"})}),(0,r.jsx)(n.td,{children:"Array of glob patterns matching Markdown files to be built, relative to the content path."})]}),(0,r.jsxs)(n.tr,{children:[(0,r.jsx)(n.td,{children:(0,r.jsx)(n.code,{children:"exclude"})}),(0,r.jsx)(n.td,{children:(0,r.jsx)(n.code,{children:"string[]"})}),(0,r.jsx)(n.td,{children:(0,r.jsx)(n.em,{children:"See example configuration"})}),(0,r.jsxs)(n.td,{children:["Array of glob patterns matching Markdown files to be excluded. Serves as refinement based on the ",(0,r.jsx)(n.code,{children:"include"})," option."]})]}),(0,r.jsxs)(n.tr,{children:[(0,r.jsx)(n.td,{children:(0,r.jsx)(n.code,{children:"sidebarPath"})}),(0,r.jsx)(n.td,{children:(0,r.jsx)("code",{children:"false | string"})}),(0,r.jsx)(n.td,{children:(0,r.jsx)(n.code,{children:"undefined"})}),(0,r.jsxs)(n.td,{children:["Path to a sidebars configuration file, loaded in a Node.js context. Use ",(0,r.jsx)(n.code,{children:"false"})," to disable sidebars, or ",(0,r.jsx)(n.code,{children:"undefined"})," to create a fully autogenerated sidebar."]})]}),(0,r.jsxs)(n.tr,{children:[(0,r.jsx)(n.td,{children:(0,r.jsx)(n.code,{children:"sidebarCollapsible"})}),(0,r.jsx)(n.td,{children:(0,r.jsx)(n.code,{children:"boolean"})}),(0,r.jsx)(n.td,{children:(0,r.jsx)(n.code,{children:"true"})}),(0,r.jsxs)(n.td,{children:["Whether sidebar categories are collapsible by default. See also ",(0,r.jsx)(n.a,{href:"/docs/sidebar/items#collapsible-categories",children:"Collapsible categories"})]})]}),(0,r.jsxs)(n.tr,{children:[(0,r.jsx)(n.td,{children:(0,r.jsx)(n.code,{children:"sidebarCollapsed"})}),(0,r.jsx)(n.td,{children:(0,r.jsx)(n.code,{children:"boolean"})}),(0,r.jsx)(n.td,{children:(0,r.jsx)(n.code,{children:"true"})}),(0,r.jsxs)(n.td,{children:["Whether sidebar categories are collapsed by default. See also ",(0,r.jsx)(n.a,{href:"/docs/sidebar/items#expanded-categories-by-default",children:"Expanded categories by default"})]})]}),(0,r.jsxs)(n.tr,{children:[(0,r.jsx)(n.td,{children:(0,r.jsx)(n.code,{children:"sidebarItemsGenerator"})}),(0,r.jsx)(n.td,{children:(0,r.jsx)("code",{children:(0,r.jsx)(n.a,{href:"#SidebarGenerator",children:"SidebarGenerator"})})}),(0,r.jsx)(n.td,{children:(0,r.jsx)(n.em,{children:"Omitted"})}),(0,r.jsxs)(n.td,{children:["Function used to replace the sidebar items of type ",(0,r.jsx)(n.code,{children:"'autogenerated'"})," with real sidebar items (docs, categories, links...). See also ",(0,r.jsx)(n.a,{href:"/docs/sidebar/autogenerated#customize-the-sidebar-items-generator",children:"Customize the sidebar items generator"})]})]}),(0,r.jsxs)(n.tr,{children:[(0,r.jsx)(n.td,{children:(0,r.jsx)(n.code,{children:"numberPrefixParser"})}),(0,r.jsx)(n.td,{children:(0,r.jsxs)("code",{children:["boolean | ",(0,r.jsx)(n.a,{href:"#PrefixParser",children:"PrefixParser"})]})}),(0,r.jsx)(n.td,{children:(0,r.jsx)(n.em,{children:"Omitted"})}),(0,r.jsxs)(n.td,{children:["Custom parsing logic to extract number prefixes from file names. Use ",(0,r.jsx)(n.code,{children:"false"})," to disable this behavior and leave the docs untouched, and ",(0,r.jsx)(n.code,{children:"true"})," to use the default parser. See also ",(0,r.jsx)(n.a,{href:"/docs/sidebar/autogenerated#using-number-prefixes",children:"Using number prefixes"})]})]}),(0,r.jsxs)(n.tr,{children:[(0,r.jsx)(n.td,{children:(0,r.jsx)(n.code,{children:"docsRootComponent"})}),(0,r.jsx)(n.td,{children:(0,r.jsx)(n.code,{children:"string"})}),(0,r.jsx)(n.td,{children:(0,r.jsx)(n.code,{children:"'@theme/DocsRoot'"})}),(0,r.jsx)(n.td,{children:"Parent component of all the docs plugin pages (including all versions). Stays mounted when navigation between docs pages and versions."})]}),(0,r.jsxs)(n.tr,{children:[(0,r.jsx)(n.td,{children:(0,r.jsx)(n.code,{children:"docVersionRootComponent"})}),(0,r.jsx)(n.td,{children:(0,r.jsx)(n.code,{children:"string"})}),(0,r.jsx)(n.td,{children:(0,r.jsx)(n.code,{children:"'@theme/DocVersionLayout'"})}),(0,r.jsx)(n.td,{children:"Parent component of all docs pages of an individual version (doc pages with sidebars, tags pages). Stays mounted when navigation between pages of that specific version."})]}),(0,r.jsxs)(n.tr,{children:[(0,r.jsx)(n.td,{children:(0,r.jsx)(n.code,{children:"docRootComponent"})}),(0,r.jsx)(n.td,{children:(0,r.jsx)(n.code,{children:"string"})}),(0,r.jsx)(n.td,{children:(0,r.jsx)(n.code,{children:"'@theme/DocRoot'"})}),(0,r.jsx)(n.td,{children:"Parent component of all doc pages with sidebars (regular docs pages, category generated index pages). Stays mounted when navigation between such pages."})]}),(0,r.jsxs)(n.tr,{children:[(0,r.jsx)(n.td,{children:(0,r.jsx)(n.code,{children:"docItemComponent"})}),(0,r.jsx)(n.td,{children:(0,r.jsx)(n.code,{children:"string"})}),(0,r.jsx)(n.td,{children:(0,r.jsx)(n.code,{children:"'@theme/DocItem'"})}),(0,r.jsx)(n.td,{children:"Main doc container, with TOC, pagination, etc."})]}),(0,r.jsxs)(n.tr,{children:[(0,r.jsx)(n.td,{children:(0,r.jsx)(n.code,{children:"docTagsListComponent"})}),(0,r.jsx)(n.td,{children:(0,r.jsx)(n.code,{children:"string"})}),(0,r.jsx)(n.td,{children:(0,r.jsx)(n.code,{children:"'@theme/DocTagsListPage'"})}),(0,r.jsx)(n.td,{children:"Root component of the tags list page"})]}),(0,r.jsxs)(n.tr,{children:[(0,r.jsx)(n.td,{children:(0,r.jsx)(n.code,{children:"docTagDocListComponent"})}),(0,r.jsx)(n.td,{children:(0,r.jsx)(n.code,{children:"string"})}),(0,r.jsx)(n.td,{children:(0,r.jsx)(n.code,{children:"'@theme/DocTagDocListPage'"})}),(0,r.jsx)(n.td,{children:'Root component of the "docs containing tag X" page.'})]}),(0,r.jsxs)(n.tr,{children:[(0,r.jsx)(n.td,{children:(0,r.jsx)(n.code,{children:"docCategoryGeneratedIndexComponent"})}),(0,r.jsx)(n.td,{children:(0,r.jsx)(n.code,{children:"string"})}),(0,r.jsx)(n.td,{children:(0,r.jsx)(n.code,{children:"'@theme/DocCategoryGeneratedIndexPage'"})}),(0,r.jsx)(n.td,{children:"Root component of the generated category index page."})]}),(0,r.jsxs)(n.tr,{children:[(0,r.jsx)(n.td,{children:(0,r.jsx)(n.code,{children:"remarkPlugins"})}),(0,r.jsx)(n.td,{children:(0,r.jsx)(n.code,{children:"any[]"})}),(0,r.jsx)(n.td,{children:(0,r.jsx)(n.code,{children:"[]"})}),(0,r.jsx)(n.td,{children:"Remark plugins passed to MDX."})]}),(0,r.jsxs)(n.tr,{children:[(0,r.jsx)(n.td,{children:(0,r.jsx)(n.code,{children:"rehypePlugins"})}),(0,r.jsx)(n.td,{children:(0,r.jsx)(n.code,{children:"any[]"})}),(0,r.jsx)(n.td,{children:(0,r.jsx)(n.code,{children:"[]"})}),(0,r.jsx)(n.td,{children:"Rehype plugins passed to MDX."})]}),(0,r.jsxs)(n.tr,{children:[(0,r.jsx)(n.td,{children:(0,r.jsx)(n.code,{children:"rehypePlugins"})}),(0,r.jsx)(n.td,{children:(0,r.jsx)(n.code,{children:"any[]"})}),(0,r.jsx)(n.td,{children:(0,r.jsx)(n.code,{children:"[]"})}),(0,r.jsx)(n.td,{children:"Recma plugins passed to MDX."})]}),(0,r.jsxs)(n.tr,{children:[(0,r.jsx)(n.td,{children:(0,r.jsx)(n.code,{children:"beforeDefaultRemarkPlugins"})}),(0,r.jsx)(n.td,{children:(0,r.jsx)(n.code,{children:"any[]"})}),(0,r.jsx)(n.td,{children:(0,r.jsx)(n.code,{children:"[]"})}),(0,r.jsx)(n.td,{children:"Custom Remark plugins passed to MDX before the default Docusaurus Remark plugins."})]}),(0,r.jsxs)(n.tr,{children:[(0,r.jsx)(n.td,{children:(0,r.jsx)(n.code,{children:"beforeDefaultRehypePlugins"})}),(0,r.jsx)(n.td,{children:(0,r.jsx)(n.code,{children:"any[]"})}),(0,r.jsx)(n.td,{children:(0,r.jsx)(n.code,{children:"[]"})}),(0,r.jsx)(n.td,{children:"Custom Rehype plugins passed to MDX before the default Docusaurus Rehype plugins."})]}),(0,r.jsxs)(n.tr,{children:[(0,r.jsx)(n.td,{children:(0,r.jsx)(n.code,{children:"showLastUpdateAuthor"})}),(0,r.jsx)(n.td,{children:(0,r.jsx)(n.code,{children:"boolean"})}),(0,r.jsx)(n.td,{children:(0,r.jsx)(n.code,{children:"false"})}),(0,r.jsx)(n.td,{children:"Whether to display the author who last updated the doc."})]}),(0,r.jsxs)(n.tr,{children:[(0,r.jsx)(n.td,{children:(0,r.jsx)(n.code,{children:"showLastUpdateTime"})}),(0,r.jsx)(n.td,{children:(0,r.jsx)(n.code,{children:"boolean"})}),(0,r.jsx)(n.td,{children:(0,r.jsx)(n.code,{children:"false"})}),(0,r.jsxs)(n.td,{children:["Whether to display the last date the doc was updated. This requires access to git history during the build, so will not work correctly with shallow clones (a common default for CI systems). With GitHub ",(0,r.jsx)(n.code,{children:"actions/checkout"}),", use",(0,r.jsx)(n.code,{children:"fetch-depth: 0"}),"."]})]}),(0,r.jsxs)(n.tr,{children:[(0,r.jsx)(n.td,{children:(0,r.jsx)(n.code,{children:"breadcrumbs"})}),(0,r.jsx)(n.td,{children:(0,r.jsx)(n.code,{children:"boolean"})}),(0,r.jsx)(n.td,{children:(0,r.jsx)(n.code,{children:"true"})}),(0,r.jsx)(n.td,{children:"Enable or disable the breadcrumbs on doc pages."})]}),(0,r.jsxs)(n.tr,{children:[(0,r.jsx)(n.td,{children:(0,r.jsx)(n.code,{children:"disableVersioning"})}),(0,r.jsx)(n.td,{children:(0,r.jsx)(n.code,{children:"boolean"})}),(0,r.jsx)(n.td,{children:(0,r.jsx)(n.code,{children:"false"})}),(0,r.jsxs)(n.td,{children:["Explicitly disable versioning even when multiple versions exist. This will make the site only include the current version. Will error if ",(0,r.jsx)(n.code,{children:"includeCurrentVersion: false"})," and ",(0,r.jsx)(n.code,{children:"disableVersioning: true"}),"."]})]}),(0,r.jsxs)(n.tr,{children:[(0,r.jsx)(n.td,{children:(0,r.jsx)(n.code,{children:"includeCurrentVersion"})}),(0,r.jsx)(n.td,{children:(0,r.jsx)(n.code,{children:"boolean"})}),(0,r.jsx)(n.td,{children:(0,r.jsx)(n.code,{children:"true"})}),(0,r.jsx)(n.td,{children:"Include the current version of your docs."})]}),(0,r.jsxs)(n.tr,{children:[(0,r.jsx)(n.td,{children:(0,r.jsx)(n.code,{children:"lastVersion"})}),(0,r.jsx)(n.td,{children:(0,r.jsx)(n.code,{children:"string"})}),(0,r.jsxs)(n.td,{children:["First version in ",(0,r.jsx)(n.code,{children:"versions.json"})]}),(0,r.jsx)(n.td,{children:"The version navigated to in priority and displayed by default for docs navbar items."})]}),(0,r.jsxs)(n.tr,{children:[(0,r.jsx)(n.td,{children:(0,r.jsx)(n.code,{children:"onlyIncludeVersions"})}),(0,r.jsx)(n.td,{children:(0,r.jsx)(n.code,{children:"string[]"})}),(0,r.jsx)(n.td,{children:"All versions available"}),(0,r.jsx)(n.td,{children:"Only include a subset of all available versions."})]}),(0,r.jsxs)(n.tr,{children:[(0,r.jsx)(n.td,{children:(0,r.jsx)(n.code,{children:"versions"})}),(0,r.jsx)(n.td,{children:(0,r.jsx)("code",{children:(0,r.jsx)(n.a,{href:"#VersionsConfig",children:"VersionsConfig"})})}),(0,r.jsx)(n.td,{children:(0,r.jsx)(n.code,{children:"{}"})}),(0,r.jsx)(n.td,{children:"Independent customization of each version's properties."})]}),(0,r.jsxs)(n.tr,{children:[(0,r.jsx)(n.td,{children:(0,r.jsx)(n.code,{children:"tags"})}),(0,r.jsx)(n.td,{children:(0,r.jsx)(n.code,{children:"string | false | null | undefined"})}),(0,r.jsx)(n.td,{children:(0,r.jsx)(n.code,{children:"tags.yml"})}),(0,r.jsx)(n.td,{children:"Path to a YAML file listing pre-defined tags. Relative to the docs version content directories."})]}),(0,r.jsxs)(n.tr,{children:[(0,r.jsx)(n.td,{children:(0,r.jsx)(n.code,{children:"onInlineTags"})}),(0,r.jsx)(n.td,{children:(0,r.jsx)(n.code,{children:"'ignore' | 'log' | 'warn' | 'throw'"})}),(0,r.jsx)(n.td,{children:(0,r.jsx)(n.code,{children:"warn"})}),(0,r.jsxs)(n.td,{children:["The plugin behavior when docs contain inline tags (not appearing in the list of pre-defined tags, usually ",(0,r.jsx)(n.code,{children:"docs/tags.yml"}),")."]})]})]})]})}),"\n",(0,r.jsx)(n.h3,{id:"types",children:"Types"}),"\n",(0,r.jsx)(n.h4,{id:"EditUrlFunction",children:(0,r.jsx)(n.code,{children:"EditUrlFunction"})}),"\n",(0,r.jsx)(n.pre,{children:(0,r.jsx)(n.code,{className:"language-ts",children:"type EditUrlFunction = (params: {\n version: string;\n versionDocsDirPath: string;\n docPath: string;\n permalink: string;\n locale: string;\n}) => string | undefined;\n"})}),"\n",(0,r.jsx)(n.h4,{id:"PrefixParser",children:(0,r.jsx)(n.code,{children:"PrefixParser"})}),"\n",(0,r.jsx)(n.pre,{children:(0,r.jsx)(n.code,{className:"language-ts",children:"type PrefixParser = (filename: string) => {\n filename: string;\n numberPrefix?: number;\n};\n"})}),"\n",(0,r.jsx)(n.h4,{id:"SidebarGenerator",children:(0,r.jsx)(n.code,{children:"SidebarGenerator"})}),"\n",(0,r.jsx)(n.pre,{children:(0,r.jsx)(n.code,{className:"language-ts",children:"type SidebarGenerator = (generatorArgs: {\n /** The sidebar item with type \"autogenerated\" to be transformed. */\n item: {type: 'autogenerated'; dirName: string};\n /** Useful metadata for the version this sidebar belongs to. */\n version: {contentPath: string; versionName: string};\n /** All the docs of that version (unfiltered). */\n docs: {\n id: string;\n title: string;\n frontMatter: DocFrontMatter & Record;\n source: string;\n sourceDirName: string;\n sidebarPosition?: number | undefined;\n }[];\n /** Number prefix parser configured for this plugin. */\n numberPrefixParser: PrefixParser;\n /** The default category index matcher which you can override. */\n isCategoryIndex: CategoryIndexMatcher;\n /**\n * key is the path relative to the doc content directory, value is the\n * category metadata file's content.\n */\n categoriesMetadata: {[filePath: string]: CategoryMetadata};\n /**\n * Useful to re-use/enhance the default sidebar generation logic from\n * Docusaurus.\n */\n defaultSidebarItemsGenerator: SidebarGenerator;\n // Returns an array of sidebar items \u2014 same as what you can declare in\n // sidebars.js, except for shorthands. See https://docusaurus.io/docs/sidebar/items\n}) => Promise ;\n\ntype CategoryIndexMatcher = (param: {\n /** The file name, without extension */\n fileName: string;\n /**\n * The list of directories, from lowest level to highest.\n * If there's no dir name, directories is ['.']\n */\n directories: string[];\n /** The extension, with a leading dot */\n extension: string;\n}) => boolean;\n"})}),"\n",(0,r.jsx)(n.h4,{id:"VersionsConfig",children:(0,r.jsx)(n.code,{children:"VersionsConfig"})}),"\n",(0,r.jsx)(n.pre,{children:(0,r.jsx)(n.code,{className:"language-ts",children:"type VersionConfig = {\n /**\n * The base path of the version, will be appended to `baseUrl` +\n * `routeBasePath`.\n */\n path?: string;\n /** The label of the version to be used in badges, dropdowns, etc. */\n label?: string;\n /** The banner to show at the top of a doc of that version. */\n banner?: 'none' | 'unreleased' | 'unmaintained';\n /** Show a badge with the version label at the top of each doc. */\n badge?: boolean;\n /** Prevents search engines from indexing this version */\n noIndex?: boolean;\n /** Add a custom class name to the element of each doc */\n className?: string;\n};\n\ntype VersionsConfig = {[versionName: string]: VersionConfig};\n"})}),"\n",(0,r.jsx)(n.h3,{id:"ex-config",children:"Example configuration"}),"\n",(0,r.jsx)(n.p,{children:"You can configure this plugin through preset options or plugin options."}),"\n",(0,r.jsx)(n.admonition,{type:"tip",children:(0,r.jsx)(n.p,{children:"Most Docusaurus users configure this plugin through the preset options."})}),"\n","\n",(0,r.jsx)(c.Z,{pluginName:"@docusaurus/plugin-content-docs",presetOptionName:"docs",code:"{\n path: 'docs',\n breadcrumbs: true,\n // Simple use-case: string editUrl\n // editUrl: 'https://github.com/facebook/docusaurus/edit/main/website/',\n // Advanced use-case: functional editUrl\n editUrl: ({versionDocsDirPath, docPath}) =>\n `https://github.com/facebook/docusaurus/edit/main/website/${versionDocsDirPath}/${docPath}`,\n editLocalizedFiles: false,\n editCurrentVersion: false,\n routeBasePath: 'docs',\n include: ['**/*.md', '**/*.mdx'],\n exclude: [\n '**/_*.{js,jsx,ts,tsx,md,mdx}',\n '**/_*/**',\n '**/*.test.{js,jsx,ts,tsx}',\n '**/__tests__/**',\n ],\n sidebarPath: 'sidebars.js',\n async sidebarItemsGenerator({\n defaultSidebarItemsGenerator,\n numberPrefixParser,\n item,\n version,\n docs,\n isCategoryIndex,\n }) {\n // Use the provided data to generate a custom sidebar slice\n return [\n {type: 'doc', id: 'intro'},\n {\n type: 'category',\n label: 'Tutorials',\n items: [\n {type: 'doc', id: 'tutorial1'},\n {type: 'doc', id: 'tutorial2'},\n ],\n },\n ];\n },\n numberPrefixParser(filename) {\n // Implement your own logic to extract a potential number prefix\n const numberPrefix = findNumberPrefix(filename);\n // Prefix found: return it with the cleaned filename\n if (numberPrefix) {\n return {\n numberPrefix,\n filename: filename.replace(prefix, ''),\n };\n }\n // No number prefix found\n return {numberPrefix: undefined, filename};\n },\n docsRootComponent: '@theme/DocsRoot',\n docVersionRootComponent: '@theme/DocVersionRoot',\n docRootComponent: '@theme/DocRoot',\n docItemComponent: '@theme/DocItem',\n remarkPlugins: [require('./my-remark-plugin')],\n rehypePlugins: [],\n beforeDefaultRemarkPlugins: [],\n beforeDefaultRehypePlugins: [],\n showLastUpdateAuthor: false,\n showLastUpdateTime: false,\n disableVersioning: false,\n includeCurrentVersion: true,\n lastVersion: undefined,\n versions: {\n current: {\n label: 'Android SDK v2.0.0 (WIP)',\n path: 'android-2.0.0',\n banner: 'none',\n },\n '1.0.0': {\n label: 'Android SDK v1.0.0',\n path: 'android-1.0.0',\n banner: 'unmaintained',\n },\n },\n onlyIncludeVersions: ['current', '1.0.0', '2.0.0'],\n}"}),"\n",(0,r.jsx)(n.h2,{id:"markdown-front-matter",children:"Markdown front matter"}),"\n",(0,r.jsxs)(n.p,{children:["Markdown documents can use the following Markdown ",(0,r.jsx)(n.a,{href:"/docs/markdown-features#front-matter",children:"front matter"})," metadata fields, enclosed by a line ",(0,r.jsx)(n.code,{children:"---"})," on either side."]}),"\n",(0,r.jsx)(n.p,{children:"Accepted fields:"}),"\n",(0,r.jsx)(o.Z,{children:(0,r.jsxs)(n.table,{children:[(0,r.jsx)(n.thead,{children:(0,r.jsxs)(n.tr,{children:[(0,r.jsx)(n.th,{children:"Name"}),(0,r.jsx)(n.th,{children:"Type"}),(0,r.jsx)(n.th,{children:"Default"}),(0,r.jsx)(n.th,{children:"Description"})]})}),(0,r.jsxs)(n.tbody,{children:[(0,r.jsxs)(n.tr,{children:[(0,r.jsx)(n.td,{children:(0,r.jsx)(n.code,{children:"id"})}),(0,r.jsx)(n.td,{children:(0,r.jsx)(n.code,{children:"string"})}),(0,r.jsx)(n.td,{children:"file path (including folders, without the extension)"}),(0,r.jsx)(n.td,{children:"A unique document ID."})]}),(0,r.jsxs)(n.tr,{children:[(0,r.jsx)(n.td,{children:(0,r.jsx)(n.code,{children:"title"})}),(0,r.jsx)(n.td,{children:(0,r.jsx)(n.code,{children:"string"})}),(0,r.jsxs)(n.td,{children:["Markdown title or ",(0,r.jsx)(n.code,{children:"id"})]}),(0,r.jsx)(n.td,{children:"The text title of your document. Used for the page metadata and as a fallback value in multiple places (sidebar, next/previous buttons...). Automatically added at the top of your doc if it does not contain any Markdown title."})]}),(0,r.jsxs)(n.tr,{children:[(0,r.jsx)(n.td,{children:(0,r.jsx)(n.code,{children:"pagination_label"})}),(0,r.jsx)(n.td,{children:(0,r.jsx)(n.code,{children:"string"})}),(0,r.jsxs)(n.td,{children:[(0,r.jsx)(n.code,{children:"sidebar_label"})," or ",(0,r.jsx)(n.code,{children:"title"})]}),(0,r.jsx)(n.td,{children:"The text used in the document next/previous buttons for this document."})]}),(0,r.jsxs)(n.tr,{children:[(0,r.jsx)(n.td,{children:(0,r.jsx)(n.code,{children:"sidebar_label"})}),(0,r.jsx)(n.td,{children:(0,r.jsx)(n.code,{children:"string"})}),(0,r.jsx)(n.td,{children:(0,r.jsx)(n.code,{children:"title"})}),(0,r.jsx)(n.td,{children:"The text shown in the document sidebar for this document."})]}),(0,r.jsxs)(n.tr,{children:[(0,r.jsx)(n.td,{children:(0,r.jsx)(n.code,{children:"sidebar_position"})}),(0,r.jsx)(n.td,{children:(0,r.jsx)(n.code,{children:"number"})}),(0,r.jsx)(n.td,{children:"Default ordering"}),(0,r.jsxs)(n.td,{children:["Controls the position of a doc inside the generated sidebar slice when using ",(0,r.jsx)(n.code,{children:"autogenerated"})," sidebar items. See also ",(0,r.jsx)(n.a,{href:"/docs/sidebar/autogenerated#autogenerated-sidebar-metadata",children:"Autogenerated sidebar metadata"}),"."]})]}),(0,r.jsxs)(n.tr,{children:[(0,r.jsx)(n.td,{children:(0,r.jsx)(n.code,{children:"sidebar_class_name"})}),(0,r.jsx)(n.td,{children:(0,r.jsx)(n.code,{children:"string"})}),(0,r.jsx)(n.td,{children:(0,r.jsx)(n.code,{children:"undefined"})}),(0,r.jsx)(n.td,{children:"Gives the corresponding sidebar label a special class name when using autogenerated sidebars."})]}),(0,r.jsxs)(n.tr,{children:[(0,r.jsx)(n.td,{children:(0,r.jsx)(n.code,{children:"sidebar_custom_props"})}),(0,r.jsx)(n.td,{children:(0,r.jsx)(n.code,{children:"object"})}),(0,r.jsx)(n.td,{children:(0,r.jsx)(n.code,{children:"undefined"})}),(0,r.jsxs)(n.td,{children:["Assign ",(0,r.jsx)(n.a,{href:"/docs/sidebar#passing-custom-props",children:"custom props"})," to the sidebar item referencing this doc"]})]}),(0,r.jsxs)(n.tr,{children:[(0,r.jsx)(n.td,{children:(0,r.jsx)(n.code,{children:"displayed_sidebar"})}),(0,r.jsx)(n.td,{children:(0,r.jsx)(n.code,{children:"string"})}),(0,r.jsx)(n.td,{children:(0,r.jsx)(n.code,{children:"undefined"})}),(0,r.jsxs)(n.td,{children:["Force the display of a given sidebar when browsing the current document. Read the ",(0,r.jsx)(n.a,{href:"/docs/sidebar/multiple-sidebars",children:"multiple sidebars guide"})," for details."]})]}),(0,r.jsxs)(n.tr,{children:[(0,r.jsx)(n.td,{children:(0,r.jsx)(n.code,{children:"hide_title"})}),(0,r.jsx)(n.td,{children:(0,r.jsx)(n.code,{children:"boolean"})}),(0,r.jsx)(n.td,{children:(0,r.jsx)(n.code,{children:"false"})}),(0,r.jsx)(n.td,{children:"Whether to hide the title at the top of the doc. It only hides a title declared through the front matter, and have no effect on a Markdown title at the top of your document."})]}),(0,r.jsxs)(n.tr,{children:[(0,r.jsx)(n.td,{children:(0,r.jsx)(n.code,{children:"hide_table_of_contents"})}),(0,r.jsx)(n.td,{children:(0,r.jsx)(n.code,{children:"boolean"})}),(0,r.jsx)(n.td,{children:(0,r.jsx)(n.code,{children:"false"})}),(0,r.jsx)(n.td,{children:"Whether to hide the table of contents to the right."})]}),(0,r.jsxs)(n.tr,{children:[(0,r.jsx)(n.td,{children:(0,r.jsx)(n.code,{children:"toc_min_heading_level"})}),(0,r.jsx)(n.td,{children:(0,r.jsx)(n.code,{children:"number"})}),(0,r.jsx)(n.td,{children:(0,r.jsx)(n.code,{children:"2"})}),(0,r.jsx)(n.td,{children:"The minimum heading level shown in the table of contents. Must be between 2 and 6 and lower or equal to the max value."})]}),(0,r.jsxs)(n.tr,{children:[(0,r.jsx)(n.td,{children:(0,r.jsx)(n.code,{children:"toc_max_heading_level"})}),(0,r.jsx)(n.td,{children:(0,r.jsx)(n.code,{children:"number"})}),(0,r.jsx)(n.td,{children:(0,r.jsx)(n.code,{children:"3"})}),(0,r.jsx)(n.td,{children:"The max heading level shown in the table of contents. Must be between 2 and 6."})]}),(0,r.jsxs)(n.tr,{children:[(0,r.jsx)(n.td,{children:(0,r.jsx)(n.code,{children:"pagination_next"})}),(0,r.jsx)(n.td,{children:(0,r.jsx)("code",{children:"string | null"})}),(0,r.jsx)(n.td,{children:"Next doc in the sidebar"}),(0,r.jsxs)(n.td,{children:['The ID of the documentation you want the "Next" pagination to link to. Use ',(0,r.jsx)(n.code,{children:"null"}),' to disable showing "Next" for this page.']})]}),(0,r.jsxs)(n.tr,{children:[(0,r.jsx)(n.td,{children:(0,r.jsx)(n.code,{children:"pagination_prev"})}),(0,r.jsx)(n.td,{children:(0,r.jsx)("code",{children:"string | null"})}),(0,r.jsx)(n.td,{children:"Previous doc in the sidebar"}),(0,r.jsxs)(n.td,{children:['The ID of the documentation you want the "Previous" pagination to link to. Use ',(0,r.jsx)(n.code,{children:"null"}),' to disable showing "Previous" for this page.']})]}),(0,r.jsxs)(n.tr,{children:[(0,r.jsx)(n.td,{children:(0,r.jsx)(n.code,{children:"parse_number_prefixes"})}),(0,r.jsx)(n.td,{children:(0,r.jsx)(n.code,{children:"boolean"})}),(0,r.jsxs)(n.td,{children:[(0,r.jsx)(n.code,{children:"numberPrefixParser"})," plugin option"]}),(0,r.jsxs)(n.td,{children:["Whether number prefix parsing is disabled on this doc. See also ",(0,r.jsx)(n.a,{href:"/docs/sidebar/autogenerated#using-number-prefixes",children:"Using number prefixes"}),"."]})]}),(0,r.jsxs)(n.tr,{children:[(0,r.jsx)(n.td,{children:(0,r.jsx)(n.code,{children:"custom_edit_url"})}),(0,r.jsx)(n.td,{children:(0,r.jsx)("code",{children:"string | null"})}),(0,r.jsxs)(n.td,{children:["Computed using the ",(0,r.jsx)(n.code,{children:"editUrl"})," plugin option"]}),(0,r.jsxs)(n.td,{children:["The URL for editing this document. Use ",(0,r.jsx)(n.code,{children:"null"}),' to disable showing "Edit this page" for this page.']})]}),(0,r.jsxs)(n.tr,{children:[(0,r.jsx)(n.td,{children:(0,r.jsx)(n.code,{children:"keywords"})}),(0,r.jsx)(n.td,{children:(0,r.jsx)(n.code,{children:"string[]"})}),(0,r.jsx)(n.td,{children:(0,r.jsx)(n.code,{children:"undefined"})}),(0,r.jsx)(n.td,{children:"Keywords meta tag for the document page, for search engines."})]}),(0,r.jsxs)(n.tr,{children:[(0,r.jsx)(n.td,{children:(0,r.jsx)(n.code,{children:"description"})}),(0,r.jsx)(n.td,{children:(0,r.jsx)(n.code,{children:"string"})}),(0,r.jsx)(n.td,{children:"The first line of Markdown content"}),(0,r.jsxs)(n.td,{children:["The description of your document, which will become the ",(0,r.jsx)(n.code,{children:''})," and ",(0,r.jsx)(n.code,{children:''})," in ",(0,r.jsx)(n.code,{children:""}),", used by search engines."]})]}),(0,r.jsxs)(n.tr,{children:[(0,r.jsx)(n.td,{children:(0,r.jsx)(n.code,{children:"image"})}),(0,r.jsx)(n.td,{children:(0,r.jsx)(n.code,{children:"string"})}),(0,r.jsx)(n.td,{children:(0,r.jsx)(n.code,{children:"undefined"})}),(0,r.jsxs)(n.td,{children:["Cover or thumbnail image that will be used as the ",(0,r.jsx)(n.code,{children:''})," in the ",(0,r.jsx)(n.code,{children:""}),", enhancing link previews on social media and messaging platforms."]})]}),(0,r.jsxs)(n.tr,{children:[(0,r.jsx)(n.td,{children:(0,r.jsx)(n.code,{children:"slug"})}),(0,r.jsx)(n.td,{children:(0,r.jsx)(n.code,{children:"string"})}),(0,r.jsx)(n.td,{children:"File path"}),(0,r.jsxs)(n.td,{children:["Allows to customize the document URL (",(0,r.jsx)(n.code,{children:"/ / "}),"). Support multiple patterns: ",(0,r.jsx)(n.code,{children:"slug: my-doc"}),", ",(0,r.jsx)(n.code,{children:"slug: /my/path/myDoc"}),", ",(0,r.jsx)(n.code,{children:"slug: /"}),"."]})]}),(0,r.jsxs)(n.tr,{children:[(0,r.jsx)(n.td,{children:(0,r.jsx)(n.code,{children:"tags"})}),(0,r.jsx)(n.td,{children:(0,r.jsx)(n.code,{children:"Tag[]"})}),(0,r.jsx)(n.td,{children:(0,r.jsx)(n.code,{children:"undefined"})}),(0,r.jsxs)(n.td,{children:["A list of strings or objects of two string fields ",(0,r.jsx)(n.code,{children:"label"})," and ",(0,r.jsx)(n.code,{children:"permalink"})," to tag to your docs. Strings can be a reference to keys of a ",(0,r.jsx)(n.a,{href:"#tags-file",children:"tags file"})," (usually ",(0,r.jsx)(n.code,{children:"tags.yml"}),")"]})]}),(0,r.jsxs)(n.tr,{children:[(0,r.jsx)(n.td,{children:(0,r.jsx)(n.code,{children:"draft"})}),(0,r.jsx)(n.td,{children:(0,r.jsx)(n.code,{children:"boolean"})}),(0,r.jsx)(n.td,{children:(0,r.jsx)(n.code,{children:"false"})}),(0,r.jsx)(n.td,{children:"Draft documents will only be available during development."})]}),(0,r.jsxs)(n.tr,{children:[(0,r.jsx)(n.td,{children:(0,r.jsx)(n.code,{children:"unlisted"})}),(0,r.jsx)(n.td,{children:(0,r.jsx)(n.code,{children:"boolean"})}),(0,r.jsx)(n.td,{children:(0,r.jsx)(n.code,{children:"false"})}),(0,r.jsx)(n.td,{children:'Unlisted documents will be available in both development and production. They will be "hidden" in production, not indexed, excluded from sitemaps, and can only be accessed by users having a direct link.'})]}),(0,r.jsxs)(n.tr,{children:[(0,r.jsx)(n.td,{children:(0,r.jsx)(n.code,{children:"last_update"})}),(0,r.jsx)(n.td,{children:(0,r.jsx)(n.code,{children:"FrontMatterLastUpdate"})}),(0,r.jsx)(n.td,{children:(0,r.jsx)(n.code,{children:"undefined"})}),(0,r.jsxs)(n.td,{children:["Allows overriding the last update author/date. Date can be any ",(0,r.jsx)(n.a,{href:"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/parse",children:"parsable date string"}),"."]})]})]})]})}),"\n",(0,r.jsx)(n.pre,{children:(0,r.jsx)(n.code,{className:"language-ts",children:"type FrontMatterLastUpdate = {date?: string; author?: string};\n\ntype Tag = string | {label: string; permalink: string};\n"})}),"\n",(0,r.jsx)(n.p,{children:"Example:"}),"\n",(0,r.jsx)(n.pre,{children:(0,r.jsx)(n.code,{className:"language-md",children:"---\nid: doc-markdown\ntitle: Docs Markdown Features\nhide_title: false\nhide_table_of_contents: false\nsidebar_label: Markdown\nsidebar_position: 3\npagination_label: Markdown features\ncustom_edit_url: https://github.com/facebook/docusaurus/edit/main/docs/api-doc-markdown.md\ndescription: How do I find you when I cannot solve this problem\nkeywords:\n - docs\n - docusaurus\ntags: [docusaurus]\nimage: https://i.imgur.com/mErPwqL.png\nslug: /myDoc\nlast_update:\n date: 1/1/2000\n author: custom author name\n---\n\n# Markdown Features\n\nMy Document Markdown content\n"})}),"\n","\n",(0,r.jsx)(a.ZP,{}),"\n",(0,r.jsx)(n.h2,{id:"i18n",children:"i18n"}),"\n",(0,r.jsxs)(n.p,{children:["Read the ",(0,r.jsx)(n.a,{href:"/docs/i18n/introduction",children:"i18n introduction"})," first."]}),"\n",(0,r.jsx)(n.h3,{id:"translation-files-location",children:"Translation files location"}),"\n",(0,r.jsxs)(n.ul,{children:["\n",(0,r.jsxs)(n.li,{children:[(0,r.jsx)(n.strong,{children:"Base path"}),": ",(0,r.jsx)(n.code,{children:"website/i18n/[locale]/docusaurus-plugin-content-docs"})]}),"\n",(0,r.jsxs)(n.li,{children:[(0,r.jsx)(n.strong,{children:"Multi-instance path"}),": ",(0,r.jsx)(n.code,{children:"website/i18n/[locale]/docusaurus-plugin-content-docs-[pluginId]"})]}),"\n",(0,r.jsxs)(n.li,{children:[(0,r.jsx)(n.strong,{children:"JSON files"}),": extracted with ",(0,r.jsx)(n.a,{href:"/docs/cli#docusaurus-write-translations-sitedir",children:(0,r.jsx)(n.code,{children:"docusaurus write-translations"})})]}),"\n",(0,r.jsxs)(n.li,{children:[(0,r.jsx)(n.strong,{children:"Markdown files"}),": ",(0,r.jsx)(n.code,{children:"website/i18n/[locale]/docusaurus-plugin-content-docs/[versionName]"})]}),"\n"]}),"\n",(0,r.jsx)(n.h3,{id:"example-file-system-structure",children:"Example file-system structure"}),"\n",(0,r.jsx)(n.pre,{children:(0,r.jsx)(n.code,{className:"language-bash",children:"website/i18n/[locale]/docusaurus-plugin-content-docs\n\u2502\n\u2502 # translations for website/docs\n\u251C\u2500\u2500 current\n\u2502 \u251C\u2500\u2500 api\n\u2502 \u2502 \u2514\u2500\u2500 config.md\n\u2502 \u2514\u2500\u2500 getting-started.md\n\u251C\u2500\u2500 current.json\n\u2502\n\u2502 # translations for website/versioned_docs/version-1.0.0\n\u251C\u2500\u2500 version-1.0.0\n\u2502 \u251C\u2500\u2500 api\n\u2502 \u2502 \u2514\u2500\u2500 config.md\n\u2502 \u2514\u2500\u2500 getting-started.md\n\u2514\u2500\u2500 version-1.0.0.json\n"})})]})}function g(e={}){let{wrapper:n}={...(0,i.a)(),...e.components};return n?(0,r.jsx)(n,{...e,children:(0,r.jsx)(p,{...e})}):p(e)}},58636:function(e,n,t){t.d(n,{Z:()=>i});var s=t(85893);t(67294);var r=t(90496);function i(e){let{children:n,hidden:t,className:i}=e;return(0,s.jsx)("div",{role:"tabpanel",className:(0,r.Z)("tabItem_pnkT",i),hidden:t,children:n})}},15398:function(e,n,t){t.d(n,{Z:()=>f});var s=t(85893),r=t(67294),i=t(90496),d=t(54947),l=t(3620),o=t(844),c=t(97486),a=t(32263),h=t(16971);function u(e){return r.Children.toArray(e).filter(e=>"\n"!==e).map(e=>{if(!e||(0,r.isValidElement)(e)&&function(e){let{props:n}=e;return!!n&&"object"==typeof n&&"value"in n}(e))return e;throw Error(`Docusaurus error: Bad child <${"string"==typeof e.type?e.type:e.type.name}>: all children of the component should be , and every should have a unique "value" prop.`)})?.filter(Boolean)??[]}function x(e){let{value:n,tabValues:t}=e;return t.some(e=>e.value===n)}var j=t(71607);function p(e){let{className:n,block:t,selectedValue:r,selectValue:l,tabValues:o}=e,c=[],{blockElementScrollPositionUntilNextRender:a}=(0,d.o5)(),h=e=>{let n=e.currentTarget,t=o[c.indexOf(n)].value;t!==r&&(a(n),l(t))},u=e=>{let n=null;switch(e.key){case"Enter":h(e);break;case"ArrowRight":{let t=c.indexOf(e.currentTarget)+1;n=c[t]??c[0];break}case"ArrowLeft":{let t=c.indexOf(e.currentTarget)-1;n=c[t]??c[c.length-1]}}n?.focus()};return(0,s.jsx)("ul",{role:"tablist","aria-orientation":"horizontal",className:(0,i.Z)("tabs",{"tabs--block":t},n),children:o.map(e=>{let{value:n,label:t,attributes:d}=e;return(0,s.jsx)("li",{role:"tab",tabIndex:r===n?0:-1,"aria-selected":r===n,ref:e=>{c.push(e)},onKeyDown:u,onClick:h,...d,className:(0,i.Z)("tabs__item","tabItem_AQgk",d?.className,{"tabs__item--active":r===n}),children:t??n},n)})})}function g(e){let{lazy:n,children:t,selectedValue:d}=e,l=(Array.isArray(t)?t:[t]).filter(Boolean);if(n){let e=l.find(e=>e.props.value===d);return e?(0,r.cloneElement)(e,{className:(0,i.Z)("margin-top--md",e.props.className)}):null}return(0,s.jsx)("div",{className:"margin-top--md",children:l.map((e,n)=>(0,r.cloneElement)(e,{key:n,hidden:e.props.value!==d}))})}function m(e){let n=function(e){let{defaultValue:n,queryString:t=!1,groupId:s}=e,i=function(e){let{values:n,children:t}=e;return(0,r.useMemo)(()=>{let e=n??u(t).map(e=>{let{props:{value:n,label:t,attributes:s,default:r}}=e;return{value:n,label:t,attributes:s,default:r}}),s=(0,a.lx)(e,(e,n)=>e.value===n.value);if(s.length>0)throw Error(`Docusaurus error: Duplicate values "${s.map(e=>e.value).join(", ")}" found in . Every value needs to be unique.`);return e},[n,t])}(e),[d,j]=(0,r.useState)(()=>(function(e){let{defaultValue:n,tabValues:t}=e;if(0===t.length)throw Error("Docusaurus error: the component requires at least one children component");if(n){if(!x({value:n,tabValues:t}))throw Error(`Docusaurus error: The has a defaultValue "${n}" but none of its children has the corresponding value. Available values are: ${t.map(e=>e.value).join(", ")}. If you intend to show no default tab, use defaultValue={null} instead.`);return n}let s=t.find(e=>e.default)??t[0];if(!s)throw Error("Unexpected error: 0 tabValues");return s.value})({defaultValue:n,tabValues:i})),[p,g]=function(e){let{queryString:n=!1,groupId:t}=e,s=(0,l.k6)(),i=function(e){let{queryString:n=!1,groupId:t}=e;if("string"==typeof n)return n;if(!1===n)return null;if(!0===n&&!t)throw Error('Docusaurus error: The component groupId prop is required if queryString=true, because this value is used as the search param name. You can also provide an explicit value such as queryString="my-search-param".');return t??null}({queryString:n,groupId:t});return[(0,c._X)(i),(0,r.useCallback)(e=>{if(!i)return;let n=new URLSearchParams(s.location.search);n.set(i,e),s.replace({...s.location,search:n.toString()})},[i,s])]}({queryString:t,groupId:s}),[m,f]=function(e){let{groupId:n}=e,t=n?`docusaurus.tab.${n}`:null,[s,i]=(0,h.Nk)(t);return[s,(0,r.useCallback)(e=>{t&&i.set(e)},[t,i])]}({groupId:s}),b=(()=>{let e=p??m;return x({value:e,tabValues:i})?e:null})();return(0,o.Z)(()=>{b&&j(b)},[b]),{selectedValue:d,selectValue:(0,r.useCallback)(e=>{if(!x({value:e,tabValues:i}))throw Error(`Can't select invalid tab value=${e}`);j(e),g(e),f(e)},[g,f,i]),tabValues:i}}(e);return(0,s.jsxs)("div",{className:(0,i.Z)("tabs-container","tabList_Qoir"),children:[(0,s.jsx)(p,{...n,...e}),(0,s.jsx)(g,{...n,...e})]})}function f(e){let n=(0,j.Z)();return(0,s.jsx)(m,{...e,children:u(e.children)},String(n))}},56497:function(e,n,t){t.d(n,{Z:()=>i});var s=t(85893);t(67294);var r=t(71607);function i(e){let{children:n,fallback:t}=e;return(0,r.Z)()?(0,s.jsx)(s.Fragment,{children:n?.()}):t??null}},32240:function(e,n,t){t.d(n,{Z:()=>o});var s=t(85893),r=t(67294),i=t(96700),d=t(3620);let l=r.forwardRef(function(e,n){let{name:t,children:l}=e,o=function(e){let n=e;for(;(0,r.isValidElement)(n);)[n]=r.Children.toArray(n.props.children);if("string"!=typeof n)throw Error(`Could not extract APITable row name from JSX tree: +${JSON.stringify(e,null,2)}`);return n}(l),c=t?`${t}-${o}`:o,a=`#${c}`,h=(0,d.k6)();return(0,i.Z)().collectAnchor(c),(0,s.jsx)("tr",{id:c,tabIndex:0,ref:h.location.hash===a?n:void 0,onClick:e=>{let n="TD"===e.target.tagName.toUpperCase(),t=!!window.getSelection()?.toString();n&&!t&&h.push(a)},onKeyDown:e=>{"Enter"===e.key&&h.push(a)},children:l.props.children})});function o(e){let{children:n,name:t}=e;if("table"!==n.type)throw Error("Bad usage of APITable component.\nIt is probably that your Markdown table is malformed.\nMake sure to double-check you have the appropriate number of columns for each table row.");let[i,d]=r.Children.toArray(n.props.children),o=(0,r.useRef)(null);(0,r.useEffect)(()=>{o.current?.focus()},[o]);let c=r.Children.map(d.props.children,e=>(0,s.jsx)(l,{name:t,ref:o,children:e}));return(0,s.jsxs)("table",{className:"apiTable_e8hp",children:[i,(0,s.jsx)("tbody",{children:c})]})}},66359:function(e,n,t){t.d(n,{Z:()=>h});var s=t(85893);t(67294);var r=t(35363),i=t(90158),d=t(77827),l=t(15398),o=t(58636),c=t(27817);let a=void 0;function h(e){let{code:n,pluginName:t,presetOptionName:h}=e,u=(0,i.zu)(a).path;return(0,s.jsxs)(l.Z,{groupId:"api-config-ex",children:[(0,s.jsxs)(o.Z,{value:"preset",label:(0,d.I)({message:"Preset options"}),children:[(0,s.jsx)("p",{children:(0,s.jsx)(d.Z,{id:"apiDocs.configTabs.presetOptions.description",values:{presetLink:(0,s.jsx)(r.Z,{to:`${u}/using-plugins#docusauruspreset-classic`,children:(0,s.jsx)(d.Z,{children:"preset options"})})},children:"If you use a preset, configure this plugin through the {presetLink}:"})}),(0,s.jsx)(c.Z,{language:"js",title:"docusaurus.config.js",children:`module.exports = { + presets: [ + [ + '@docusaurus/preset-classic', + { + // highlight-start + ${h}: ${n.replace(/\n/g,"\n ")}, + // highlight-end + }, + ], + ], +};`})]}),(0,s.jsxs)(o.Z,{value:"plugin",label:(0,d.I)({message:"Plugin options"}),children:[(0,s.jsx)("p",{children:(0,s.jsx)(d.Z,{children:"If you are using a standalone plugin, provide options directly to the plugin:"})}),(0,s.jsx)(c.Z,{language:"js",title:"docusaurus.config.js",children:`module.exports = { + plugins: [ + [ + '${t}', + // highlight-start + ${n.replace(/\n/g,"\n ")}, + // highlight-end + ], + ], +};`})]})]})}},27817:function(e,n,t){t.d(n,{Z:()=>ep});var s={};t.r(s),t.d(s,{ButtonExample:()=>eh});var r=t(85893),i=t(67294),d=t(71607),l=t(90496),o=t(45245),c=t(26378);function a(){let{prism:e}=(0,c.L)(),{colorMode:n}=(0,o.I)(),t=e.theme,s=e.darkTheme||t;return"dark"===n?s:t}var h=t(55951),u=t(6324),x=t.n(u),j=t(50923);let p=/title=(? ["'])(?.*?)\1/,g=/\{(? [\d,-]+)\}/,m={js:{start:"\\/\\/",end:""},jsBlock:{start:"\\/\\*",end:"\\*\\/"},jsx:{start:"\\{\\s*\\/\\*",end:"\\*\\/\\s*\\}"},bash:{start:"#",end:""},html:{start:"\x3c!--",end:"--\x3e"}},f={...m,lua:{start:"--",end:""},wasm:{start:"\\;\\;",end:""},tex:{start:"%",end:""},vb:{start:"['\u2018\u2019]",end:""},vbnet:{start:"(?:_\\s*)?['\u2018\u2019]",end:""},rem:{start:"[Rr][Ee][Mm]\\b",end:""},f90:{start:"!",end:""},ml:{start:"\\(\\*",end:"\\*\\)"},cobol:{start:"\\*>",end:""}},b=Object.keys(m);function v(e,n){let t=e.map(e=>{let{start:t,end:s}=f[e];return`(?:${t}\\s*(${n.flatMap(e=>[e.line,e.block?.start,e.block?.end].filter(Boolean)).join("|")})\\s*${s})`}).join("|");return RegExp(`^\\s*(?:${t})\\s*$`)}let y=(0,i.createContext)(null);function w(e){let{metadata:n,wordWrap:t,children:s}=e,d=(0,i.useMemo)(()=>({metadata:n,wordWrap:t}),[n,t]);return(0,r.jsx)(y.Provider,{value:d,children:s})}function k(){let e=(0,i.useContext)(y);if(null===e)throw new j.i6("CodeBlockContextProvider");return e}function N(e){let{as:n,...t}=e,s=function(e){let n={color:"--prism-color",backgroundColor:"--prism-background-color"},t={};return Object.entries(e.plain).forEach(e=>{let[s,r]=e,i=n[s];i&&"string"==typeof r&&(t[i]=r)}),t}(a());return(0,r.jsx)(n,{...t,style:s,className:(0,l.Z)(t.className,"codeBlockContainer_jDV4",h.k.common.codeBlock)})}let C={codeBlock:"codeBlock_Gebt",codeBlockStandalone:"codeBlockStandalone_i_cY",codeBlockLines:"codeBlockLines_FJaf",codeBlockLinesWithNumbering:"codeBlockLinesWithNumbering_FU9Q"};function T(e){let{children:n,className:t}=e;return(0,r.jsx)(N,{as:"pre",tabIndex:0,className:(0,l.Z)(C.codeBlockStandalone,"thin-scrollbar",t),children:(0,r.jsx)("code",{className:C.codeBlockLines,children:n})})}let P={attributes:!0,characterData:!0,childList:!0,subtree:!0};function I(e){let{children:n}=e;return n}var _=t(7316);function L(e){let{line:n,token:t,...s}=e;return(0,r.jsx)("span",{...s})}let D={codeLine:"codeLine_qRmp",codeLineNumber:"codeLineNumber_dS_J",codeLineContent:"codeLineContent_XF5l"};function B(e){let{line:n,classNames:t,showLineNumbers:s,getLineProps:i,getTokenProps:d}=e,o=function(e){let n=1===e.length&&"\n"===e[0].content?e[0]:void 0;return n?[{...n,content:""}]:e}(n),c=i({line:o,className:(0,l.Z)(t,s&&D.codeLine)}),a=o.map((e,n)=>{let t=d({token:e});return(0,r.jsx)(L,{...t,line:o,token:e,children:t.children},n)});return(0,r.jsxs)("span",{...c,children:[s?(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)("span",{className:D.codeLineNumber}),(0,r.jsx)("span",{className:D.codeLineContent,children:a})]}):a,(0,r.jsx)("br",{})]})}let E=i.forwardRef((e,n)=>(0,r.jsx)("pre",{ref:n,tabIndex:0,...e,className:(0,l.Z)(e.className,C.codeBlock,"thin-scrollbar")}));function S(e){let{metadata:n}=k();return(0,r.jsx)("code",{...e,className:(0,l.Z)(e.className,C.codeBlockLines,void 0!==n.lineNumbersStart&&C.codeBlockLinesWithNumbering),style:{...e.style,counterReset:void 0===n.lineNumbersStart?void 0:`line-count ${n.lineNumbersStart-1}`}})}function U(e){let{className:n}=e,{metadata:t,wordWrap:s}=k(),i=a(),{code:d,language:o,lineNumbersStart:c,lineClassNames:h}=t;return(0,r.jsx)(_.y$,{theme:i,code:d,language:o,children:e=>{let{className:t,style:i,tokens:d,getLineProps:o,getTokenProps:a}=e;return(0,r.jsx)(E,{ref:s.codeBlockRef,className:(0,l.Z)(n,t),style:i,children:(0,r.jsx)(S,{children:d.map((e,n)=>(0,r.jsx)(B,{line:e,getLineProps:o,getTokenProps:a,classNames:h[n],showLineNumbers:void 0!==c},n))})})}})}var R=t(56497),Z=t(44771),M=t(77827);function A(e){let{className:n,...t}=e;return(0,r.jsx)("button",{type:"button",...t,className:(0,l.Z)("clean-btn",n)})}function V(e){return(0,r.jsx)("svg",{viewBox:"0 0 24 24",...e,children:(0,r.jsx)("path",{fill:"currentColor",d:"M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"})})}function F(e){return(0,r.jsx)("svg",{viewBox:"0 0 24 24",...e,children:(0,r.jsx)("path",{fill:"currentColor",d:"M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"})})}let $={copyButtonCopied:"copyButtonCopied_wDuR",copyButtonIcons:"copyButtonIcons_gMWc",copyButtonIcon:"copyButtonIcon_GXfb",copyButtonSuccessIcon:"copyButtonSuccessIcon_ktUX"};function W(e){let{className:n}=e,{copyCode:t,isCopied:s}=function(){let{metadata:{code:e}}=k(),[n,t]=(0,i.useState)(!1),s=(0,i.useRef)(void 0),r=(0,i.useCallback)(()=>{(0,Z.Z)(e),t(!0),s.current=window.setTimeout(()=>{t(!1)},1e3)},[e]);return(0,i.useEffect)(()=>()=>window.clearTimeout(s.current),[]),{copyCode:r,isCopied:n}}();return(0,r.jsx)(A,{"aria-label":s?(0,M.I)({id:"theme.CodeBlock.copied",message:"Copied",description:"The copied button label on code blocks"}):(0,M.I)({id:"theme.CodeBlock.copyButtonAriaLabel",message:"Copy code to clipboard",description:"The ARIA label for copy code blocks button"}),title:(0,M.I)({id:"theme.CodeBlock.copy",message:"Copy",description:"The copy button label on code blocks"}),className:(0,l.Z)(n,$.copyButton,s&&$.copyButtonCopied),onClick:t,children:(0,r.jsxs)("span",{className:$.copyButtonIcons,"aria-hidden":"true",children:[(0,r.jsx)(V,{className:$.copyButtonIcon}),(0,r.jsx)(F,{className:$.copyButtonSuccessIcon})]})})}function O(e){return(0,r.jsx)("svg",{viewBox:"0 0 24 24",...e,children:(0,r.jsx)("path",{fill:"currentColor",d:"M4 19h6v-2H4v2zM20 5H4v2h16V5zm-3 6H4v2h13.25c1.1 0 2 .9 2 2s-.9 2-2 2H15v-2l-3 3l3 3v-2h2c2.21 0 4-1.79 4-4s-1.79-4-4-4z"})})}let G={wordWrapButtonIcon:"wordWrapButtonIcon___5r",wordWrapButtonEnabled:"wordWrapButtonEnabled_nam_"};function z(e){let{className:n}=e,{wordWrap:t}=k();if(!(t.isEnabled||t.isCodeScrollable))return!1;let s=(0,M.I)({id:"theme.CodeBlock.wordWrapToggle",message:"Toggle word wrap",description:"The title attribute for toggle word wrapping button of code block lines"});return(0,r.jsx)(A,{onClick:()=>t.toggle(),className:(0,l.Z)(n,t.isEnabled&&G.wordWrapButtonEnabled),"aria-label":s,title:s,children:(0,r.jsx)(O,{className:G.wordWrapButtonIcon,"aria-hidden":"true"})})}function q(e){let{className:n}=e;return(0,r.jsx)(R.Z,{children:()=>(0,r.jsxs)("div",{className:(0,l.Z)(n,"buttonGroup_KXnS"),children:[(0,r.jsx)(z,{}),(0,r.jsx)(W,{})]})})}let H={codeBlockContent:"codeBlockContent_cKMj",codeBlockTitle:"codeBlockTitle_U6Q0"};function X(e){let{className:n}=e,{metadata:t}=k();return(0,r.jsxs)(N,{as:"div",className:(0,l.Z)(n,t.className),children:[t.title&&(0,r.jsx)("div",{className:H.codeBlockTitle,children:(0,r.jsx)(I,{children:t.title})}),(0,r.jsxs)("div",{className:H.codeBlockContent,children:[(0,r.jsx)(U,{}),(0,r.jsx)(q,{})]})]})}function Y(e){let n=function(e){let{prism:n}=(0,c.L)();return function(e){var n,t,s;let r=(t=(n={language:e.language,defaultLanguage:e.defaultLanguage,className:e.className}).language??function(e){if(!e)return;let n=e.split(" ").find(e=>e.startsWith("language-"));return n?.replace(/language-/,"")}(n.className)??n.defaultLanguage,t?.toLowerCase()??"text"),{lineClassNames:i,code:d}=function(e,n){let t=e.replace(/\r?\n$/,"");return function(e,n){let{metastring:t,magicComments:s}=n;if(t&&g.test(t)){let n=t.match(g).groups.range;if(0===s.length)throw Error(`A highlight range has been given in code block's metastring (\`\`\` ${t}), but no magic comment config is available. Docusaurus applies the first magic comment entry's className for metastring ranges.`);let r=s[0].className;return{lineClassNames:Object.fromEntries(x()(n).filter(e=>e>0).map(e=>[e-1,[r]])),code:e}}return null}(t,{...n})??function(e,n){let{language:t,magicComments:s}=n;if(void 0===t)return{lineClassNames:{},code:e};let r=function(e,n){switch(e){case"js":case"javascript":case"ts":case"typescript":return v(["js","jsBlock"],n);case"jsx":case"tsx":return v(["js","jsBlock","jsx"],n);case"html":return v(["js","jsBlock","html"],n);case"python":case"py":case"bash":return v(["bash"],n);case"markdown":case"md":return v(["html","jsx","bash"],n);case"tex":case"latex":case"matlab":return v(["tex"],n);case"lua":case"haskell":return v(["lua"],n);case"sql":return v(["lua","jsBlock"],n);case"wasm":return v(["wasm"],n);case"vb":case"vba":case"visual-basic":return v(["vb","rem"],n);case"vbnet":return v(["vbnet","rem"],n);case"batch":return v(["rem"],n);case"basic":return v(["rem","f90"],n);case"fsharp":return v(["js","ml"],n);case"ocaml":case"sml":return v(["ml"],n);case"fortran":return v(["f90"],n);case"cobol":return v(["cobol"],n);default:return v(b,n)}}(t,s),i=e.split(/\r?\n/),d=Object.fromEntries(s.map(e=>[e.className,{start:0,range:""}])),l=Object.fromEntries(s.filter(e=>e.line).map(e=>{let{className:n,line:t}=e;return[t,n]})),o=Object.fromEntries(s.filter(e=>e.block).map(e=>{let{className:n,block:t}=e;return[t.start,n]})),c=Object.fromEntries(s.filter(e=>e.block).map(e=>{let{className:n,block:t}=e;return[t.end,n]}));for(let e=0;e void 0!==e);l[t]?d[l[t]].range+=`${e},`:o[t]?d[o[t]].start=e:c[t]&&(d[c[t]].range+=`${d[c[t]].start}-${e-1},`),i.splice(e,1)}let a={};return Object.entries(d).forEach(e=>{let[n,{range:t}]=e;x()(t).forEach(e=>{a[e]??=[],a[e].push(n)})}),{code:i.join("\n"),lineClassNames:a}}(t,{...n})}(e.code,{metastring:e.metastring,magicComments:e.magicComments,language:r}),o=function(e){let{className:n,language:t}=e;return(0,l.Z)(n,t&&!n?.includes(`language-${t}`)&&`language-${t}`)}({className:e.className,language:r}),c=(s=e.metastring,(s?.match(p)?.groups.title??"")||e.title),a=function(e){let{showLineNumbers:n,metastring:t}=e;if("boolean"==typeof n)return n?1:void 0;if("number"==typeof n)return n;let s=t?.split(" ").find(e=>e.startsWith("showLineNumbers"));if(s)return s.startsWith("showLineNumbers=")?parseInt(s.replace("showLineNumbers=",""),10):1}({showLineNumbers:e.showLineNumbers,metastring:e.metastring});return{codeInput:e.code,code:d,className:o,language:r,title:c,lineNumbersStart:a,lineClassNames:i}}({code:e.children,className:e.className,metastring:e.metastring,magicComments:n.magicComments,defaultLanguage:n.defaultLanguage,language:e.language,title:e.title,showLineNumbers:e.showLineNumbers})}(e),t=function(){let[e,n]=(0,i.useState)(!1),[t,s]=(0,i.useState)(!1),r=(0,i.useRef)(null),d=(0,i.useCallback)(()=>{let t=r.current.querySelector("code");e?t.removeAttribute("style"):(t.style.whiteSpace="pre-wrap",t.style.overflowWrap="anywhere"),n(e=>!e)},[r,e]),l=(0,i.useCallback)(()=>{let{scrollWidth:e,clientWidth:n}=r.current;s(e>n||r.current.querySelector("code").hasAttribute("style"))},[r]),[o,c]=(0,i.useState)(),a=(0,i.useCallback)(()=>{c(r.current?.closest("[role=tabpanel][hidden]"))},[r,c]);return(0,i.useEffect)(()=>{a()},[a]),!function(e,n){let t=arguments.length>2&&void 0!==arguments[2]?arguments[2]:P,s=(0,j.zX)(n),r=(0,j.Ql)(t);(0,i.useEffect)(()=>{let n=new MutationObserver(s);return e&&n.observe(e,r),()=>n.disconnect()},[e,s,r])}(o,e=>{e.forEach(e=>{"attributes"===e.type&&"hidden"===e.attributeName&&(l(),a())})},{attributes:!0,characterData:!1,childList:!1,subtree:!1}),(0,i.useEffect)(()=>{l()},[e,l]),(0,i.useEffect)(()=>(window.addEventListener("resize",l,{passive:!0}),()=>{window.removeEventListener("resize",l)}),[l]),{codeBlockRef:r,isEnabled:e,isCodeScrollable:t,toggle:d}}();return(0,r.jsx)(w,{metadata:n,wordWrap:t,children:(0,r.jsx)(X,{})})}function K(e){let{children:n,...t}=e,s=(0,d.Z)(),l=i.Children.toArray(n).some(e=>(0,i.isValidElement)(e))?n:Array.isArray(n)?n.join(""):n;return(0,r.jsx)("string"==typeof l?Y:T,{...t,children:l},String(s))}var J=t(10075);let Q=e=>`${e};`;function ee(e){let{code:n,children:t,...s}=e,i=a(),d=s.metastring?.includes("noInline")??!1;return(0,r.jsx)(J.nu,{noInline:d,theme:i,...s,code:n?.replace(/\n$/,""),transformCode:s.transformCode??Q,children:t})}function en(e){let{children:n}=e;return(0,r.jsx)("div",{className:"playgroundContainer_TDLX",children:n})}var et=t(85108),es=t(67490);function er(e){let{children:n}=e;return(0,r.jsx)("div",{className:(0,l.Z)("playgroundHeader_h_Hu"),children:n})}function ei(){return(0,r.jsx)("div",{children:"Loading..."})}function ed(){return(0,r.jsx)(R.Z,{fallback:(0,r.jsx)(ei,{}),children:()=>(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(es.Z,{fallback:e=>(0,r.jsx)(et.Ac,{...e}),children:(0,r.jsx)(J.i5,{})}),(0,r.jsx)(J.IF,{})]})})}function el(){return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(er,{children:(0,r.jsx)(M.Z,{id:"theme.Playground.result",description:"The result label of the live codeblocks",children:"Result"})}),(0,r.jsx)("div",{className:"playgroundPreview_u2xE",children:(0,r.jsx)(ed,{})})]})}function eo(){let e=(0,d.Z)();return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(er,{children:(0,r.jsx)(M.Z,{id:"theme.Playground.liveEditor",description:"The live editor label of the live codeblocks",children:"Live Editor"})}),(0,r.jsx)(J.uz,{className:"playgroundEditor_uqZ4"},String(e))]})}function ec(){let{playgroundPosition:e}=(0,c.L)().liveCodeBlock;return(0,r.jsx)(r.Fragment,{children:"top"===e?(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(el,{}),(0,r.jsx)(eo,{})]}):(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(eo,{}),(0,r.jsx)(el,{})]})})}function ea(e){let{children:n,transformCode:t,...s}=e;return(0,r.jsx)(en,{children:(0,r.jsx)(ee,{code:n,...s,children:(0,r.jsx)(ec,{})})})}function eh(e){return(0,r.jsx)("button",{type:"button",...e,style:{backgroundColor:"white",color:"black",border:"solid red",borderRadius:20,padding:10,cursor:"pointer",...e.style}})}let eu={React:i,...i,...s};function ex(e){return(0,r.jsx)(ea,{scope:eu,...e})}function ej(e){return e.live?(0,r.jsx)(ex,{...e}):(0,r.jsx)(K,{...e})}function ep(e){return(0,r.jsx)(ej,{...e})}}}]); \ No newline at end of file diff --git a/assets/js/0b7c2a4a.6f602533.js b/assets/js/0b7c2a4a.7445b977.js similarity index 98% rename from assets/js/0b7c2a4a.6f602533.js rename to assets/js/0b7c2a4a.7445b977.js index aa4d01b7ee..e2260bdf8b 100644 --- a/assets/js/0b7c2a4a.6f602533.js +++ b/assets/js/0b7c2a4a.7445b977.js @@ -1 +1 @@ -"use strict";(self.webpackChunkwebsite=self.webpackChunkwebsite||[]).push([["27591"],{72581:function(e,n,s){s.d(n,{Z:()=>r});let r=s.p+"assets/images/social-card-3239a62bb56c9529ff255bc2c72e94f6.png"},20788:function(e,n,s){s.d(n,{Z:()=>r});let r=s.p+"assets/images/navbar-error-15eefab8e8d77aa4d605939956987164.jpg"},92539:function(e,n,s){s.d(n,{Z:()=>r});let r=s.p+"assets/images/sidebar-item-description-f38981b17f486bc09fb811c6992ef668.jpg"},17414:function(e,n,s){s.d(n,{Z:()=>r});let r=s.p+"assets/images/social-card-3239a62bb56c9529ff255bc2c72e94f6.png"},77543:function(e,n,s){s.r(n),s.d(n,{assets:()=>p,contentTitle:()=>h,default:()=>b,frontMatter:()=>d,metadata:()=>r,toc:()=>g});var r=s(68707),t=s(85893),a=s(80980),i=s(15398),l=s(58636),o=s(14522),c=s(51118),u=s(39468);let d={title:"Docusaurus 2.4",authors:["slorber"],tags:["release"],image:"./img/social-card.png",date:new Date("2023-03-23T00:00:00.000Z")},h=void 0,p={image:s(72581).Z,authorsImageUrls:[void 0]},g=[{value:"Highlights",id:"highlights",level:2},{value:"Sidebar item description",id:"sidebar-item-description",level:3},{value:"Theme Query String",id:"theme-query-string",level:3},{value:"Remark plugin npm2yarn upgrade",id:"remark-plugin-npm2yarn-upgrade",level:3},{value:"gtag support for multiple tracking IDs",id:"gtag-support-for-multiple-tracking-ids",level:3},{value:"Developer Experience",id:"developer-experience",level:3},{value:"Translations",id:"translations",level:3},{value:"Other changes",id:"other-changes",level:2}];function m(e){let n={a:"a",admonition:"admonition",code:"code",h2:"h2",h3:"h3",img:"img",li:"li",p:"p",pre:"pre",strong:"strong",ul:"ul",...(0,a.a)(),...e.components};return(0,t.jsxs)(t.Fragment,{children:[(0,t.jsxs)(n.p,{children:["We are happy to announce ",(0,t.jsx)(n.strong,{children:"Docusaurus 2.4"}),"."]}),"\n",(0,t.jsxs)(n.p,{children:["The upgrade should be easy: as explained in our ",(0,t.jsx)(n.a,{href:"/community/release-process",children:"release process documentation"}),", minor versions respect ",(0,t.jsx)(n.a,{href:"https://semver.org/",children:"Semantic Versioning"}),"."]}),"\n",(0,t.jsx)(n.p,{children:(0,t.jsx)(n.img,{alt:"Docusaurus blog post social card",src:s(17414).Z+"",width:"1200",height:"600"})}),"\n","\n",(0,t.jsx)(n.h2,{id:"highlights",children:"Highlights"}),"\n",(0,t.jsx)(n.h3,{id:"sidebar-item-description",children:"Sidebar item description"}),"\n",(0,t.jsxs)(n.p,{children:["In ",(0,t.jsx)(n.a,{href:"https://github.com/facebook/docusaurus/pull/8236",children:"#8236"}),", we made it possible to provide a new ",(0,t.jsx)(n.code,{children:"description"})," attribute for docs sidebar items of type ",(0,t.jsx)(n.code,{children:"link"})," and ",(0,t.jsx)(n.code,{children:"category"}),"."]}),"\n",(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-tsx",metastring:'title="sidebars.js"',children:"[\n {\n type: 'link',\n label: 'Link with description',\n href: 'https://docusaurus.io',\n // highlight-next-line\n description: 'Some link description',\n },\n {\n type: 'category',\n label: 'Category with description',\n // highlight-next-line\n description: 'Some category description',\n items: [],\n },\n];\n"})}),"\n",(0,t.jsx)(n.p,{children:"These descriptions will be used in category generated index pages."}),"\n",(0,t.jsx)(n.p,{children:(0,t.jsx)(n.img,{alt:"Show sidebar category generated index with custom descriptions",src:s(92539).Z+"",width:"1400",height:"691"})}),"\n",(0,t.jsx)(n.h3,{id:"theme-query-string",children:"Theme Query String"}),"\n",(0,t.jsxs)(n.p,{children:["In ",(0,t.jsx)(n.a,{href:"https://github.com/facebook/docusaurus/pull/8708",children:"#8708"}),", we added the possibility to force Docusaurus to initialize itself in ",(0,t.jsx)(n.code,{children:"light"})," or ",(0,t.jsx)(n.code,{children:"dark"})," mode through a new ",(0,t.jsx)(n.code,{children:"docusaurus-theme"})," query-string parameter."]}),"\n",(0,t.jsx)(n.p,{children:"This is useful to ensure a consistent theme when embedding an existing Docusaurus page into an iframe or WebView."}),"\n",(0,t.jsx)(c.Z,{url:"/docs/?docusaurus-theme=light"}),"\n",(0,t.jsx)(c.Z,{url:"/docs/?docusaurus-theme=dark"}),"\n",(0,t.jsx)(n.h3,{id:"remark-plugin-npm2yarn-upgrade",children:"Remark plugin npm2yarn upgrade"}),"\n",(0,t.jsxs)(n.p,{children:["In ",(0,t.jsx)(n.a,{href:"https://github.com/facebook/docusaurus/pull/8690",children:"#8690"}),", we upgraded our Remark plugin ",(0,t.jsx)(n.a,{href:"https://github.com/facebook/docusaurus/tree/main/packages/docusaurus-remark-plugin-npm2yarn",children:"@docusaurus/remark-plugin-npm2yarn"})," with many conversion bug fixes, first-class support for pnpm, and the ability to register custom converters producing new tabs."]}),"\n",(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-markdown",children:"Run these commands!\n\n```bash npm2yarn\nnpm install\nnpm run build\nnpm run myCustomScript -- --some-arg\n```\n"})}),"\n",(0,t.jsx)(o.Z,{children:(0,t.jsxs)(i.Z,{children:[(0,t.jsx)(l.Z,{value:"npm",children:(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-bash",children:"npm install\nnpm run build\nnpm run myCustomScript -- --some-arg\n"})})}),(0,t.jsx)(l.Z,{value:"yarn",label:"Yarn",children:(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-bash",children:"yarn install\nyarn build\nyarn myCustomScript --some-arg\n"})})}),(0,t.jsx)(l.Z,{value:"pnpm",label:"pnpm",children:(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-bash",children:"pnpm install\npnpm run build\npnpm run myCustomScript --some-arg\n"})})}),(0,t.jsx)(l.Z,{value:"bun",label:"Bun",children:(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-bash",children:"bun install\nbun run build\nbun run myCustomScript --some-arg\n"})})})]})}),"\n",(0,t.jsx)(n.h3,{id:"gtag-support-for-multiple-tracking-ids",children:"gtag support for multiple tracking IDs"}),"\n",(0,t.jsxs)(n.p,{children:["In ",(0,t.jsx)(n.a,{href:"https://github.com/facebook/docusaurus/pull/8620",children:"#8620"})," we added support for the ",(0,t.jsx)(n.a,{href:"/docs/api/plugins/@docusaurus/plugin-google-gtag",children:"@docusaurus/plugin-google-gtag"})," plugin to declare multiple tracking IDs."]}),"\n",(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-js",metastring:'title="docusaurus.config.js"',children:"module.exports = {\n presets: [\n [\n '@docusaurus/preset-classic',\n {\n gtag: {\n trackingID: [\n // highlight-next-line\n 'G- ',\n // highlight-next-line\n 'UA- ',\n ],\n },\n },\n ],\n ],\n};\n"})}),"\n",(0,t.jsxs)(n.admonition,{title:"Google is sunsetting Universal Analytics",type:"warning",children:[(0,t.jsxs)(n.p,{children:[(0,t.jsx)(n.strong,{children:(0,t.jsx)(n.a,{href:"https://blog.google/products/marketingplatform/analytics/prepare-for-future-with-google-analytics-4/",children:"Google will sunset its Universal Analytics"})})," on ",(0,t.jsx)(n.strong,{children:"July 1, 2023"}),"."]}),(0,t.jsxs)(n.p,{children:["Docusaurus users should migrate to Google Analytics 4. Google ",(0,t.jsx)(n.strong,{children:"does not permit to migrate your existing Universal Analytics data"})," to your new Google Analytics 4 property."]}),(0,t.jsxs)(n.p,{children:["To preserve the continuity of your analytics, we temporarily recommend that you report events to 2 tracking IDs at the same time: the old one (",(0,t.jsx)(n.code,{children:"UA-*"}),") and new one (",(0,t.jsx)(n.code,{children:"G-*"}),"). Refer to the ",(0,t.jsx)(n.strong,{children:(0,t.jsx)(n.a,{href:"https://github.com/facebook/docusaurus/issues/7221",children:"dedicated issue"})})," for details."]})]}),"\n",(0,t.jsx)(n.h3,{id:"developer-experience",children:"Developer Experience"}),"\n",(0,t.jsxs)(n.p,{children:["In ",(0,t.jsx)(n.a,{href:"https://github.com/facebook/docusaurus/pull/8736",children:"#8736"}),", we improved how we render error messages and added initial support to render the full causal chain of an error (see ",(0,t.jsx)(n.a,{href:"https://h3manth.com/ES2022/#error-cause",children:"ES2022 Error Cause"}),")."]}),"\n",(0,t.jsx)(n.admonition,{type:"tip",children:(0,t.jsxs)(n.p,{children:["To see it in action, click here: ",(0,t.jsx)(u.Z,{cause:"Probably undefined is not a function \uD83D\uDE04"})]})}),"\n",(0,t.jsxs)(n.p,{children:["In ",(0,t.jsx)(n.a,{href:"https://github.com/facebook/docusaurus/pull/8735",children:"#8735"})," we also made navbar-related error messages clearer to help users understand what they did wrong."]}),"\n",(0,t.jsx)(n.p,{children:(0,t.jsx)(n.img,{alt:"Docusaurus navbar error message screenshot",src:s(20788).Z+"",width:"1676",height:"1614"})}),"\n",(0,t.jsx)(n.h3,{id:"translations",children:"Translations"}),"\n",(0,t.jsx)(n.p,{children:"We made it possible to translate some new elements:"}),"\n",(0,t.jsxs)(n.ul,{children:["\n",(0,t.jsxs)(n.li,{children:[(0,t.jsx)(n.a,{href:"https://github.com/facebook/docusaurus/pull/8677",children:"#8677"})," introduces a new ",(0,t.jsx)(n.code,{children:"process.env.DOCUSAURUS_CURRENT_LOCALE"})," (experimental) allowing you to localize your config file, including site title, tagline, announcement bar, baseUrl..."]}),"\n",(0,t.jsxs)(n.li,{children:[(0,t.jsx)(n.a,{href:"https://github.com/facebook/docusaurus/pull/8616",children:"#8616"})," allows to translate the navbar and footer logo alt text"]}),"\n"]}),"\n",(0,t.jsx)(n.p,{children:"We added default theme translation support for multiple languages:"}),"\n",(0,t.jsxs)(n.ul,{children:["\n",(0,t.jsxs)(n.li,{children:["\uD83C\uDDED\uD83C\uDDFA ",(0,t.jsx)(n.a,{href:"https://github.com/facebook/docusaurus/pull/8668",children:"#8668"}),": Hungarian"]}),"\n",(0,t.jsxs)(n.li,{children:["\uD83C\uDDF3\uD83C\uDDF4 ",(0,t.jsx)(n.a,{href:"https://github.com/facebook/docusaurus/pull/8631",children:"#8631"}),": Norwegian (Bokm\xe5l)"]}),"\n"]}),"\n",(0,t.jsx)(n.admonition,{type:"tip",children:(0,t.jsxs)(n.p,{children:["Completing theme translations is an ",(0,t.jsx)(n.a,{href:"https://github.com/facebook/docusaurus/issues/3526",children:"ongoing effort"})," and an easy way to contribute to Docusaurus. We add new theme features regularly, for which we often ",(0,t.jsx)(n.a,{href:"https://github.com/facebook/docusaurus/issues/3526",children:"need new translations"}),"."]})}),"\n",(0,t.jsx)(n.h2,{id:"other-changes",children:"Other changes"}),"\n",(0,t.jsx)(n.p,{children:"Other notable changes include:"}),"\n",(0,t.jsxs)(n.ul,{children:["\n",(0,t.jsxs)(n.li,{children:[(0,t.jsx)(n.a,{href:"https://github.com/facebook/docusaurus/pull/8674",children:"#8674"}),": respect ",(0,t.jsx)(n.code,{children:"prefers-reduced-motion: reduce"})," media query"]}),"\n",(0,t.jsxs)(n.li,{children:[(0,t.jsx)(n.a,{href:"https://github.com/facebook/docusaurus/pull/8712",children:"#8712"}),": use a navbar item of type ",(0,t.jsx)(n.code,{children:"docSidebar"})," in template"]}),"\n",(0,t.jsxs)(n.li,{children:[(0,t.jsx)(n.a,{href:"https://github.com/facebook/docusaurus/pull/8801",children:"#8801"}),": allow tabs children to be falsy"]}),"\n",(0,t.jsxs)(n.li,{children:[(0,t.jsx)(n.a,{href:"https://github.com/facebook/docusaurus/pull/8757",children:"#8757"}),": make search page react to external query-string changes"]}),"\n",(0,t.jsxs)(n.li,{children:[(0,t.jsx)(n.a,{href:"https://github.com/facebook/docusaurus/pull/8803",children:"#8803"}),": fix code block buttons position in RTL"]}),"\n",(0,t.jsxs)(n.li,{children:[(0,t.jsx)(n.a,{href:"https://github.com/facebook/docusaurus/pull/8615",children:"#8615"}),": fix color mode toggle when using dark navbar"]}),"\n",(0,t.jsxs)(n.li,{children:[(0,t.jsx)(n.a,{href:"https://github.com/facebook/docusaurus/pull/8699",children:"#8699"}),": fix navbar dropdown tab focus bug"]}),"\n"]}),"\n",(0,t.jsxs)(n.p,{children:["Check the ",(0,t.jsx)(n.strong,{children:(0,t.jsx)(n.a,{href:"/changelog/2.4.0",children:"2.4.0 changelog entry"})})," for an exhaustive list of changes."]})]})}function b(e={}){let{wrapper:n}={...(0,a.a)(),...e.components};return n?(0,t.jsx)(n,{...e,children:(0,t.jsx)(m,{...e})}):m(e)}},58636:function(e,n,s){s.d(n,{Z:()=>a});var r=s(85893);s(67294);var t=s(90496);function a(e){let{children:n,hidden:s,className:a}=e;return(0,r.jsx)("div",{role:"tabpanel",className:(0,t.Z)("tabItem_pnkT",a),hidden:s,children:n})}},15398:function(e,n,s){s.d(n,{Z:()=>x});var r=s(85893),t=s(67294),a=s(90496),i=s(54947),l=s(3620),o=s(844),c=s(97486),u=s(32263),d=s(16971);function h(e){return t.Children.toArray(e).filter(e=>"\n"!==e).map(e=>{if(!e||(0,t.isValidElement)(e)&&function(e){let{props:n}=e;return!!n&&"object"==typeof n&&"value"in n}(e))return e;throw Error(`Docusaurus error: Bad child <${"string"==typeof e.type?e.type:e.type.name}>: all children of the component should be , and every should have a unique "value" prop.`)})?.filter(Boolean)??[]}function p(e){let{value:n,tabValues:s}=e;return s.some(e=>e.value===n)}var g=s(71607);function m(e){let{className:n,block:s,selectedValue:t,selectValue:l,tabValues:o}=e,c=[],{blockElementScrollPositionUntilNextRender:u}=(0,i.o5)(),d=e=>{let n=e.currentTarget,s=o[c.indexOf(n)].value;s!==t&&(u(n),l(s))},h=e=>{let n=null;switch(e.key){case"Enter":d(e);break;case"ArrowRight":{let s=c.indexOf(e.currentTarget)+1;n=c[s]??c[0];break}case"ArrowLeft":{let s=c.indexOf(e.currentTarget)-1;n=c[s]??c[c.length-1]}}n?.focus()};return(0,r.jsx)("ul",{role:"tablist","aria-orientation":"horizontal",className:(0,a.Z)("tabs",{"tabs--block":s},n),children:o.map(e=>{let{value:n,label:s,attributes:i}=e;return(0,r.jsx)("li",{role:"tab",tabIndex:t===n?0:-1,"aria-selected":t===n,ref:e=>{c.push(e)},onKeyDown:h,onClick:d,...i,className:(0,a.Z)("tabs__item","tabItem_AQgk",i?.className,{"tabs__item--active":t===n}),children:s??n},n)})})}function b(e){let{lazy:n,children:s,selectedValue:i}=e,l=(Array.isArray(s)?s:[s]).filter(Boolean);if(n){let e=l.find(e=>e.props.value===i);return e?(0,t.cloneElement)(e,{className:(0,a.Z)("margin-top--md",e.props.className)}):null}return(0,r.jsx)("div",{className:"margin-top--md",children:l.map((e,n)=>(0,t.cloneElement)(e,{key:n,hidden:e.props.value!==i}))})}function f(e){let n=function(e){let{defaultValue:n,queryString:s=!1,groupId:r}=e,a=function(e){let{values:n,children:s}=e;return(0,t.useMemo)(()=>{let e=n??h(s).map(e=>{let{props:{value:n,label:s,attributes:r,default:t}}=e;return{value:n,label:s,attributes:r,default:t}}),r=(0,u.lx)(e,(e,n)=>e.value===n.value);if(r.length>0)throw Error(`Docusaurus error: Duplicate values "${r.map(e=>e.value).join(", ")}" found in . Every value needs to be unique.`);return e},[n,s])}(e),[i,g]=(0,t.useState)(()=>(function(e){let{defaultValue:n,tabValues:s}=e;if(0===s.length)throw Error("Docusaurus error: the component requires at least one children component");if(n){if(!p({value:n,tabValues:s}))throw Error(`Docusaurus error: The has a defaultValue "${n}" but none of its children has the corresponding value. Available values are: ${s.map(e=>e.value).join(", ")}. If you intend to show no default tab, use defaultValue={null} instead.`);return n}let r=s.find(e=>e.default)??s[0];if(!r)throw Error("Unexpected error: 0 tabValues");return r.value})({defaultValue:n,tabValues:a})),[m,b]=function(e){let{queryString:n=!1,groupId:s}=e,r=(0,l.k6)(),a=function(e){let{queryString:n=!1,groupId:s}=e;if("string"==typeof n)return n;if(!1===n)return null;if(!0===n&&!s)throw Error('Docusaurus error: The component groupId prop is required if queryString=true, because this value is used as the search param name. You can also provide an explicit value such as queryString="my-search-param".');return s??null}({queryString:n,groupId:s});return[(0,c._X)(a),(0,t.useCallback)(e=>{if(!a)return;let n=new URLSearchParams(r.location.search);n.set(a,e),r.replace({...r.location,search:n.toString()})},[a,r])]}({queryString:s,groupId:r}),[f,x]=function(e){let{groupId:n}=e,s=n?`docusaurus.tab.${n}`:null,[r,a]=(0,d.Nk)(s);return[r,(0,t.useCallback)(e=>{s&&a.set(e)},[s,a])]}({groupId:r}),j=(()=>{let e=m??f;return p({value:e,tabValues:a})?e:null})();return(0,o.Z)(()=>{j&&g(j)},[j]),{selectedValue:i,selectValue:(0,t.useCallback)(e=>{if(!p({value:e,tabValues:a}))throw Error(`Can't select invalid tab value=${e}`);g(e),b(e),x(e)},[b,x,a]),tabValues:a}}(e);return(0,r.jsxs)("div",{className:(0,a.Z)("tabs-container","tabList_Qoir"),children:[(0,r.jsx)(m,{...n,...e}),(0,r.jsx)(b,{...n,...e})]})}function x(e){let n=(0,g.Z)();return(0,r.jsx)(f,{...e,children:h(e.children)},String(n))}},51118:function(e,n,s){s.d(n,{Z:()=>a});var r=s(85893);s(67294);var t=s(14522);function a(e){let{url:n}=e;return(0,r.jsx)("div",{style:{padding:10},children:(0,r.jsx)(t.Z,{url:n,style:{minWidth:"min(100%,45vw)",width:800,maxWidth:"100%",overflow:"hidden"},bodyStyle:{padding:0},children:(0,r.jsx)("iframe",{src:n,title:n,style:{display:"block",width:"100%",height:300}})})})}},14522:function(e,n,s){s.d(n,{Z:()=>l});var r=s(85893);s(67294);var t=s(90496);let a="dot_giz1",i="bar_rrRL";function l(e){let{children:n,minHeight:s,url:l="http://localhost:3000",style:o,bodyStyle:c}=e;return(0,r.jsxs)("div",{className:"browserWindow_my1Q",style:{...o,minHeight:s},children:[(0,r.jsxs)("div",{className:"browserWindowHeader_jXSR",children:[(0,r.jsxs)("div",{className:"buttons_uHc7",children:[(0,r.jsx)("span",{className:a,style:{background:"#f25f58"}}),(0,r.jsx)("span",{className:a,style:{background:"#fbbe3c"}}),(0,r.jsx)("span",{className:a,style:{background:"#58cb42"}})]}),(0,r.jsx)("div",{className:(0,t.Z)("browserWindowAddressBar_Pd8y","text--truncate"),children:l}),(0,r.jsx)("div",{className:"browserWindowMenuIcon_Vhuh",children:(0,r.jsxs)("div",{children:[(0,r.jsx)("span",{className:i}),(0,r.jsx)("span",{className:i}),(0,r.jsx)("span",{className:i})]})})]}),(0,r.jsx)("div",{className:"browserWindowBody_Idgs",style:c,children:n})]})}},39468:function(e,n,s){s.d(n,{Z:()=>a});var r=s(85893),t=s(67294);function a(e){let{children:n="Boom!",message:s="Boom!\nSomething bad happened, but you can try again!",cause:a}=e,[i,l]=(0,t.useState)(!1);if(i)throw Error(s,{cause:a?Error(a):void 0});return(0,r.jsx)("button",{className:"button button--danger",type:"button",onClick:()=>l(!0),children:n})}},80980:function(e,n,s){s.d(n,{Z:()=>l,a:()=>i});var r=s(67294);let t={},a=r.createContext(t);function i(e){let n=r.useContext(a);return r.useMemo(function(){return"function"==typeof e?e(n):{...n,...e}},[n,e])}function l(e){let n;return n=e.disableParentContext?"function"==typeof e.components?e.components(t):e.components||t:i(e.components),r.createElement(a.Provider,{value:n},e.children)}},68707:function(e){e.exports=JSON.parse('{"permalink":"/blog/releases/2.4","editUrl":"https://github.com/facebook/docusaurus/edit/main/website/blog/releases/2.4/index.mdx","source":"@site/blog/releases/2.4/index.mdx","title":"Docusaurus 2.4","description":"We are happy to announce Docusaurus 2.4.","date":"2023-03-23T00:00:00.000Z","tags":[{"inline":false,"label":"Release","permalink":"/blog/tags/release","description":"Blog posts about Docusaurus\' new releases"}],"readingTime":3.05,"hasTruncateMarker":true,"authors":[{"name":"S\xe9bastien Lorber","title":"Docusaurus maintainer, This Week In React editor","url":"https://thisweekinreact.com","page":{"permalink":"/blog/authors/slorber"},"description":"A freelance React and React-Native developer near Paris and Docusaurus maintainer. Also runs ThisWeekInReact.com, a newsletter to stay updated with the React ecosystem.","socials":{"bluesky":"https://bsky.app/profile/sebastienlorber.com","x":"https://x.com/sebastienlorber","linkedin":"https://www.linkedin.com/in/sebastienlorber/","github":"https://github.com/slorber","instagram":"https://www.instagram.com/thisweekinreact","newsletter":"https://thisweekinreact.com"},"imageURL":"https://github.com/slorber.png","key":"slorber"}],"frontMatter":{"title":"Docusaurus 2.4","authors":["slorber"],"tags":["release"],"image":"./img/social-card.png","date":"2023-03-23T00:00:00.000Z"},"unlisted":false,"lastUpdatedAt":1744155424000,"lastUpdatedBy":"Ben McCann","prevItem":{"title":"Upgrading frontend dependencies with confidence","permalink":"/blog/upgrading-frontend-dependencies-with-confidence-using-visual-regression-testing"},"nextItem":{"title":"Docusaurus 2.3","permalink":"/blog/releases/2.3"}}')}}]); \ No newline at end of file +"use strict";(self.webpackChunkwebsite=self.webpackChunkwebsite||[]).push([["27591"],{72581:function(e,n,s){s.d(n,{Z:()=>r});let r=s.p+"assets/images/social-card-3239a62bb56c9529ff255bc2c72e94f6.png"},20788:function(e,n,s){s.d(n,{Z:()=>r});let r=s.p+"assets/images/navbar-error-15eefab8e8d77aa4d605939956987164.jpg"},92539:function(e,n,s){s.d(n,{Z:()=>r});let r=s.p+"assets/images/sidebar-item-description-f38981b17f486bc09fb811c6992ef668.jpg"},17414:function(e,n,s){s.d(n,{Z:()=>r});let r=s.p+"assets/images/social-card-3239a62bb56c9529ff255bc2c72e94f6.png"},77543:function(e,n,s){s.r(n),s.d(n,{assets:()=>p,contentTitle:()=>h,default:()=>b,frontMatter:()=>d,metadata:()=>r,toc:()=>g});var r=s(68707),t=s(85893),a=s(80980),i=s(15398),l=s(58636),o=s(14522),c=s(51118),u=s(39468);let d={title:"Docusaurus 2.4",authors:["slorber"],tags:["release"],image:"./img/social-card.png",date:new Date("2023-03-23T00:00:00.000Z")},h=void 0,p={image:s(72581).Z,authorsImageUrls:[void 0]},g=[{value:"Highlights",id:"highlights",level:2},{value:"Sidebar item description",id:"sidebar-item-description",level:3},{value:"Theme Query String",id:"theme-query-string",level:3},{value:"Remark plugin npm2yarn upgrade",id:"remark-plugin-npm2yarn-upgrade",level:3},{value:"gtag support for multiple tracking IDs",id:"gtag-support-for-multiple-tracking-ids",level:3},{value:"Developer Experience",id:"developer-experience",level:3},{value:"Translations",id:"translations",level:3},{value:"Other changes",id:"other-changes",level:2}];function m(e){let n={a:"a",admonition:"admonition",code:"code",h2:"h2",h3:"h3",img:"img",li:"li",p:"p",pre:"pre",strong:"strong",ul:"ul",...(0,a.a)(),...e.components};return(0,t.jsxs)(t.Fragment,{children:[(0,t.jsxs)(n.p,{children:["We are happy to announce ",(0,t.jsx)(n.strong,{children:"Docusaurus 2.4"}),"."]}),"\n",(0,t.jsxs)(n.p,{children:["The upgrade should be easy: as explained in our ",(0,t.jsx)(n.a,{href:"/community/release-process",children:"release process documentation"}),", minor versions respect ",(0,t.jsx)(n.a,{href:"https://semver.org/",children:"Semantic Versioning"}),"."]}),"\n",(0,t.jsx)(n.p,{children:(0,t.jsx)(n.img,{alt:"Docusaurus blog post social card",src:s(17414).Z+"",width:"1200",height:"600"})}),"\n","\n",(0,t.jsx)(n.h2,{id:"highlights",children:"Highlights"}),"\n",(0,t.jsx)(n.h3,{id:"sidebar-item-description",children:"Sidebar item description"}),"\n",(0,t.jsxs)(n.p,{children:["In ",(0,t.jsx)(n.a,{href:"https://github.com/facebook/docusaurus/pull/8236",children:"#8236"}),", we made it possible to provide a new ",(0,t.jsx)(n.code,{children:"description"})," attribute for docs sidebar items of type ",(0,t.jsx)(n.code,{children:"link"})," and ",(0,t.jsx)(n.code,{children:"category"}),"."]}),"\n",(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-tsx",metastring:'title="sidebars.js"',children:"[\n {\n type: 'link',\n label: 'Link with description',\n href: 'https://docusaurus.io',\n // highlight-next-line\n description: 'Some link description',\n },\n {\n type: 'category',\n label: 'Category with description',\n // highlight-next-line\n description: 'Some category description',\n items: [],\n },\n];\n"})}),"\n",(0,t.jsx)(n.p,{children:"These descriptions will be used in category generated index pages."}),"\n",(0,t.jsx)(n.p,{children:(0,t.jsx)(n.img,{alt:"Show sidebar category generated index with custom descriptions",src:s(92539).Z+"",width:"1400",height:"691"})}),"\n",(0,t.jsx)(n.h3,{id:"theme-query-string",children:"Theme Query String"}),"\n",(0,t.jsxs)(n.p,{children:["In ",(0,t.jsx)(n.a,{href:"https://github.com/facebook/docusaurus/pull/8708",children:"#8708"}),", we added the possibility to force Docusaurus to initialize itself in ",(0,t.jsx)(n.code,{children:"light"})," or ",(0,t.jsx)(n.code,{children:"dark"})," mode through a new ",(0,t.jsx)(n.code,{children:"docusaurus-theme"})," query-string parameter."]}),"\n",(0,t.jsx)(n.p,{children:"This is useful to ensure a consistent theme when embedding an existing Docusaurus page into an iframe or WebView."}),"\n",(0,t.jsx)(c.Z,{url:"/docs/?docusaurus-theme=light"}),"\n",(0,t.jsx)(c.Z,{url:"/docs/?docusaurus-theme=dark"}),"\n",(0,t.jsx)(n.h3,{id:"remark-plugin-npm2yarn-upgrade",children:"Remark plugin npm2yarn upgrade"}),"\n",(0,t.jsxs)(n.p,{children:["In ",(0,t.jsx)(n.a,{href:"https://github.com/facebook/docusaurus/pull/8690",children:"#8690"}),", we upgraded our Remark plugin ",(0,t.jsx)(n.a,{href:"https://github.com/facebook/docusaurus/tree/main/packages/docusaurus-remark-plugin-npm2yarn",children:"@docusaurus/remark-plugin-npm2yarn"})," with many conversion bug fixes, first-class support for pnpm, and the ability to register custom converters producing new tabs."]}),"\n",(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-markdown",children:"Run these commands!\n\n```bash npm2yarn\nnpm install\nnpm run build\nnpm run myCustomScript -- --some-arg\n```\n"})}),"\n",(0,t.jsx)(o.Z,{children:(0,t.jsxs)(i.Z,{children:[(0,t.jsx)(l.Z,{value:"npm",children:(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-bash",children:"npm install\nnpm run build\nnpm run myCustomScript -- --some-arg\n"})})}),(0,t.jsx)(l.Z,{value:"yarn",label:"Yarn",children:(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-bash",children:"yarn install\nyarn build\nyarn myCustomScript --some-arg\n"})})}),(0,t.jsx)(l.Z,{value:"pnpm",label:"pnpm",children:(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-bash",children:"pnpm install\npnpm run build\npnpm run myCustomScript --some-arg\n"})})}),(0,t.jsx)(l.Z,{value:"bun",label:"Bun",children:(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-bash",children:"bun install\nbun run build\nbun run myCustomScript --some-arg\n"})})})]})}),"\n",(0,t.jsx)(n.h3,{id:"gtag-support-for-multiple-tracking-ids",children:"gtag support for multiple tracking IDs"}),"\n",(0,t.jsxs)(n.p,{children:["In ",(0,t.jsx)(n.a,{href:"https://github.com/facebook/docusaurus/pull/8620",children:"#8620"})," we added support for the ",(0,t.jsx)(n.a,{href:"/docs/api/plugins/@docusaurus/plugin-google-gtag",children:"@docusaurus/plugin-google-gtag"})," plugin to declare multiple tracking IDs."]}),"\n",(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-js",metastring:'title="docusaurus.config.js"',children:"module.exports = {\n presets: [\n [\n '@docusaurus/preset-classic',\n {\n gtag: {\n trackingID: [\n // highlight-next-line\n 'G- ',\n // highlight-next-line\n 'UA- ',\n ],\n },\n },\n ],\n ],\n};\n"})}),"\n",(0,t.jsxs)(n.admonition,{title:"Google is sunsetting Universal Analytics",type:"warning",children:[(0,t.jsxs)(n.p,{children:[(0,t.jsx)(n.strong,{children:(0,t.jsx)(n.a,{href:"https://blog.google/products/marketingplatform/analytics/prepare-for-future-with-google-analytics-4/",children:"Google will sunset its Universal Analytics"})})," on ",(0,t.jsx)(n.strong,{children:"July 1, 2023"}),"."]}),(0,t.jsxs)(n.p,{children:["Docusaurus users should migrate to Google Analytics 4. Google ",(0,t.jsx)(n.strong,{children:"does not permit to migrate your existing Universal Analytics data"})," to your new Google Analytics 4 property."]}),(0,t.jsxs)(n.p,{children:["To preserve the continuity of your analytics, we temporarily recommend that you report events to 2 tracking IDs at the same time: the old one (",(0,t.jsx)(n.code,{children:"UA-*"}),") and new one (",(0,t.jsx)(n.code,{children:"G-*"}),"). Refer to the ",(0,t.jsx)(n.strong,{children:(0,t.jsx)(n.a,{href:"https://github.com/facebook/docusaurus/issues/7221",children:"dedicated issue"})})," for details."]})]}),"\n",(0,t.jsx)(n.h3,{id:"developer-experience",children:"Developer Experience"}),"\n",(0,t.jsxs)(n.p,{children:["In ",(0,t.jsx)(n.a,{href:"https://github.com/facebook/docusaurus/pull/8736",children:"#8736"}),", we improved how we render error messages and added initial support to render the full causal chain of an error (see ",(0,t.jsx)(n.a,{href:"https://h3manth.com/ES2022/#error-cause",children:"ES2022 Error Cause"}),")."]}),"\n",(0,t.jsx)(n.admonition,{type:"tip",children:(0,t.jsxs)(n.p,{children:["To see it in action, click here: ",(0,t.jsx)(u.Z,{cause:"Probably undefined is not a function \uD83D\uDE04"})]})}),"\n",(0,t.jsxs)(n.p,{children:["In ",(0,t.jsx)(n.a,{href:"https://github.com/facebook/docusaurus/pull/8735",children:"#8735"})," we also made navbar-related error messages clearer to help users understand what they did wrong."]}),"\n",(0,t.jsx)(n.p,{children:(0,t.jsx)(n.img,{alt:"Docusaurus navbar error message screenshot",src:s(20788).Z+"",width:"1676",height:"1614"})}),"\n",(0,t.jsx)(n.h3,{id:"translations",children:"Translations"}),"\n",(0,t.jsx)(n.p,{children:"We made it possible to translate some new elements:"}),"\n",(0,t.jsxs)(n.ul,{children:["\n",(0,t.jsxs)(n.li,{children:[(0,t.jsx)(n.a,{href:"https://github.com/facebook/docusaurus/pull/8677",children:"#8677"})," introduces a new ",(0,t.jsx)(n.code,{children:"process.env.DOCUSAURUS_CURRENT_LOCALE"})," (experimental) allowing you to localize your config file, including site title, tagline, announcement bar, baseUrl..."]}),"\n",(0,t.jsxs)(n.li,{children:[(0,t.jsx)(n.a,{href:"https://github.com/facebook/docusaurus/pull/8616",children:"#8616"})," allows to translate the navbar and footer logo alt text"]}),"\n"]}),"\n",(0,t.jsx)(n.p,{children:"We added default theme translation support for multiple languages:"}),"\n",(0,t.jsxs)(n.ul,{children:["\n",(0,t.jsxs)(n.li,{children:["\uD83C\uDDED\uD83C\uDDFA ",(0,t.jsx)(n.a,{href:"https://github.com/facebook/docusaurus/pull/8668",children:"#8668"}),": Hungarian"]}),"\n",(0,t.jsxs)(n.li,{children:["\uD83C\uDDF3\uD83C\uDDF4 ",(0,t.jsx)(n.a,{href:"https://github.com/facebook/docusaurus/pull/8631",children:"#8631"}),": Norwegian (Bokm\xe5l)"]}),"\n"]}),"\n",(0,t.jsx)(n.admonition,{type:"tip",children:(0,t.jsxs)(n.p,{children:["Completing theme translations is an ",(0,t.jsx)(n.a,{href:"https://github.com/facebook/docusaurus/issues/3526",children:"ongoing effort"})," and an easy way to contribute to Docusaurus. We add new theme features regularly, for which we often ",(0,t.jsx)(n.a,{href:"https://github.com/facebook/docusaurus/issues/3526",children:"need new translations"}),"."]})}),"\n",(0,t.jsx)(n.h2,{id:"other-changes",children:"Other changes"}),"\n",(0,t.jsx)(n.p,{children:"Other notable changes include:"}),"\n",(0,t.jsxs)(n.ul,{children:["\n",(0,t.jsxs)(n.li,{children:[(0,t.jsx)(n.a,{href:"https://github.com/facebook/docusaurus/pull/8674",children:"#8674"}),": respect ",(0,t.jsx)(n.code,{children:"prefers-reduced-motion: reduce"})," media query"]}),"\n",(0,t.jsxs)(n.li,{children:[(0,t.jsx)(n.a,{href:"https://github.com/facebook/docusaurus/pull/8712",children:"#8712"}),": use a navbar item of type ",(0,t.jsx)(n.code,{children:"docSidebar"})," in template"]}),"\n",(0,t.jsxs)(n.li,{children:[(0,t.jsx)(n.a,{href:"https://github.com/facebook/docusaurus/pull/8801",children:"#8801"}),": allow tabs children to be falsy"]}),"\n",(0,t.jsxs)(n.li,{children:[(0,t.jsx)(n.a,{href:"https://github.com/facebook/docusaurus/pull/8757",children:"#8757"}),": make search page react to external query-string changes"]}),"\n",(0,t.jsxs)(n.li,{children:[(0,t.jsx)(n.a,{href:"https://github.com/facebook/docusaurus/pull/8803",children:"#8803"}),": fix code block buttons position in RTL"]}),"\n",(0,t.jsxs)(n.li,{children:[(0,t.jsx)(n.a,{href:"https://github.com/facebook/docusaurus/pull/8615",children:"#8615"}),": fix color mode toggle when using dark navbar"]}),"\n",(0,t.jsxs)(n.li,{children:[(0,t.jsx)(n.a,{href:"https://github.com/facebook/docusaurus/pull/8699",children:"#8699"}),": fix navbar dropdown tab focus bug"]}),"\n"]}),"\n",(0,t.jsxs)(n.p,{children:["Check the ",(0,t.jsx)(n.strong,{children:(0,t.jsx)(n.a,{href:"/changelog/2.4.0",children:"2.4.0 changelog entry"})})," for an exhaustive list of changes."]})]})}function b(e={}){let{wrapper:n}={...(0,a.a)(),...e.components};return n?(0,t.jsx)(n,{...e,children:(0,t.jsx)(m,{...e})}):m(e)}},58636:function(e,n,s){s.d(n,{Z:()=>a});var r=s(85893);s(67294);var t=s(90496);function a(e){let{children:n,hidden:s,className:a}=e;return(0,r.jsx)("div",{role:"tabpanel",className:(0,t.Z)("tabItem_pnkT",a),hidden:s,children:n})}},15398:function(e,n,s){s.d(n,{Z:()=>x});var r=s(85893),t=s(67294),a=s(90496),i=s(54947),l=s(3620),o=s(844),c=s(97486),u=s(32263),d=s(16971);function h(e){return t.Children.toArray(e).filter(e=>"\n"!==e).map(e=>{if(!e||(0,t.isValidElement)(e)&&function(e){let{props:n}=e;return!!n&&"object"==typeof n&&"value"in n}(e))return e;throw Error(`Docusaurus error: Bad child <${"string"==typeof e.type?e.type:e.type.name}>: all children of the component should be , and every should have a unique "value" prop.`)})?.filter(Boolean)??[]}function p(e){let{value:n,tabValues:s}=e;return s.some(e=>e.value===n)}var g=s(71607);function m(e){let{className:n,block:s,selectedValue:t,selectValue:l,tabValues:o}=e,c=[],{blockElementScrollPositionUntilNextRender:u}=(0,i.o5)(),d=e=>{let n=e.currentTarget,s=o[c.indexOf(n)].value;s!==t&&(u(n),l(s))},h=e=>{let n=null;switch(e.key){case"Enter":d(e);break;case"ArrowRight":{let s=c.indexOf(e.currentTarget)+1;n=c[s]??c[0];break}case"ArrowLeft":{let s=c.indexOf(e.currentTarget)-1;n=c[s]??c[c.length-1]}}n?.focus()};return(0,r.jsx)("ul",{role:"tablist","aria-orientation":"horizontal",className:(0,a.Z)("tabs",{"tabs--block":s},n),children:o.map(e=>{let{value:n,label:s,attributes:i}=e;return(0,r.jsx)("li",{role:"tab",tabIndex:t===n?0:-1,"aria-selected":t===n,ref:e=>{c.push(e)},onKeyDown:h,onClick:d,...i,className:(0,a.Z)("tabs__item","tabItem_AQgk",i?.className,{"tabs__item--active":t===n}),children:s??n},n)})})}function b(e){let{lazy:n,children:s,selectedValue:i}=e,l=(Array.isArray(s)?s:[s]).filter(Boolean);if(n){let e=l.find(e=>e.props.value===i);return e?(0,t.cloneElement)(e,{className:(0,a.Z)("margin-top--md",e.props.className)}):null}return(0,r.jsx)("div",{className:"margin-top--md",children:l.map((e,n)=>(0,t.cloneElement)(e,{key:n,hidden:e.props.value!==i}))})}function f(e){let n=function(e){let{defaultValue:n,queryString:s=!1,groupId:r}=e,a=function(e){let{values:n,children:s}=e;return(0,t.useMemo)(()=>{let e=n??h(s).map(e=>{let{props:{value:n,label:s,attributes:r,default:t}}=e;return{value:n,label:s,attributes:r,default:t}}),r=(0,u.lx)(e,(e,n)=>e.value===n.value);if(r.length>0)throw Error(`Docusaurus error: Duplicate values "${r.map(e=>e.value).join(", ")}" found in . Every value needs to be unique.`);return e},[n,s])}(e),[i,g]=(0,t.useState)(()=>(function(e){let{defaultValue:n,tabValues:s}=e;if(0===s.length)throw Error("Docusaurus error: the component requires at least one children component");if(n){if(!p({value:n,tabValues:s}))throw Error(`Docusaurus error: The has a defaultValue "${n}" but none of its children has the corresponding value. Available values are: ${s.map(e=>e.value).join(", ")}. If you intend to show no default tab, use defaultValue={null} instead.`);return n}let r=s.find(e=>e.default)??s[0];if(!r)throw Error("Unexpected error: 0 tabValues");return r.value})({defaultValue:n,tabValues:a})),[m,b]=function(e){let{queryString:n=!1,groupId:s}=e,r=(0,l.k6)(),a=function(e){let{queryString:n=!1,groupId:s}=e;if("string"==typeof n)return n;if(!1===n)return null;if(!0===n&&!s)throw Error('Docusaurus error: The component groupId prop is required if queryString=true, because this value is used as the search param name. You can also provide an explicit value such as queryString="my-search-param".');return s??null}({queryString:n,groupId:s});return[(0,c._X)(a),(0,t.useCallback)(e=>{if(!a)return;let n=new URLSearchParams(r.location.search);n.set(a,e),r.replace({...r.location,search:n.toString()})},[a,r])]}({queryString:s,groupId:r}),[f,x]=function(e){let{groupId:n}=e,s=n?`docusaurus.tab.${n}`:null,[r,a]=(0,d.Nk)(s);return[r,(0,t.useCallback)(e=>{s&&a.set(e)},[s,a])]}({groupId:r}),j=(()=>{let e=m??f;return p({value:e,tabValues:a})?e:null})();return(0,o.Z)(()=>{j&&g(j)},[j]),{selectedValue:i,selectValue:(0,t.useCallback)(e=>{if(!p({value:e,tabValues:a}))throw Error(`Can't select invalid tab value=${e}`);g(e),b(e),x(e)},[b,x,a]),tabValues:a}}(e);return(0,r.jsxs)("div",{className:(0,a.Z)("tabs-container","tabList_Qoir"),children:[(0,r.jsx)(m,{...n,...e}),(0,r.jsx)(b,{...n,...e})]})}function x(e){let n=(0,g.Z)();return(0,r.jsx)(f,{...e,children:h(e.children)},String(n))}},51118:function(e,n,s){s.d(n,{Z:()=>a});var r=s(85893);s(67294);var t=s(14522);function a(e){let{url:n}=e;return(0,r.jsx)("div",{style:{padding:10},children:(0,r.jsx)(t.Z,{url:n,style:{minWidth:"min(100%,45vw)",width:800,maxWidth:"100%",overflow:"hidden"},bodyStyle:{padding:0},children:(0,r.jsx)("iframe",{src:n,title:n,style:{display:"block",width:"100%",height:300}})})})}},14522:function(e,n,s){s.d(n,{Z:()=>l});var r=s(85893);s(67294);var t=s(90496);let a="dot_giz1",i="bar_rrRL";function l(e){let{children:n,minHeight:s,url:l="http://localhost:3000",style:o,bodyStyle:c}=e;return(0,r.jsxs)("div",{className:"browserWindow_my1Q",style:{...o,minHeight:s},children:[(0,r.jsxs)("div",{className:"browserWindowHeader_jXSR",children:[(0,r.jsxs)("div",{className:"buttons_uHc7",children:[(0,r.jsx)("span",{className:a,style:{background:"#f25f58"}}),(0,r.jsx)("span",{className:a,style:{background:"#fbbe3c"}}),(0,r.jsx)("span",{className:a,style:{background:"#58cb42"}})]}),(0,r.jsx)("div",{className:(0,t.Z)("browserWindowAddressBar_Pd8y","text--truncate"),children:l}),(0,r.jsx)("div",{className:"browserWindowMenuIcon_Vhuh",children:(0,r.jsxs)("div",{children:[(0,r.jsx)("span",{className:i}),(0,r.jsx)("span",{className:i}),(0,r.jsx)("span",{className:i})]})})]}),(0,r.jsx)("div",{className:"browserWindowBody_Idgs",style:c,children:n})]})}},39468:function(e,n,s){s.d(n,{Z:()=>a});var r=s(85893),t=s(67294);function a(e){let{children:n="Boom!",message:s="Boom!\nSomething bad happened, but you can try again!",cause:a}=e,[i,l]=(0,t.useState)(!1);if(i)throw Error(s,{cause:a?Error(a):void 0});return(0,r.jsx)("button",{className:"button button--danger",type:"button",onClick:()=>l(!0),children:n})}},80980:function(e,n,s){s.d(n,{Z:()=>l,a:()=>i});var r=s(67294);let t={},a=r.createContext(t);function i(e){let n=r.useContext(a);return r.useMemo(function(){return"function"==typeof e?e(n):{...n,...e}},[n,e])}function l(e){let n;return n=e.disableParentContext?"function"==typeof e.components?e.components(t):e.components||t:i(e.components),r.createElement(a.Provider,{value:n},e.children)}},68707:function(e){e.exports=JSON.parse('{"permalink":"/blog/releases/2.4","editUrl":"https://github.com/facebook/docusaurus/edit/main/website/blog/releases/2.4/index.mdx","source":"@site/blog/releases/2.4/index.mdx","title":"Docusaurus 2.4","description":"We are happy to announce Docusaurus 2.4.","date":"2023-03-23T00:00:00.000Z","tags":[{"inline":false,"label":"Release","permalink":"/blog/tags/release","description":"Blog posts about Docusaurus\' new releases"}],"readingTime":3.05,"hasTruncateMarker":true,"authors":[{"name":"S\xe9bastien Lorber","title":"Docusaurus maintainer, This Week In React editor","url":"https://thisweekinreact.com","page":{"permalink":"/blog/authors/slorber"},"description":"A freelance React and React-Native developer near Paris and Docusaurus maintainer. Also runs ThisWeekInReact.com, a newsletter to stay updated with the React ecosystem.","socials":{"bluesky":"https://bsky.app/profile/sebastienlorber.com","x":"https://x.com/sebastienlorber","linkedin":"https://www.linkedin.com/in/sebastienlorber/","github":"https://github.com/slorber","instagram":"https://www.instagram.com/thisweekinreact","newsletter":"https://thisweekinreact.com"},"imageURL":"https://github.com/slorber.png","key":"slorber"}],"frontMatter":{"title":"Docusaurus 2.4","authors":["slorber"],"tags":["release"],"image":"./img/social-card.png","date":"2023-03-23T00:00:00.000Z"},"unlisted":false,"lastUpdatedAt":1744293302000,"lastUpdatedBy":"S\xe9bastien Lorber","prevItem":{"title":"Upgrading frontend dependencies with confidence","permalink":"/blog/upgrading-frontend-dependencies-with-confidence-using-visual-regression-testing"},"nextItem":{"title":"Docusaurus 2.3","permalink":"/blog/releases/2.3"}}')}}]); \ No newline at end of file diff --git a/assets/js/0bc851e0.896cdcd3.js b/assets/js/0bc851e0.405d3e8b.js similarity index 66% rename from assets/js/0bc851e0.896cdcd3.js rename to assets/js/0bc851e0.405d3e8b.js index f6821d4e38..d2a210c02c 100644 --- a/assets/js/0bc851e0.896cdcd3.js +++ b/assets/js/0bc851e0.405d3e8b.js @@ -1 +1 @@ -"use strict";(self.webpackChunkwebsite=self.webpackChunkwebsite||[]).push([["55900"],{23141:function(e,s,t){t.d(s,{Z:()=>r});let r=t.p+"assets/images/social-card-8dc2413b4f9e86328bf77575e91171d7.png"},56594:function(e,s,t){t.d(s,{Z:()=>r});let r=t.p+"assets/images/social-card-8dc2413b4f9e86328bf77575e91171d7.png"},71694:function(e,s,t){t.r(s),t.d(s,{assets:()=>u,contentTitle:()=>i,default:()=>p,frontMatter:()=>o,metadata:()=>r,toc:()=>c});var r=t(46689),n=t(85893),a=t(80980);let o={title:"Docusaurus 2.1",authors:["slorber"],tags:["release"],image:"./img/social-card.png"},i=void 0,u={image:t(23141).Z,authorsImageUrls:[void 0]},c=[];function l(e){let s={a:"a",img:"img",p:"p",strong:"strong",...(0,a.a)(),...e.components};return(0,n.jsxs)(n.Fragment,{children:[(0,n.jsxs)(s.p,{children:["We are happy to announce ",(0,n.jsx)(s.strong,{children:"Docusaurus 2.1"}),", our very first minor version release."]}),"\n",(0,n.jsxs)(s.p,{children:["The upgrade should be easy: as explained in our ",(0,n.jsx)(s.a,{href:"/community/release-process",children:"release process documentation"}),", minor versions respect ",(0,n.jsx)(s.a,{href:"https://semver.org/",children:"Semantic Versioning"}),"."]}),"\n",(0,n.jsx)(s.p,{children:(0,n.jsx)(s.img,{alt:"Docusaurus 2.1 social card",src:t(56594).Z+"",width:"1200",height:"600"})})]})}function p(e={}){let{wrapper:s}={...(0,a.a)(),...e.components};return s?(0,n.jsx)(s,{...e,children:(0,n.jsx)(l,{...e})}):l(e)}},80980:function(e,s,t){t.d(s,{Z:()=>i,a:()=>o});var r=t(67294);let n={},a=r.createContext(n);function o(e){let s=r.useContext(a);return r.useMemo(function(){return"function"==typeof e?e(s):{...s,...e}},[s,e])}function i(e){let s;return s=e.disableParentContext?"function"==typeof e.components?e.components(n):e.components||n:o(e.components),r.createElement(a.Provider,{value:s},e.children)}},46689:function(e){e.exports=JSON.parse('{"permalink":"/blog/2022/09/01/docusaurus-2.1","editUrl":"https://github.com/facebook/docusaurus/edit/main/website/blog/2022/09-01-docusaurus-2.1/index.mdx","source":"@site/blog/2022/09-01-docusaurus-2.1/index.mdx","title":"Docusaurus 2.1","description":"We are happy to announce Docusaurus 2.1, our very first minor version release.","date":"2022-09-01T00:00:00.000Z","tags":[{"inline":false,"label":"Release","permalink":"/blog/tags/release","description":"Blog posts about Docusaurus\' new releases"}],"readingTime":1.725,"hasTruncateMarker":true,"authors":[{"name":"S\xe9bastien Lorber","title":"Docusaurus maintainer, This Week In React editor","url":"https://thisweekinreact.com","page":{"permalink":"/blog/authors/slorber"},"description":"A freelance React and React-Native developer near Paris and Docusaurus maintainer. Also runs ThisWeekInReact.com, a newsletter to stay updated with the React ecosystem.","socials":{"bluesky":"https://bsky.app/profile/sebastienlorber.com","x":"https://x.com/sebastienlorber","linkedin":"https://www.linkedin.com/in/sebastienlorber/","github":"https://github.com/slorber","instagram":"https://www.instagram.com/thisweekinreact","newsletter":"https://thisweekinreact.com"},"imageURL":"https://github.com/slorber.png","key":"slorber"}],"frontMatter":{"title":"Docusaurus 2.1","authors":["slorber"],"tags":["release"],"image":"./img/social-card.png"},"unlisted":false,"lastUpdatedAt":1744155424000,"lastUpdatedBy":"Ben McCann","prevItem":{"title":"Docusaurus 2.2","permalink":"/blog/releases/2.2"},"nextItem":{"title":"Announcing Docusaurus 2.0","permalink":"/blog/2022/08/01/announcing-docusaurus-2.0"}}')}}]); \ No newline at end of file +"use strict";(self.webpackChunkwebsite=self.webpackChunkwebsite||[]).push([["55900"],{23141:function(e,s,t){t.d(s,{Z:()=>r});let r=t.p+"assets/images/social-card-8dc2413b4f9e86328bf77575e91171d7.png"},56594:function(e,s,t){t.d(s,{Z:()=>r});let r=t.p+"assets/images/social-card-8dc2413b4f9e86328bf77575e91171d7.png"},71694:function(e,s,t){t.r(s),t.d(s,{assets:()=>u,contentTitle:()=>i,default:()=>p,frontMatter:()=>o,metadata:()=>r,toc:()=>c});var r=t(46689),a=t(85893),n=t(80980);let o={title:"Docusaurus 2.1",authors:["slorber"],tags:["release"],image:"./img/social-card.png"},i=void 0,u={image:t(23141).Z,authorsImageUrls:[void 0]},c=[];function l(e){let s={a:"a",img:"img",p:"p",strong:"strong",...(0,n.a)(),...e.components};return(0,a.jsxs)(a.Fragment,{children:[(0,a.jsxs)(s.p,{children:["We are happy to announce ",(0,a.jsx)(s.strong,{children:"Docusaurus 2.1"}),", our very first minor version release."]}),"\n",(0,a.jsxs)(s.p,{children:["The upgrade should be easy: as explained in our ",(0,a.jsx)(s.a,{href:"/community/release-process",children:"release process documentation"}),", minor versions respect ",(0,a.jsx)(s.a,{href:"https://semver.org/",children:"Semantic Versioning"}),"."]}),"\n",(0,a.jsx)(s.p,{children:(0,a.jsx)(s.img,{alt:"Docusaurus 2.1 social card",src:t(56594).Z+"",width:"1200",height:"600"})})]})}function p(e={}){let{wrapper:s}={...(0,n.a)(),...e.components};return s?(0,a.jsx)(s,{...e,children:(0,a.jsx)(l,{...e})}):l(e)}},80980:function(e,s,t){t.d(s,{Z:()=>i,a:()=>o});var r=t(67294);let a={},n=r.createContext(a);function o(e){let s=r.useContext(n);return r.useMemo(function(){return"function"==typeof e?e(s):{...s,...e}},[s,e])}function i(e){let s;return s=e.disableParentContext?"function"==typeof e.components?e.components(a):e.components||a:o(e.components),r.createElement(n.Provider,{value:s},e.children)}},46689:function(e){e.exports=JSON.parse('{"permalink":"/blog/2022/09/01/docusaurus-2.1","editUrl":"https://github.com/facebook/docusaurus/edit/main/website/blog/2022/09-01-docusaurus-2.1/index.mdx","source":"@site/blog/2022/09-01-docusaurus-2.1/index.mdx","title":"Docusaurus 2.1","description":"We are happy to announce Docusaurus 2.1, our very first minor version release.","date":"2022-09-01T00:00:00.000Z","tags":[{"inline":false,"label":"Release","permalink":"/blog/tags/release","description":"Blog posts about Docusaurus\' new releases"}],"readingTime":1.725,"hasTruncateMarker":true,"authors":[{"name":"S\xe9bastien Lorber","title":"Docusaurus maintainer, This Week In React editor","url":"https://thisweekinreact.com","page":{"permalink":"/blog/authors/slorber"},"description":"A freelance React and React-Native developer near Paris and Docusaurus maintainer. Also runs ThisWeekInReact.com, a newsletter to stay updated with the React ecosystem.","socials":{"bluesky":"https://bsky.app/profile/sebastienlorber.com","x":"https://x.com/sebastienlorber","linkedin":"https://www.linkedin.com/in/sebastienlorber/","github":"https://github.com/slorber","instagram":"https://www.instagram.com/thisweekinreact","newsletter":"https://thisweekinreact.com"},"imageURL":"https://github.com/slorber.png","key":"slorber"}],"frontMatter":{"title":"Docusaurus 2.1","authors":["slorber"],"tags":["release"],"image":"./img/social-card.png"},"unlisted":false,"lastUpdatedAt":1744293302000,"lastUpdatedBy":"S\xe9bastien Lorber","prevItem":{"title":"Docusaurus 2.2","permalink":"/blog/releases/2.2"},"nextItem":{"title":"Announcing Docusaurus 2.0","permalink":"/blog/2022/08/01/announcing-docusaurus-2.0"}}')}}]); \ No newline at end of file diff --git a/assets/js/0c7845dd.d03a5397.js b/assets/js/0c7845dd.d03a5397.js deleted file mode 100644 index 187f00130a..0000000000 --- a/assets/js/0c7845dd.d03a5397.js +++ /dev/null @@ -1 +0,0 @@ -"use strict";(self.webpackChunkwebsite=self.webpackChunkwebsite||[]).push([["64840"],{86251:function(e,s,t){t.r(s),t.d(s,{frontMatter:()=>l,default:()=>x,contentTitle:()=>d,assets:()=>u,toc:()=>r,metadata:()=>n});var n=JSON.parse('{"id":"toc/toc-_-5","title":"toc-_-5","description":"","source":"@site/_dogfooding/_docs tests/toc/toc-_-5.mdx","sourceDirName":"toc","slug":"/toc/toc-_-5","permalink":"/tests/docs/toc/toc-_-5","draft":false,"unlisted":false,"tags":[],"version":"current","lastUpdatedBy":"Ben McCann","lastUpdatedAt":1744155424000,"frontMatter":{"toc_max_heading_level":5},"sidebar":"sidebar","previous":{"title":"toc-5-5","permalink":"/tests/docs/toc/toc-5-5"},"next":{"title":"toc-_-_","permalink":"/tests/docs/toc/toc-_-_"}}'),i=t(85893),c=t(80980),o=t(2630);let l={toc_max_heading_level:5},d=void 0,u={},r=[...o.d$];function h(e){return(0,i.jsx)(o.ZP,{})}function x(e={}){let{wrapper:s}={...(0,c.a)(),...e.components};return s?(0,i.jsx)(s,{...e,children:(0,i.jsx)(h,{...e})}):h(e)}x.displayName="MDXContent(_dogfooding/_docs tests/toc/toc-_-5.mdx)"},2630:function(e,s,t){t.d(s,{ZP:()=>l,d$:()=>c});var n=t(85893),i=t(80980);let c=[{value:"section 1",id:"section-1",level:2},{value:"subsection 1-1",id:"subsection-1-1",level:3},{value:"subsection 1-1-1",id:"subsection-1-1-1",level:4},{value:"subsection 1-1-1-1",id:"subsection-1-1-1-1",level:5},{value:"subsection 1-1-1-1-1",id:"subsection-1-1-1-1-1",level:6},{value:"subsection 1-1-1-1-2",id:"subsection-1-1-1-1-2",level:6},{value:"subsection 1-1-1-2",id:"subsection-1-1-1-2",level:5},{value:"subsection 1-1-2",id:"subsection-1-1-2",level:4},{value:"subsection 1-2",id:"subsection-1-2",level:3},{value:"subsection 1-3",id:"subsection-1-3",level:3},{value:"section 2",id:"section-2",level:2},{value:"subsection 2-1",id:"subsection-2-1",level:3},{value:"subsection 2-1",id:"subsection-2-1-1",level:3},{value:"section 3",id:"section-3",level:2},{value:"subsection 3-1",id:"subsection-3-1",level:3},{value:"subsection 3-2",id:"subsection-3-2",level:3}];function o(e){let s={h1:"h1",h2:"h2",h3:"h3",h4:"h4",h5:"h5",h6:"h6",header:"header",p:"p",...(0,i.a)(),...e.components};return(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(s.header,{children:(0,n.jsx)(s.h1,{id:"title",children:"title"})}),"\n",(0,n.jsx)(s.p,{children:"some text"}),"\n",(0,n.jsx)(s.h2,{id:"section-1",children:"section 1"}),"\n",(0,n.jsx)(s.p,{children:"some text"}),"\n",(0,n.jsx)(s.h3,{id:"subsection-1-1",children:"subsection 1-1"}),"\n",(0,n.jsx)(s.p,{children:"some text"}),"\n",(0,n.jsx)(s.h4,{id:"subsection-1-1-1",children:"subsection 1-1-1"}),"\n",(0,n.jsx)(s.p,{children:"some text"}),"\n",(0,n.jsx)(s.h5,{id:"subsection-1-1-1-1",children:"subsection 1-1-1-1"}),"\n",(0,n.jsx)(s.p,{children:"some text"}),"\n",(0,n.jsx)(s.h6,{id:"subsection-1-1-1-1-1",children:"subsection 1-1-1-1-1"}),"\n",(0,n.jsx)(s.p,{children:"some text"}),"\n",(0,n.jsx)(s.h6,{id:"subsection-1-1-1-1-2",children:"subsection 1-1-1-1-2"}),"\n",(0,n.jsx)(s.p,{children:"some text"}),"\n",(0,n.jsx)(s.h5,{id:"subsection-1-1-1-2",children:"subsection 1-1-1-2"}),"\n",(0,n.jsx)(s.p,{children:"some text"}),"\n",(0,n.jsx)(s.h4,{id:"subsection-1-1-2",children:"subsection 1-1-2"}),"\n",(0,n.jsx)(s.p,{children:"some text"}),"\n",(0,n.jsx)(s.h3,{id:"subsection-1-2",children:"subsection 1-2"}),"\n",(0,n.jsx)(s.p,{children:"some text"}),"\n",(0,n.jsx)(s.h3,{id:"subsection-1-3",children:"subsection 1-3"}),"\n",(0,n.jsx)(s.p,{children:"some text"}),"\n",(0,n.jsx)(s.h2,{id:"section-2",children:"section 2"}),"\n",(0,n.jsx)(s.p,{children:"some text"}),"\n",(0,n.jsx)(s.h3,{id:"subsection-2-1",children:"subsection 2-1"}),"\n",(0,n.jsx)(s.p,{children:"some text"}),"\n",(0,n.jsx)(s.h3,{id:"subsection-2-1-1",children:"subsection 2-1"}),"\n",(0,n.jsx)(s.p,{children:"some text"}),"\n",(0,n.jsx)(s.h2,{id:"section-3",children:"section 3"}),"\n",(0,n.jsx)(s.p,{children:"some text"}),"\n",(0,n.jsx)(s.h3,{id:"subsection-3-1",children:"subsection 3-1"}),"\n",(0,n.jsx)(s.p,{children:"some text"}),"\n",(0,n.jsx)(s.h3,{id:"subsection-3-2",children:"subsection 3-2"}),"\n",(0,n.jsx)(s.p,{children:"some text"})]})}function l(e={}){let{wrapper:s}={...(0,i.a)(),...e.components};return s?(0,n.jsx)(s,{...e,children:(0,n.jsx)(o,{...e})}):o(e)}},80980:function(e,s,t){t.d(s,{Z:()=>l,a:()=>o});var n=t(67294);let i={},c=n.createContext(i);function o(e){let s=n.useContext(c);return n.useMemo(function(){return"function"==typeof e?e(s):{...s,...e}},[s,e])}function l(e){let s;return s=e.disableParentContext?"function"==typeof e.components?e.components(i):e.components||i:o(e.components),n.createElement(c.Provider,{value:s},e.children)}}}]); \ No newline at end of file diff --git a/assets/js/0c7845dd.e37548dd.js b/assets/js/0c7845dd.e37548dd.js new file mode 100644 index 0000000000..1a98236d39 --- /dev/null +++ b/assets/js/0c7845dd.e37548dd.js @@ -0,0 +1 @@ +"use strict";(self.webpackChunkwebsite=self.webpackChunkwebsite||[]).push([["64840"],{86251:function(e,s,t){t.r(s),t.d(s,{frontMatter:()=>l,default:()=>x,contentTitle:()=>d,assets:()=>u,toc:()=>r,metadata:()=>n});var n=JSON.parse('{"id":"toc/toc-_-5","title":"toc-_-5","description":"","source":"@site/_dogfooding/_docs tests/toc/toc-_-5.mdx","sourceDirName":"toc","slug":"/toc/toc-_-5","permalink":"/tests/docs/toc/toc-_-5","draft":false,"unlisted":false,"tags":[],"version":"current","lastUpdatedBy":"S\xe9bastien Lorber","lastUpdatedAt":1744293302000,"frontMatter":{"toc_max_heading_level":5},"sidebar":"sidebar","previous":{"title":"toc-5-5","permalink":"/tests/docs/toc/toc-5-5"},"next":{"title":"toc-_-_","permalink":"/tests/docs/toc/toc-_-_"}}'),i=t(85893),c=t(80980),o=t(2630);let l={toc_max_heading_level:5},d=void 0,u={},r=[...o.d$];function h(e){return(0,i.jsx)(o.ZP,{})}function x(e={}){let{wrapper:s}={...(0,c.a)(),...e.components};return s?(0,i.jsx)(s,{...e,children:(0,i.jsx)(h,{...e})}):h(e)}x.displayName="MDXContent(_dogfooding/_docs tests/toc/toc-_-5.mdx)"},2630:function(e,s,t){t.d(s,{ZP:()=>l,d$:()=>c});var n=t(85893),i=t(80980);let c=[{value:"section 1",id:"section-1",level:2},{value:"subsection 1-1",id:"subsection-1-1",level:3},{value:"subsection 1-1-1",id:"subsection-1-1-1",level:4},{value:"subsection 1-1-1-1",id:"subsection-1-1-1-1",level:5},{value:"subsection 1-1-1-1-1",id:"subsection-1-1-1-1-1",level:6},{value:"subsection 1-1-1-1-2",id:"subsection-1-1-1-1-2",level:6},{value:"subsection 1-1-1-2",id:"subsection-1-1-1-2",level:5},{value:"subsection 1-1-2",id:"subsection-1-1-2",level:4},{value:"subsection 1-2",id:"subsection-1-2",level:3},{value:"subsection 1-3",id:"subsection-1-3",level:3},{value:"section 2",id:"section-2",level:2},{value:"subsection 2-1",id:"subsection-2-1",level:3},{value:"subsection 2-1",id:"subsection-2-1-1",level:3},{value:"section 3",id:"section-3",level:2},{value:"subsection 3-1",id:"subsection-3-1",level:3},{value:"subsection 3-2",id:"subsection-3-2",level:3}];function o(e){let s={h1:"h1",h2:"h2",h3:"h3",h4:"h4",h5:"h5",h6:"h6",header:"header",p:"p",...(0,i.a)(),...e.components};return(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(s.header,{children:(0,n.jsx)(s.h1,{id:"title",children:"title"})}),"\n",(0,n.jsx)(s.p,{children:"some text"}),"\n",(0,n.jsx)(s.h2,{id:"section-1",children:"section 1"}),"\n",(0,n.jsx)(s.p,{children:"some text"}),"\n",(0,n.jsx)(s.h3,{id:"subsection-1-1",children:"subsection 1-1"}),"\n",(0,n.jsx)(s.p,{children:"some text"}),"\n",(0,n.jsx)(s.h4,{id:"subsection-1-1-1",children:"subsection 1-1-1"}),"\n",(0,n.jsx)(s.p,{children:"some text"}),"\n",(0,n.jsx)(s.h5,{id:"subsection-1-1-1-1",children:"subsection 1-1-1-1"}),"\n",(0,n.jsx)(s.p,{children:"some text"}),"\n",(0,n.jsx)(s.h6,{id:"subsection-1-1-1-1-1",children:"subsection 1-1-1-1-1"}),"\n",(0,n.jsx)(s.p,{children:"some text"}),"\n",(0,n.jsx)(s.h6,{id:"subsection-1-1-1-1-2",children:"subsection 1-1-1-1-2"}),"\n",(0,n.jsx)(s.p,{children:"some text"}),"\n",(0,n.jsx)(s.h5,{id:"subsection-1-1-1-2",children:"subsection 1-1-1-2"}),"\n",(0,n.jsx)(s.p,{children:"some text"}),"\n",(0,n.jsx)(s.h4,{id:"subsection-1-1-2",children:"subsection 1-1-2"}),"\n",(0,n.jsx)(s.p,{children:"some text"}),"\n",(0,n.jsx)(s.h3,{id:"subsection-1-2",children:"subsection 1-2"}),"\n",(0,n.jsx)(s.p,{children:"some text"}),"\n",(0,n.jsx)(s.h3,{id:"subsection-1-3",children:"subsection 1-3"}),"\n",(0,n.jsx)(s.p,{children:"some text"}),"\n",(0,n.jsx)(s.h2,{id:"section-2",children:"section 2"}),"\n",(0,n.jsx)(s.p,{children:"some text"}),"\n",(0,n.jsx)(s.h3,{id:"subsection-2-1",children:"subsection 2-1"}),"\n",(0,n.jsx)(s.p,{children:"some text"}),"\n",(0,n.jsx)(s.h3,{id:"subsection-2-1-1",children:"subsection 2-1"}),"\n",(0,n.jsx)(s.p,{children:"some text"}),"\n",(0,n.jsx)(s.h2,{id:"section-3",children:"section 3"}),"\n",(0,n.jsx)(s.p,{children:"some text"}),"\n",(0,n.jsx)(s.h3,{id:"subsection-3-1",children:"subsection 3-1"}),"\n",(0,n.jsx)(s.p,{children:"some text"}),"\n",(0,n.jsx)(s.h3,{id:"subsection-3-2",children:"subsection 3-2"}),"\n",(0,n.jsx)(s.p,{children:"some text"})]})}function l(e={}){let{wrapper:s}={...(0,i.a)(),...e.components};return s?(0,n.jsx)(s,{...e,children:(0,n.jsx)(o,{...e})}):o(e)}},80980:function(e,s,t){t.d(s,{Z:()=>l,a:()=>o});var n=t(67294);let i={},c=n.createContext(i);function o(e){let s=n.useContext(c);return n.useMemo(function(){return"function"==typeof e?e(s):{...s,...e}},[s,e])}function l(e){let s;return s=e.disableParentContext?"function"==typeof e.components?e.components(i):e.components||i:o(e.components),n.createElement(c.Provider,{value:s},e.children)}}}]); \ No newline at end of file diff --git a/assets/js/0e4d8110.229a641e.js b/assets/js/0e4d8110.229a641e.js deleted file mode 100644 index facdb34a38..0000000000 --- a/assets/js/0e4d8110.229a641e.js +++ /dev/null @@ -1,22 +0,0 @@ -"use strict";(self.webpackChunkwebsite=self.webpackChunkwebsite||[]).push([["6940"],{72188:function(e,t,n){n.r(t),n.d(t,{frontMatter:()=>d,default:()=>f,contentTitle:()=>u,assets:()=>h,toc:()=>p,metadata:()=>r});var r=JSON.parse('{"id":"api/plugins/plugin-sitemap","title":"\uD83D\uDCE6 plugin-sitemap","description":"This plugin creates sitemaps for your site so that search engine crawlers can crawl your site more accurately.","source":"@site/docs/api/plugins/plugin-sitemap.mdx","sourceDirName":"api/plugins","slug":"/api/plugins/@docusaurus/plugin-sitemap","permalink":"/docs/api/plugins/@docusaurus/plugin-sitemap","draft":false,"unlisted":false,"editUrl":"https://github.com/facebook/docusaurus/edit/main/website/docs/api/plugins/plugin-sitemap.mdx","tags":[],"version":"current","lastUpdatedBy":"Ben McCann","lastUpdatedAt":1744155424000,"sidebarPosition":10,"frontMatter":{"sidebar_position":10,"slug":"/api/plugins/@docusaurus/plugin-sitemap"},"sidebar":"api","previous":{"title":"\uD83D\uDCE6 plugin-pwa","permalink":"/docs/api/plugins/@docusaurus/plugin-pwa"},"next":{"title":"\uD83D\uDCE6 plugin-vercel-analytics","permalink":"/docs/api/plugins/@docusaurus/plugin-vercel-analytics"}}'),s=n(85893),i=n(80980),a=n(15398),l=n(58636),o=n(32240),c=n(66359);let d={sidebar_position:10,slug:"/api/plugins/@docusaurus/plugin-sitemap"},u="\uD83D\uDCE6 plugin-sitemap",h={},p=[{value:"Installation",id:"installation",level:2},{value:"Configuration",id:"configuration",level:2},{value:"Types",id:"types",level:3},{value:" CreateSitemapItemsFn
",id:"CreateSitemapItemsFn",level:4},{value:"Example configuration",id:"ex-config",level:3}];function m(e){let t={a:"a",admonition:"admonition",code:"code",h1:"h1",h2:"h2",h3:"h3",h4:"h4",header:"header",li:"li",mdxAdmonitionTitle:"mdxAdmonitionTitle",p:"p",pre:"pre",strong:"strong",table:"table",tbody:"tbody",td:"td",th:"th",thead:"thead",tr:"tr",ul:"ul",...(0,i.a)(),...e.components};return(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(t.header,{children:(0,s.jsx)(t.h1,{id:"-plugin-sitemap",children:"\uD83D\uDCE6 plugin-sitemap"})}),"\n","\n",(0,s.jsx)(t.p,{children:"This plugin creates sitemaps for your site so that search engine crawlers can crawl your site more accurately."}),"\n",(0,s.jsx)(t.admonition,{title:"production only",type:"warning",children:(0,s.jsxs)(t.p,{children:["This plugin is always inactive in development and ",(0,s.jsx)(t.strong,{children:"only active in production"})," because it works on the build output."]})}),"\n",(0,s.jsx)(t.h2,{id:"installation",children:"Installation"}),"\n",(0,s.jsxs)(a.Z,{groupId:"npm2yarn",children:[(0,s.jsx)(l.Z,{value:"npm",children:(0,s.jsx)(t.pre,{children:(0,s.jsx)(t.code,{className:"language-bash",children:"npm install --save @docusaurus/plugin-sitemap\n"})})}),(0,s.jsx)(l.Z,{value:"yarn",label:"Yarn",children:(0,s.jsx)(t.pre,{children:(0,s.jsx)(t.code,{className:"language-bash",children:"yarn add @docusaurus/plugin-sitemap\n"})})}),(0,s.jsx)(l.Z,{value:"pnpm",label:"pnpm",children:(0,s.jsx)(t.pre,{children:(0,s.jsx)(t.code,{className:"language-bash",children:"pnpm add @docusaurus/plugin-sitemap\n"})})}),(0,s.jsx)(l.Z,{value:"bun",label:"Bun",children:(0,s.jsx)(t.pre,{children:(0,s.jsx)(t.code,{className:"language-bash",children:"bun add @docusaurus/plugin-sitemap\n"})})})]}),"\n",(0,s.jsxs)(t.admonition,{type:"tip",children:[(0,s.jsxs)(t.p,{children:["If you use the preset ",(0,s.jsx)(t.code,{children:"@docusaurus/preset-classic"}),", you don't need to install this plugin as a dependency."]}),(0,s.jsxs)(t.p,{children:["You can configure this plugin through the ",(0,s.jsx)(t.a,{href:"/docs/using-plugins#docusauruspreset-classic",children:"preset options"}),"."]})]}),"\n",(0,s.jsx)(t.h2,{id:"configuration",children:"Configuration"}),"\n",(0,s.jsx)(t.p,{children:"Accepted fields:"}),"\n",(0,s.jsx)(o.Z,{children:(0,s.jsxs)(t.table,{children:[(0,s.jsx)(t.thead,{children:(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.th,{children:"Name"}),(0,s.jsx)(t.th,{children:"Type"}),(0,s.jsx)(t.th,{children:"Default"}),(0,s.jsx)(t.th,{children:"Description"})]})}),(0,s.jsxs)(t.tbody,{children:[(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.td,{children:(0,s.jsx)(t.code,{children:"lastmod"})}),(0,s.jsx)(t.td,{children:(0,s.jsx)(t.code,{children:"'date' | 'datetime' | null"})}),(0,s.jsx)(t.td,{children:(0,s.jsx)(t.code,{children:"null"})}),(0,s.jsxs)(t.td,{children:[(0,s.jsx)(t.code,{children:"date"})," is YYYY-MM-DD. ",(0,s.jsx)(t.code,{children:"datetime"})," is a ISO 8601 datetime. ",(0,s.jsx)(t.code,{children:"null"})," is disabled. See ",(0,s.jsx)(t.a,{href:"https://www.sitemaps.org/protocol.html#xmlTagDefinitions",children:"sitemap docs"}),"."]})]}),(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.td,{children:(0,s.jsx)(t.code,{children:"changefreq"})}),(0,s.jsx)(t.td,{children:(0,s.jsx)(t.code,{children:"string | null"})}),(0,s.jsx)(t.td,{children:(0,s.jsx)(t.code,{children:"'weekly'"})}),(0,s.jsxs)(t.td,{children:["See ",(0,s.jsx)(t.a,{href:"https://www.sitemaps.org/protocol.html#xmlTagDefinitions",children:"sitemap docs"})]})]}),(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.td,{children:(0,s.jsx)(t.code,{children:"priority"})}),(0,s.jsx)(t.td,{children:(0,s.jsx)(t.code,{children:"number | null"})}),(0,s.jsx)(t.td,{children:(0,s.jsx)(t.code,{children:"0.5"})}),(0,s.jsxs)(t.td,{children:["See ",(0,s.jsx)(t.a,{href:"https://www.sitemaps.org/protocol.html#xmlTagDefinitions",children:"sitemap docs"})]})]}),(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.td,{children:(0,s.jsx)(t.code,{children:"ignorePatterns"})}),(0,s.jsx)(t.td,{children:(0,s.jsx)(t.code,{children:"string[]"})}),(0,s.jsx)(t.td,{children:(0,s.jsx)(t.code,{children:"[]"})}),(0,s.jsx)(t.td,{children:"A list of glob patterns; matching route paths will be filtered from the sitemap. Note that you may need to include the base URL in here."})]}),(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.td,{children:(0,s.jsx)(t.code,{children:"filename"})}),(0,s.jsx)(t.td,{children:(0,s.jsx)(t.code,{children:"string"})}),(0,s.jsx)(t.td,{children:(0,s.jsx)(t.code,{children:"sitemap.xml"})}),(0,s.jsx)(t.td,{children:"The path to the created sitemap file, relative to the output directory. Useful if you have two plugin instances outputting two files."})]}),(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.td,{children:(0,s.jsx)(t.code,{children:"createSitemapItems"})}),(0,s.jsx)(t.td,{children:(0,s.jsxs)("code",{children:[(0,s.jsx)(t.a,{href:"#CreateSitemapItemsFn",children:"CreateSitemapItemsFn"})," | undefined"]})}),(0,s.jsx)(t.td,{children:(0,s.jsx)(t.code,{children:"undefined"})}),(0,s.jsx)(t.td,{children:"An optional function which can be used to transform and / or filter the items in the sitemap."})]})]})]})}),"\n",(0,s.jsx)(t.h3,{id:"types",children:"Types"}),"\n",(0,s.jsx)(t.h4,{id:"CreateSitemapItemsFn",children:(0,s.jsx)(t.code,{children:"CreateSitemapItemsFn"})}),"\n",(0,s.jsx)(t.pre,{children:(0,s.jsx)(t.code,{className:"language-ts",children:"type CreateSitemapItemsFn = (params: {\n siteConfig: DocusaurusConfig;\n routes: RouteConfig[];\n defaultCreateSitemapItems: CreateSitemapItemsFn;\n}) => Promise;\n"})}),"\n",(0,s.jsxs)(t.admonition,{type:"info",children:[(0,s.jsx)(t.p,{children:"This plugin also respects some site config:"}),(0,s.jsxs)(t.ul,{children:["\n",(0,s.jsxs)(t.li,{children:[(0,s.jsx)(t.a,{href:"/docs/api/docusaurus-config#noIndex",children:(0,s.jsx)(t.code,{children:"noIndex"})}),": results in no sitemap generated"]}),"\n",(0,s.jsxs)(t.li,{children:[(0,s.jsx)(t.a,{href:"/docs/api/docusaurus-config#trailingSlash",children:(0,s.jsx)(t.code,{children:"trailingSlash"})}),": determines if the URLs in the sitemap have trailing slashes"]}),"\n"]})]}),"\n",(0,s.jsxs)(t.admonition,{type:"note",children:[(0,s.jsxs)(t.mdxAdmonitionTitle,{children:["About ",(0,s.jsx)(t.code,{children:"lastmod"})]}),(0,s.jsxs)(t.p,{children:["The ",(0,s.jsx)(t.code,{children:"lastmod"})," option will only output a sitemap ",(0,s.jsx)(t.code,{children:" "})," tag if plugins provide ",(0,s.jsx)(t.a,{href:"/docs/api/plugin-methods/lifecycle-apis#addRoute",children:"route metadata"})," attributes ",(0,s.jsx)(t.code,{children:"sourceFilePath"})," and/or ",(0,s.jsx)(t.code,{children:"lastUpdatedAt"}),"."]}),(0,s.jsxs)(t.p,{children:["All the official content plugins provide the metadata for routes backed by a content file (Markdown, MDX or React page components), but it is possible third-party plugin authors do not provide this information, and the plugin will not be able to output a ",(0,s.jsx)(t.code,{children:" "})," tag for their routes."]})]}),"\n",(0,s.jsx)(t.h3,{id:"ex-config",children:"Example configuration"}),"\n",(0,s.jsx)(t.p,{children:"You can configure this plugin through preset options or plugin options."}),"\n",(0,s.jsx)(t.admonition,{type:"tip",children:(0,s.jsx)(t.p,{children:"Most Docusaurus users configure this plugin through the preset options."})}),"\n","\n",(0,s.jsx)(c.Z,{pluginName:"@docusaurus/plugin-sitemap",presetOptionName:"sitemap",code:"{\n lastmod: 'date',\n changefreq: 'weekly',\n priority: 0.5,\n ignorePatterns: ['/tags/**'],\n filename: 'sitemap.xml',\n createSitemapItems: async (params) => {\n const {defaultCreateSitemapItems, ...rest} = params;\n const items = await defaultCreateSitemapItems(rest);\n return items.filter((item) => !item.url.includes('/page/'));\n },\n}"}),"\n",(0,s.jsxs)(t.p,{children:["You can find your sitemap at ",(0,s.jsx)(t.code,{children:"/sitemap.xml"}),"."]})]})}function f(e={}){let{wrapper:t}={...(0,i.a)(),...e.components};return t?(0,s.jsx)(t,{...e,children:(0,s.jsx)(m,{...e})}):m(e)}},58636:function(e,t,n){n.d(t,{Z:()=>i});var r=n(85893);n(67294);var s=n(90496);function i(e){let{children:t,hidden:n,className:i}=e;return(0,r.jsx)("div",{role:"tabpanel",className:(0,s.Z)("tabItem_pnkT",i),hidden:n,children:t})}},15398:function(e,t,n){n.d(t,{Z:()=>j});var r=n(85893),s=n(67294),i=n(90496),a=n(54947),l=n(3620),o=n(844),c=n(97486),d=n(32263),u=n(16971);function h(e){return s.Children.toArray(e).filter(e=>"\n"!==e).map(e=>{if(!e||(0,s.isValidElement)(e)&&function(e){let{props:t}=e;return!!t&&"object"==typeof t&&"value"in t}(e))return e;throw Error(`Docusaurus error: Bad child <${"string"==typeof e.type?e.type:e.type.name}>: all children of the component should be , and every should have a unique "value" prop.`)})?.filter(Boolean)??[]}function p(e){let{value:t,tabValues:n}=e;return n.some(e=>e.value===t)}var m=n(71607);function f(e){let{className:t,block:n,selectedValue:s,selectValue:l,tabValues:o}=e,c=[],{blockElementScrollPositionUntilNextRender:d}=(0,a.o5)(),u=e=>{let t=e.currentTarget,n=o[c.indexOf(t)].value;n!==s&&(d(t),l(n))},h=e=>{let t=null;switch(e.key){case"Enter":u(e);break;case"ArrowRight":{let n=c.indexOf(e.currentTarget)+1;t=c[n]??c[0];break}case"ArrowLeft":{let n=c.indexOf(e.currentTarget)-1;t=c[n]??c[c.length-1]}}t?.focus()};return(0,r.jsx)("ul",{role:"tablist","aria-orientation":"horizontal",className:(0,i.Z)("tabs",{"tabs--block":n},t),children:o.map(e=>{let{value:t,label:n,attributes:a}=e;return(0,r.jsx)("li",{role:"tab",tabIndex:s===t?0:-1,"aria-selected":s===t,ref:e=>{c.push(e)},onKeyDown:h,onClick:u,...a,className:(0,i.Z)("tabs__item","tabItem_AQgk",a?.className,{"tabs__item--active":s===t}),children:n??t},t)})})}function g(e){let{lazy:t,children:n,selectedValue:a}=e,l=(Array.isArray(n)?n:[n]).filter(Boolean);if(t){let e=l.find(e=>e.props.value===a);return e?(0,s.cloneElement)(e,{className:(0,i.Z)("margin-top--md",e.props.className)}):null}return(0,r.jsx)("div",{className:"margin-top--md",children:l.map((e,t)=>(0,s.cloneElement)(e,{key:t,hidden:e.props.value!==a}))})}function x(e){let t=function(e){let{defaultValue:t,queryString:n=!1,groupId:r}=e,i=function(e){let{values:t,children:n}=e;return(0,s.useMemo)(()=>{let e=t??h(n).map(e=>{let{props:{value:t,label:n,attributes:r,default:s}}=e;return{value:t,label:n,attributes:r,default:s}}),r=(0,d.lx)(e,(e,t)=>e.value===t.value);if(r.length>0)throw Error(`Docusaurus error: Duplicate values "${r.map(e=>e.value).join(", ")}" found in . Every value needs to be unique.`);return e},[t,n])}(e),[a,m]=(0,s.useState)(()=>(function(e){let{defaultValue:t,tabValues:n}=e;if(0===n.length)throw Error("Docusaurus error: the component requires at least one children component");if(t){if(!p({value:t,tabValues:n}))throw Error(`Docusaurus error: The has a defaultValue "${t}" but none of its children has the corresponding value. Available values are: ${n.map(e=>e.value).join(", ")}. If you intend to show no default tab, use defaultValue={null} instead.`);return t}let r=n.find(e=>e.default)??n[0];if(!r)throw Error("Unexpected error: 0 tabValues");return r.value})({defaultValue:t,tabValues:i})),[f,g]=function(e){let{queryString:t=!1,groupId:n}=e,r=(0,l.k6)(),i=function(e){let{queryString:t=!1,groupId:n}=e;if("string"==typeof t)return t;if(!1===t)return null;if(!0===t&&!n)throw Error('Docusaurus error: The component groupId prop is required if queryString=true, because this value is used as the search param name. You can also provide an explicit value such as queryString="my-search-param".');return n??null}({queryString:t,groupId:n});return[(0,c._X)(i),(0,s.useCallback)(e=>{if(!i)return;let t=new URLSearchParams(r.location.search);t.set(i,e),r.replace({...r.location,search:t.toString()})},[i,r])]}({queryString:n,groupId:r}),[x,j]=function(e){let{groupId:t}=e,n=t?`docusaurus.tab.${t}`:null,[r,i]=(0,u.Nk)(n);return[r,(0,s.useCallback)(e=>{n&&i.set(e)},[n,i])]}({groupId:r}),b=(()=>{let e=f??x;return p({value:e,tabValues:i})?e:null})();return(0,o.Z)(()=>{b&&m(b)},[b]),{selectedValue:a,selectValue:(0,s.useCallback)(e=>{if(!p({value:e,tabValues:i}))throw Error(`Can't select invalid tab value=${e}`);m(e),g(e),j(e)},[g,j,i]),tabValues:i}}(e);return(0,r.jsxs)("div",{className:(0,i.Z)("tabs-container","tabList_Qoir"),children:[(0,r.jsx)(f,{...t,...e}),(0,r.jsx)(g,{...t,...e})]})}function j(e){let t=(0,m.Z)();return(0,r.jsx)(x,{...e,children:h(e.children)},String(t))}},56497:function(e,t,n){n.d(t,{Z:()=>i});var r=n(85893);n(67294);var s=n(71607);function i(e){let{children:t,fallback:n}=e;return(0,s.Z)()?(0,r.jsx)(r.Fragment,{children:t?.()}):n??null}},32240:function(e,t,n){n.d(t,{Z:()=>o});var r=n(85893),s=n(67294),i=n(96700),a=n(3620);let l=s.forwardRef(function(e,t){let{name:n,children:l}=e,o=function(e){let t=e;for(;(0,s.isValidElement)(t);)[t]=s.Children.toArray(t.props.children);if("string"!=typeof t)throw Error(`Could not extract APITable row name from JSX tree: -${JSON.stringify(e,null,2)}`);return t}(l),c=n?`${n}-${o}`:o,d=`#${c}`,u=(0,a.k6)();return(0,i.Z)().collectAnchor(c),(0,r.jsx)("tr",{id:c,tabIndex:0,ref:u.location.hash===d?t:void 0,onClick:e=>{let t="TD"===e.target.tagName.toUpperCase(),n=!!window.getSelection()?.toString();t&&!n&&u.push(d)},onKeyDown:e=>{"Enter"===e.key&&u.push(d)},children:l.props.children})});function o(e){let{children:t,name:n}=e;if("table"!==t.type)throw Error("Bad usage of APITable component.\nIt is probably that your Markdown table is malformed.\nMake sure to double-check you have the appropriate number of columns for each table row.");let[i,a]=s.Children.toArray(t.props.children),o=(0,s.useRef)(null);(0,s.useEffect)(()=>{o.current?.focus()},[o]);let c=s.Children.map(a.props.children,e=>(0,r.jsx)(l,{name:n,ref:o,children:e}));return(0,r.jsxs)("table",{className:"apiTable_e8hp",children:[i,(0,r.jsx)("tbody",{children:c})]})}},66359:function(e,t,n){n.d(t,{Z:()=>u});var r=n(85893);n(67294);var s=n(35363),i=n(90158),a=n(77827),l=n(15398),o=n(58636),c=n(93278);let d=void 0;function u(e){let{code:t,pluginName:n,presetOptionName:u}=e,h=(0,i.zu)(d).path;return(0,r.jsxs)(l.Z,{groupId:"api-config-ex",children:[(0,r.jsxs)(o.Z,{value:"preset",label:(0,a.I)({message:"Preset options"}),children:[(0,r.jsx)("p",{children:(0,r.jsx)(a.Z,{id:"apiDocs.configTabs.presetOptions.description",values:{presetLink:(0,r.jsx)(s.Z,{to:`${h}/using-plugins#docusauruspreset-classic`,children:(0,r.jsx)(a.Z,{children:"preset options"})})},children:"If you use a preset, configure this plugin through the {presetLink}:"})}),(0,r.jsx)(c.Z,{language:"js",title:"docusaurus.config.js",children:`module.exports = { - presets: [ - [ - '@docusaurus/preset-classic', - { - // highlight-start - ${u}: ${t.replace(/\n/g,"\n ")}, - // highlight-end - }, - ], - ], -};`})]}),(0,r.jsxs)(o.Z,{value:"plugin",label:(0,a.I)({message:"Plugin options"}),children:[(0,r.jsx)("p",{children:(0,r.jsx)(a.Z,{children:"If you are using a standalone plugin, provide options directly to the plugin:"})}),(0,r.jsx)(c.Z,{language:"js",title:"docusaurus.config.js",children:`module.exports = { - plugins: [ - [ - '${n}', - // highlight-start - ${t.replace(/\n/g,"\n ")}, - // highlight-end - ], - ], -};`})]})]})}},93278:function(e,t,n){n.d(t,{Z:()=>ep});var r,s={};n.r(s),n.d(s,{ButtonExample:()=>B});var i=n(85893),a=n(67294),l=n(90496),o=n(71607),c=n(10075),d=n(77827),u=n(8156),h=n(56497),p=n(85108),m=n(45245),f=n(26378);function g(){let{prism:e}=(0,f.L)(),{colorMode:t}=(0,m.I)(),n=e.theme,r=e.darkTheme||n;return"dark"===t?r:n}var x=n(67490);function j(e){let{children:t}=e;return(0,i.jsx)("div",{className:(0,l.Z)("playgroundHeader_Tvsk"),children:t})}function b(){return(0,i.jsx)("div",{children:"Loading..."})}function v(){return(0,i.jsx)(h.Z,{fallback:(0,i.jsx)(b,{}),children:()=>(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(x.Z,{fallback:e=>(0,i.jsx)(p.Ac,{...e}),children:(0,i.jsx)(c.i5,{})}),(0,i.jsx)(c.IF,{})]})})}function y(){return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(j,{children:(0,i.jsx)(d.Z,{id:"theme.Playground.result",description:"The result label of the live codeblocks",children:"Result"})}),(0,i.jsx)("div",{className:"playgroundPreview_mApW",children:(0,i.jsx)(v,{})})]})}function w(){let e=(0,o.Z)();return(0,i.jsx)(c.uz,{className:"playgroundEditor_TySg"},String(e))}function k(){return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(j,{children:(0,i.jsx)(d.Z,{id:"theme.Playground.liveEditor",description:"The live editor label of the live codeblocks",children:"Live Editor"})}),(0,i.jsx)(w,{})]})}let N=e=>`${e};`;function C(e){let{children:t,transformCode:n,...r}=e,{siteConfig:{themeConfig:s}}=(0,u.Z)(),{liveCodeBlock:{playgroundPosition:a}}=s,l=g(),o=r.metastring?.includes("noInline")??!1;return(0,i.jsx)("div",{className:"playgroundContainer_6Ior",children:(0,i.jsx)(c.nu,{code:t?.replace(/\n$/,""),noInline:o,transformCode:n??N,theme:l,...r,children:"top"===a?(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(y,{}),(0,i.jsx)(k,{})]}):(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(k,{}),(0,i.jsx)(y,{})]})})})}function B(e){return(0,i.jsx)("button",{type:"button",...e,style:{backgroundColor:"white",color:"black",border:"solid red",borderRadius:20,padding:10,cursor:"pointer",...e.style}})}let I={React:a,...a,...s};var Z=n(55951),L=n(6324),S=n.n(L),T=n(50923);let E=/title=(? ["'])(?.*?)\1/,A=/\{(? [\d,-]+)\}/,_={js:{start:"\\/\\/",end:""},jsBlock:{start:"\\/\\*",end:"\\*\\/"},jsx:{start:"\\{\\s*\\/\\*",end:"\\*\\/\\s*\\}"},bash:{start:"#",end:""},html:{start:"\x3c!--",end:"--\x3e"}},$={..._,lua:{start:"--",end:""},wasm:{start:"\\;\\;",end:""},tex:{start:"%",end:""},vb:{start:"['\u2018\u2019]",end:""},vbnet:{start:"(?:_\\s*)?['\u2018\u2019]",end:""},rem:{start:"[Rr][Ee][Mm]\\b",end:""},f90:{start:"!",end:""},ml:{start:"\\(\\*",end:"\\*\\)"},cobol:{start:"\\*>",end:""}},D=Object.keys(_);function M(e,t){let n=e.map(e=>{let{start:n,end:r}=$[e];return`(?:${n}\\s*(${t.flatMap(e=>[e.line,e.block?.start,e.block?.end].filter(Boolean)).join("|")})\\s*${r})`}).join("|");return RegExp(`^\\s*(?:${n})\\s*$`)}let R=(0,a.createContext)(null);function F(e){let{metadata:t,wordWrap:n,children:r}=e,s=(0,a.useMemo)(()=>({metadata:t,wordWrap:n}),[t,n]);return(0,i.jsx)(R.Provider,{value:s,children:r})}function O(){let e=(0,a.useContext)(R);if(null===e)throw new T.i6("CodeBlockContextProvider");return e}function P(e){let{as:t,...n}=e,r=function(e){let t={color:"--prism-color",backgroundColor:"--prism-background-color"},n={};return Object.entries(e.plain).forEach(e=>{let[r,s]=e,i=t[r];i&&"string"==typeof s&&(n[i]=s)}),n}(g());return(0,i.jsx)(t,{...n,style:r,className:(0,l.Z)(n.className,"codeBlockContainer_jDV4",Z.k.common.codeBlock)})}let W={codeBlock:"codeBlock_Gebt",codeBlockStandalone:"codeBlockStandalone_i_cY",codeBlockLines:"codeBlockLines_FJaf",codeBlockLinesWithNumbering:"codeBlockLinesWithNumbering_FU9Q"};function V(e){let{children:t,className:n}=e;return(0,i.jsx)(P,{as:"pre",tabIndex:0,className:(0,l.Z)(W.codeBlockStandalone,"thin-scrollbar",n),children:(0,i.jsx)("code",{className:W.codeBlockLines,children:t})})}let q={attributes:!0,characterData:!0,childList:!0,subtree:!0};function U(e){let{children:t}=e;return t}var H=n(7316);function Y(e){let{line:t,token:n,...r}=e;return(0,i.jsx)("span",{...r})}let z={codeLine:"codeLine_qRmp",codeLineNumber:"codeLineNumber_dS_J",codeLineContent:"codeLineContent_XF5l"};function X(e){let{line:t,classNames:n,showLineNumbers:r,getLineProps:s,getTokenProps:a}=e,o=function(e){let t=1===e.length&&"\n"===e[0].content?e[0]:void 0;return t?[{...t,content:""}]:e}(t),c=s({line:o,className:(0,l.Z)(n,r&&z.codeLine)}),d=o.map((e,t)=>{let n=a({token:e});return(0,i.jsx)(Y,{...n,line:o,token:e,children:n.children},t)});return(0,i.jsxs)("span",{...c,children:[r?(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)("span",{className:z.codeLineNumber}),(0,i.jsx)("span",{className:z.codeLineContent,children:d})]}):d,(0,i.jsx)("br",{})]})}let J=a.forwardRef((e,t)=>(0,i.jsx)("pre",{ref:t,tabIndex:0,...e,className:(0,l.Z)(e.className,W.codeBlock,"thin-scrollbar")}));function Q(e){let{metadata:t}=O();return(0,i.jsx)("code",{...e,className:(0,l.Z)(e.className,W.codeBlockLines,void 0!==t.lineNumbersStart&&W.codeBlockLinesWithNumbering),style:{...e.style,counterReset:void 0===t.lineNumbersStart?void 0:`line-count ${t.lineNumbersStart-1}`}})}function K(e){let{className:t}=e,{metadata:n,wordWrap:r}=O(),s=g(),{code:a,language:o,lineNumbersStart:c,lineClassNames:d}=n;return(0,i.jsx)(H.y$,{theme:s,code:a,language:o,children:e=>{let{className:n,style:s,tokens:a,getLineProps:o,getTokenProps:u}=e;return(0,i.jsx)(J,{ref:r.codeBlockRef,className:(0,l.Z)(t,n),style:s,children:(0,i.jsx)(Q,{children:a.map((e,t)=>(0,i.jsx)(X,{line:e,getLineProps:o,getTokenProps:u,classNames:d[t],showLineNumbers:void 0!==c},t))})})}})}var G=n(44771);function ee(e){let{className:t,...n}=e;return(0,i.jsx)("button",{type:"button",...n,className:(0,l.Z)("clean-btn",t)})}function et(e){return(0,i.jsx)("svg",{viewBox:"0 0 24 24",...e,children:(0,i.jsx)("path",{fill:"currentColor",d:"M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"})})}function en(e){return(0,i.jsx)("svg",{viewBox:"0 0 24 24",...e,children:(0,i.jsx)("path",{fill:"currentColor",d:"M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"})})}let er={copyButtonCopied:"copyButtonCopied_wDuR",copyButtonIcons:"copyButtonIcons_gMWc",copyButtonIcon:"copyButtonIcon_GXfb",copyButtonSuccessIcon:"copyButtonSuccessIcon_ktUX"};function es(e){let{className:t}=e,{copyCode:n,isCopied:r}=function(){let{metadata:{code:e}}=O(),[t,n]=(0,a.useState)(!1),r=(0,a.useRef)(void 0),s=(0,a.useCallback)(()=>{(0,G.Z)(e),n(!0),r.current=window.setTimeout(()=>{n(!1)},1e3)},[e]);return(0,a.useEffect)(()=>()=>window.clearTimeout(r.current),[]),{copyCode:s,isCopied:t}}();return(0,i.jsx)(ee,{"aria-label":r?(0,d.I)({id:"theme.CodeBlock.copied",message:"Copied",description:"The copied button label on code blocks"}):(0,d.I)({id:"theme.CodeBlock.copyButtonAriaLabel",message:"Copy code to clipboard",description:"The ARIA label for copy code blocks button"}),title:(0,d.I)({id:"theme.CodeBlock.copy",message:"Copy",description:"The copy button label on code blocks"}),className:(0,l.Z)(t,er.copyButton,r&&er.copyButtonCopied),onClick:n,children:(0,i.jsxs)("span",{className:er.copyButtonIcons,"aria-hidden":"true",children:[(0,i.jsx)(et,{className:er.copyButtonIcon}),(0,i.jsx)(en,{className:er.copyButtonSuccessIcon})]})})}function ei(e){return(0,i.jsx)("svg",{viewBox:"0 0 24 24",...e,children:(0,i.jsx)("path",{fill:"currentColor",d:"M4 19h6v-2H4v2zM20 5H4v2h16V5zm-3 6H4v2h13.25c1.1 0 2 .9 2 2s-.9 2-2 2H15v-2l-3 3l3 3v-2h2c2.21 0 4-1.79 4-4s-1.79-4-4-4z"})})}let ea={wordWrapButtonIcon:"wordWrapButtonIcon___5r",wordWrapButtonEnabled:"wordWrapButtonEnabled_nam_"};function el(e){let{className:t}=e,{wordWrap:n}=O();if(!(n.isEnabled||n.isCodeScrollable))return!1;let r=(0,d.I)({id:"theme.CodeBlock.wordWrapToggle",message:"Toggle word wrap",description:"The title attribute for toggle word wrapping button of code block lines"});return(0,i.jsx)(ee,{onClick:()=>n.toggle(),className:(0,l.Z)(t,n.isEnabled&&ea.wordWrapButtonEnabled),"aria-label":r,title:r,children:(0,i.jsx)(ei,{className:ea.wordWrapButtonIcon,"aria-hidden":"true"})})}function eo(e){let{className:t}=e;return(0,i.jsx)(h.Z,{children:()=>(0,i.jsxs)("div",{className:(0,l.Z)(t,"buttonGroup_KXnS"),children:[(0,i.jsx)(el,{}),(0,i.jsx)(es,{})]})})}let ec={codeBlockContent:"codeBlockContent_cKMj",codeBlockTitle:"codeBlockTitle_U6Q0"};function ed(e){let{className:t}=e,{metadata:n}=O();return(0,i.jsxs)(P,{as:"div",className:(0,l.Z)(t,n.className),children:[n.title&&(0,i.jsx)("div",{className:ec.codeBlockTitle,children:(0,i.jsx)(U,{children:n.title})}),(0,i.jsxs)("div",{className:ec.codeBlockContent,children:[(0,i.jsx)(K,{}),(0,i.jsx)(eo,{})]})]})}function eu(e){let t=function(e){let{prism:t}=(0,f.L)();return function(e){var t,n,r;let s=(n=(t={language:e.language,defaultLanguage:e.defaultLanguage,className:e.className}).language??function(e){if(!e)return;let t=e.split(" ").find(e=>e.startsWith("language-"));return t?.replace(/language-/,"")}(t.className)??t.defaultLanguage,n?.toLowerCase()??"text"),{lineClassNames:i,code:a}=function(e,t){let n=e.replace(/\r?\n$/,"");return function(e,t){let{metastring:n,magicComments:r}=t;if(n&&A.test(n)){let t=n.match(A).groups.range;if(0===r.length)throw Error(`A highlight range has been given in code block's metastring (\`\`\` ${n}), but no magic comment config is available. Docusaurus applies the first magic comment entry's className for metastring ranges.`);let s=r[0].className;return{lineClassNames:Object.fromEntries(S()(t).filter(e=>e>0).map(e=>[e-1,[s]])),code:e}}return null}(n,{...t})??function(e,t){let{language:n,magicComments:r}=t;if(void 0===n)return{lineClassNames:{},code:e};let s=function(e,t){switch(e){case"js":case"javascript":case"ts":case"typescript":return M(["js","jsBlock"],t);case"jsx":case"tsx":return M(["js","jsBlock","jsx"],t);case"html":return M(["js","jsBlock","html"],t);case"python":case"py":case"bash":return M(["bash"],t);case"markdown":case"md":return M(["html","jsx","bash"],t);case"tex":case"latex":case"matlab":return M(["tex"],t);case"lua":case"haskell":return M(["lua"],t);case"sql":return M(["lua","jsBlock"],t);case"wasm":return M(["wasm"],t);case"vb":case"vba":case"visual-basic":return M(["vb","rem"],t);case"vbnet":return M(["vbnet","rem"],t);case"batch":return M(["rem"],t);case"basic":return M(["rem","f90"],t);case"fsharp":return M(["js","ml"],t);case"ocaml":case"sml":return M(["ml"],t);case"fortran":return M(["f90"],t);case"cobol":return M(["cobol"],t);default:return M(D,t)}}(n,r),i=e.split(/\r?\n/),a=Object.fromEntries(r.map(e=>[e.className,{start:0,range:""}])),l=Object.fromEntries(r.filter(e=>e.line).map(e=>{let{className:t,line:n}=e;return[n,t]})),o=Object.fromEntries(r.filter(e=>e.block).map(e=>{let{className:t,block:n}=e;return[n.start,t]})),c=Object.fromEntries(r.filter(e=>e.block).map(e=>{let{className:t,block:n}=e;return[n.end,t]}));for(let e=0;e void 0!==e);l[n]?a[l[n]].range+=`${e},`:o[n]?a[o[n]].start=e:c[n]&&(a[c[n]].range+=`${a[c[n]].start}-${e-1},`),i.splice(e,1)}let d={};return Object.entries(a).forEach(e=>{let[t,{range:n}]=e;S()(n).forEach(e=>{d[e]??=[],d[e].push(t)})}),{code:i.join("\n"),lineClassNames:d}}(n,{...t})}(e.code,{metastring:e.metastring,magicComments:e.magicComments,language:s}),o=function(e){let{className:t,language:n}=e;return(0,l.Z)(t,n&&!t?.includes(`language-${n}`)&&`language-${n}`)}({className:e.className,language:s}),c=(r=e.metastring,(r?.match(E)?.groups.title??"")||e.title),d=function(e){let{showLineNumbers:t,metastring:n}=e;if("boolean"==typeof t)return t?1:void 0;if("number"==typeof t)return t;let r=n?.split(" ").find(e=>e.startsWith("showLineNumbers"));if(r)return r.startsWith("showLineNumbers=")?parseInt(r.replace("showLineNumbers=",""),10):1}({showLineNumbers:e.showLineNumbers,metastring:e.metastring});return{codeInput:e.code,code:a,className:o,language:s,title:c,lineNumbersStart:d,lineClassNames:i}}({code:e.children,className:e.className,metastring:e.metastring,magicComments:t.magicComments,defaultLanguage:t.defaultLanguage,language:e.language,title:e.title,showLineNumbers:e.showLineNumbers})}(e),n=function(){let[e,t]=(0,a.useState)(!1),[n,r]=(0,a.useState)(!1),s=(0,a.useRef)(null),i=(0,a.useCallback)(()=>{let n=s.current.querySelector("code");e?n.removeAttribute("style"):(n.style.whiteSpace="pre-wrap",n.style.overflowWrap="anywhere"),t(e=>!e)},[s,e]),l=(0,a.useCallback)(()=>{let{scrollWidth:e,clientWidth:t}=s.current;r(e>t||s.current.querySelector("code").hasAttribute("style"))},[s]),[o,c]=(0,a.useState)(),d=(0,a.useCallback)(()=>{c(s.current?.closest("[role=tabpanel][hidden]"))},[s,c]);return(0,a.useEffect)(()=>{d()},[d]),!function(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:q,r=(0,T.zX)(t),s=(0,T.Ql)(n);(0,a.useEffect)(()=>{let t=new MutationObserver(r);return e&&t.observe(e,s),()=>t.disconnect()},[e,r,s])}(o,e=>{e.forEach(e=>{"attributes"===e.type&&"hidden"===e.attributeName&&(l(),d())})},{attributes:!0,characterData:!1,childList:!1,subtree:!1}),(0,a.useEffect)(()=>{l()},[e,l]),(0,a.useEffect)(()=>(window.addEventListener("resize",l,{passive:!0}),()=>{window.removeEventListener("resize",l)}),[l]),{codeBlockRef:s,isEnabled:e,isCodeScrollable:n,toggle:i}}();return(0,i.jsx)(F,{metadata:t,wordWrap:n,children:(0,i.jsx)(ed,{})})}let eh=(r=function(e){let{children:t,...n}=e,r=(0,o.Z)(),s=a.Children.toArray(t).some(e=>(0,a.isValidElement)(e))?t:Array.isArray(t)?t.join(""):t;return(0,i.jsx)("string"==typeof s?eu:V,{...n,children:s},String(r))},function(e){return e.live?(0,i.jsx)(C,{scope:I,...e}):(0,i.jsx)(r,{...e})});function ep(e){return(0,i.jsx)(eh,{...e})}}}]); \ No newline at end of file diff --git a/assets/js/0e4d8110.5b3d4842.js b/assets/js/0e4d8110.5b3d4842.js new file mode 100644 index 0000000000..96c3c1ef24 --- /dev/null +++ b/assets/js/0e4d8110.5b3d4842.js @@ -0,0 +1,22 @@ +"use strict";(self.webpackChunkwebsite=self.webpackChunkwebsite||[]).push([["6940"],{72188:function(e,t,n){n.r(t),n.d(t,{frontMatter:()=>u,default:()=>f,contentTitle:()=>d,assets:()=>h,toc:()=>p,metadata:()=>r});var r=JSON.parse('{"id":"api/plugins/plugin-sitemap","title":"\uD83D\uDCE6 plugin-sitemap","description":"This plugin creates sitemaps for your site so that search engine crawlers can crawl your site more accurately.","source":"@site/docs/api/plugins/plugin-sitemap.mdx","sourceDirName":"api/plugins","slug":"/api/plugins/@docusaurus/plugin-sitemap","permalink":"/docs/api/plugins/@docusaurus/plugin-sitemap","draft":false,"unlisted":false,"editUrl":"https://github.com/facebook/docusaurus/edit/main/website/docs/api/plugins/plugin-sitemap.mdx","tags":[],"version":"current","lastUpdatedBy":"S\xe9bastien Lorber","lastUpdatedAt":1744293302000,"sidebarPosition":10,"frontMatter":{"sidebar_position":10,"slug":"/api/plugins/@docusaurus/plugin-sitemap"},"sidebar":"api","previous":{"title":"\uD83D\uDCE6 plugin-pwa","permalink":"/docs/api/plugins/@docusaurus/plugin-pwa"},"next":{"title":"\uD83D\uDCE6 plugin-vercel-analytics","permalink":"/docs/api/plugins/@docusaurus/plugin-vercel-analytics"}}'),s=n(85893),i=n(80980),l=n(15398),a=n(58636),o=n(32240),c=n(66359);let u={sidebar_position:10,slug:"/api/plugins/@docusaurus/plugin-sitemap"},d="\uD83D\uDCE6 plugin-sitemap",h={},p=[{value:"Installation",id:"installation",level:2},{value:"Configuration",id:"configuration",level:2},{value:"Types",id:"types",level:3},{value:" CreateSitemapItemsFn
",id:"CreateSitemapItemsFn",level:4},{value:"Example configuration",id:"ex-config",level:3}];function m(e){let t={a:"a",admonition:"admonition",code:"code",h1:"h1",h2:"h2",h3:"h3",h4:"h4",header:"header",li:"li",mdxAdmonitionTitle:"mdxAdmonitionTitle",p:"p",pre:"pre",strong:"strong",table:"table",tbody:"tbody",td:"td",th:"th",thead:"thead",tr:"tr",ul:"ul",...(0,i.a)(),...e.components};return(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(t.header,{children:(0,s.jsx)(t.h1,{id:"-plugin-sitemap",children:"\uD83D\uDCE6 plugin-sitemap"})}),"\n","\n",(0,s.jsx)(t.p,{children:"This plugin creates sitemaps for your site so that search engine crawlers can crawl your site more accurately."}),"\n",(0,s.jsx)(t.admonition,{title:"production only",type:"warning",children:(0,s.jsxs)(t.p,{children:["This plugin is always inactive in development and ",(0,s.jsx)(t.strong,{children:"only active in production"})," because it works on the build output."]})}),"\n",(0,s.jsx)(t.h2,{id:"installation",children:"Installation"}),"\n",(0,s.jsxs)(l.Z,{groupId:"npm2yarn",children:[(0,s.jsx)(a.Z,{value:"npm",children:(0,s.jsx)(t.pre,{children:(0,s.jsx)(t.code,{className:"language-bash",children:"npm install --save @docusaurus/plugin-sitemap\n"})})}),(0,s.jsx)(a.Z,{value:"yarn",label:"Yarn",children:(0,s.jsx)(t.pre,{children:(0,s.jsx)(t.code,{className:"language-bash",children:"yarn add @docusaurus/plugin-sitemap\n"})})}),(0,s.jsx)(a.Z,{value:"pnpm",label:"pnpm",children:(0,s.jsx)(t.pre,{children:(0,s.jsx)(t.code,{className:"language-bash",children:"pnpm add @docusaurus/plugin-sitemap\n"})})}),(0,s.jsx)(a.Z,{value:"bun",label:"Bun",children:(0,s.jsx)(t.pre,{children:(0,s.jsx)(t.code,{className:"language-bash",children:"bun add @docusaurus/plugin-sitemap\n"})})})]}),"\n",(0,s.jsxs)(t.admonition,{type:"tip",children:[(0,s.jsxs)(t.p,{children:["If you use the preset ",(0,s.jsx)(t.code,{children:"@docusaurus/preset-classic"}),", you don't need to install this plugin as a dependency."]}),(0,s.jsxs)(t.p,{children:["You can configure this plugin through the ",(0,s.jsx)(t.a,{href:"/docs/using-plugins#docusauruspreset-classic",children:"preset options"}),"."]})]}),"\n",(0,s.jsx)(t.h2,{id:"configuration",children:"Configuration"}),"\n",(0,s.jsx)(t.p,{children:"Accepted fields:"}),"\n",(0,s.jsx)(o.Z,{children:(0,s.jsxs)(t.table,{children:[(0,s.jsx)(t.thead,{children:(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.th,{children:"Name"}),(0,s.jsx)(t.th,{children:"Type"}),(0,s.jsx)(t.th,{children:"Default"}),(0,s.jsx)(t.th,{children:"Description"})]})}),(0,s.jsxs)(t.tbody,{children:[(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.td,{children:(0,s.jsx)(t.code,{children:"lastmod"})}),(0,s.jsx)(t.td,{children:(0,s.jsx)(t.code,{children:"'date' | 'datetime' | null"})}),(0,s.jsx)(t.td,{children:(0,s.jsx)(t.code,{children:"null"})}),(0,s.jsxs)(t.td,{children:[(0,s.jsx)(t.code,{children:"date"})," is YYYY-MM-DD. ",(0,s.jsx)(t.code,{children:"datetime"})," is a ISO 8601 datetime. ",(0,s.jsx)(t.code,{children:"null"})," is disabled. See ",(0,s.jsx)(t.a,{href:"https://www.sitemaps.org/protocol.html#xmlTagDefinitions",children:"sitemap docs"}),"."]})]}),(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.td,{children:(0,s.jsx)(t.code,{children:"changefreq"})}),(0,s.jsx)(t.td,{children:(0,s.jsx)(t.code,{children:"string | null"})}),(0,s.jsx)(t.td,{children:(0,s.jsx)(t.code,{children:"'weekly'"})}),(0,s.jsxs)(t.td,{children:["See ",(0,s.jsx)(t.a,{href:"https://www.sitemaps.org/protocol.html#xmlTagDefinitions",children:"sitemap docs"})]})]}),(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.td,{children:(0,s.jsx)(t.code,{children:"priority"})}),(0,s.jsx)(t.td,{children:(0,s.jsx)(t.code,{children:"number | null"})}),(0,s.jsx)(t.td,{children:(0,s.jsx)(t.code,{children:"0.5"})}),(0,s.jsxs)(t.td,{children:["See ",(0,s.jsx)(t.a,{href:"https://www.sitemaps.org/protocol.html#xmlTagDefinitions",children:"sitemap docs"})]})]}),(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.td,{children:(0,s.jsx)(t.code,{children:"ignorePatterns"})}),(0,s.jsx)(t.td,{children:(0,s.jsx)(t.code,{children:"string[]"})}),(0,s.jsx)(t.td,{children:(0,s.jsx)(t.code,{children:"[]"})}),(0,s.jsx)(t.td,{children:"A list of glob patterns; matching route paths will be filtered from the sitemap. Note that you may need to include the base URL in here."})]}),(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.td,{children:(0,s.jsx)(t.code,{children:"filename"})}),(0,s.jsx)(t.td,{children:(0,s.jsx)(t.code,{children:"string"})}),(0,s.jsx)(t.td,{children:(0,s.jsx)(t.code,{children:"sitemap.xml"})}),(0,s.jsx)(t.td,{children:"The path to the created sitemap file, relative to the output directory. Useful if you have two plugin instances outputting two files."})]}),(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.td,{children:(0,s.jsx)(t.code,{children:"createSitemapItems"})}),(0,s.jsx)(t.td,{children:(0,s.jsxs)("code",{children:[(0,s.jsx)(t.a,{href:"#CreateSitemapItemsFn",children:"CreateSitemapItemsFn"})," | undefined"]})}),(0,s.jsx)(t.td,{children:(0,s.jsx)(t.code,{children:"undefined"})}),(0,s.jsx)(t.td,{children:"An optional function which can be used to transform and / or filter the items in the sitemap."})]})]})]})}),"\n",(0,s.jsx)(t.h3,{id:"types",children:"Types"}),"\n",(0,s.jsx)(t.h4,{id:"CreateSitemapItemsFn",children:(0,s.jsx)(t.code,{children:"CreateSitemapItemsFn"})}),"\n",(0,s.jsx)(t.pre,{children:(0,s.jsx)(t.code,{className:"language-ts",children:"type CreateSitemapItemsFn = (params: {\n siteConfig: DocusaurusConfig;\n routes: RouteConfig[];\n defaultCreateSitemapItems: CreateSitemapItemsFn;\n}) => Promise;\n"})}),"\n",(0,s.jsxs)(t.admonition,{type:"info",children:[(0,s.jsx)(t.p,{children:"This plugin also respects some site config:"}),(0,s.jsxs)(t.ul,{children:["\n",(0,s.jsxs)(t.li,{children:[(0,s.jsx)(t.a,{href:"/docs/api/docusaurus-config#noIndex",children:(0,s.jsx)(t.code,{children:"noIndex"})}),": results in no sitemap generated"]}),"\n",(0,s.jsxs)(t.li,{children:[(0,s.jsx)(t.a,{href:"/docs/api/docusaurus-config#trailingSlash",children:(0,s.jsx)(t.code,{children:"trailingSlash"})}),": determines if the URLs in the sitemap have trailing slashes"]}),"\n"]})]}),"\n",(0,s.jsxs)(t.admonition,{type:"note",children:[(0,s.jsxs)(t.mdxAdmonitionTitle,{children:["About ",(0,s.jsx)(t.code,{children:"lastmod"})]}),(0,s.jsxs)(t.p,{children:["The ",(0,s.jsx)(t.code,{children:"lastmod"})," option will only output a sitemap ",(0,s.jsx)(t.code,{children:" "})," tag if plugins provide ",(0,s.jsx)(t.a,{href:"/docs/api/plugin-methods/lifecycle-apis#addRoute",children:"route metadata"})," attributes ",(0,s.jsx)(t.code,{children:"sourceFilePath"})," and/or ",(0,s.jsx)(t.code,{children:"lastUpdatedAt"}),"."]}),(0,s.jsxs)(t.p,{children:["All the official content plugins provide the metadata for routes backed by a content file (Markdown, MDX or React page components), but it is possible third-party plugin authors do not provide this information, and the plugin will not be able to output a ",(0,s.jsx)(t.code,{children:" "})," tag for their routes."]})]}),"\n",(0,s.jsx)(t.h3,{id:"ex-config",children:"Example configuration"}),"\n",(0,s.jsx)(t.p,{children:"You can configure this plugin through preset options or plugin options."}),"\n",(0,s.jsx)(t.admonition,{type:"tip",children:(0,s.jsx)(t.p,{children:"Most Docusaurus users configure this plugin through the preset options."})}),"\n","\n",(0,s.jsx)(c.Z,{pluginName:"@docusaurus/plugin-sitemap",presetOptionName:"sitemap",code:"{\n lastmod: 'date',\n changefreq: 'weekly',\n priority: 0.5,\n ignorePatterns: ['/tags/**'],\n filename: 'sitemap.xml',\n createSitemapItems: async (params) => {\n const {defaultCreateSitemapItems, ...rest} = params;\n const items = await defaultCreateSitemapItems(rest);\n return items.filter((item) => !item.url.includes('/page/'));\n },\n}"}),"\n",(0,s.jsxs)(t.p,{children:["You can find your sitemap at ",(0,s.jsx)(t.code,{children:"/sitemap.xml"}),"."]})]})}function f(e={}){let{wrapper:t}={...(0,i.a)(),...e.components};return t?(0,s.jsx)(t,{...e,children:(0,s.jsx)(m,{...e})}):m(e)}},58636:function(e,t,n){n.d(t,{Z:()=>i});var r=n(85893);n(67294);var s=n(90496);function i(e){let{children:t,hidden:n,className:i}=e;return(0,r.jsx)("div",{role:"tabpanel",className:(0,s.Z)("tabItem_pnkT",i),hidden:n,children:t})}},15398:function(e,t,n){n.d(t,{Z:()=>j});var r=n(85893),s=n(67294),i=n(90496),l=n(54947),a=n(3620),o=n(844),c=n(97486),u=n(32263),d=n(16971);function h(e){return s.Children.toArray(e).filter(e=>"\n"!==e).map(e=>{if(!e||(0,s.isValidElement)(e)&&function(e){let{props:t}=e;return!!t&&"object"==typeof t&&"value"in t}(e))return e;throw Error(`Docusaurus error: Bad child <${"string"==typeof e.type?e.type:e.type.name}>: all children of the component should be , and every should have a unique "value" prop.`)})?.filter(Boolean)??[]}function p(e){let{value:t,tabValues:n}=e;return n.some(e=>e.value===t)}var m=n(71607);function f(e){let{className:t,block:n,selectedValue:s,selectValue:a,tabValues:o}=e,c=[],{blockElementScrollPositionUntilNextRender:u}=(0,l.o5)(),d=e=>{let t=e.currentTarget,n=o[c.indexOf(t)].value;n!==s&&(u(t),a(n))},h=e=>{let t=null;switch(e.key){case"Enter":d(e);break;case"ArrowRight":{let n=c.indexOf(e.currentTarget)+1;t=c[n]??c[0];break}case"ArrowLeft":{let n=c.indexOf(e.currentTarget)-1;t=c[n]??c[c.length-1]}}t?.focus()};return(0,r.jsx)("ul",{role:"tablist","aria-orientation":"horizontal",className:(0,i.Z)("tabs",{"tabs--block":n},t),children:o.map(e=>{let{value:t,label:n,attributes:l}=e;return(0,r.jsx)("li",{role:"tab",tabIndex:s===t?0:-1,"aria-selected":s===t,ref:e=>{c.push(e)},onKeyDown:h,onClick:d,...l,className:(0,i.Z)("tabs__item","tabItem_AQgk",l?.className,{"tabs__item--active":s===t}),children:n??t},t)})})}function g(e){let{lazy:t,children:n,selectedValue:l}=e,a=(Array.isArray(n)?n:[n]).filter(Boolean);if(t){let e=a.find(e=>e.props.value===l);return e?(0,s.cloneElement)(e,{className:(0,i.Z)("margin-top--md",e.props.className)}):null}return(0,r.jsx)("div",{className:"margin-top--md",children:a.map((e,t)=>(0,s.cloneElement)(e,{key:t,hidden:e.props.value!==l}))})}function x(e){let t=function(e){let{defaultValue:t,queryString:n=!1,groupId:r}=e,i=function(e){let{values:t,children:n}=e;return(0,s.useMemo)(()=>{let e=t??h(n).map(e=>{let{props:{value:t,label:n,attributes:r,default:s}}=e;return{value:t,label:n,attributes:r,default:s}}),r=(0,u.lx)(e,(e,t)=>e.value===t.value);if(r.length>0)throw Error(`Docusaurus error: Duplicate values "${r.map(e=>e.value).join(", ")}" found in . Every value needs to be unique.`);return e},[t,n])}(e),[l,m]=(0,s.useState)(()=>(function(e){let{defaultValue:t,tabValues:n}=e;if(0===n.length)throw Error("Docusaurus error: the component requires at least one children component");if(t){if(!p({value:t,tabValues:n}))throw Error(`Docusaurus error: The has a defaultValue "${t}" but none of its children has the corresponding value. Available values are: ${n.map(e=>e.value).join(", ")}. If you intend to show no default tab, use defaultValue={null} instead.`);return t}let r=n.find(e=>e.default)??n[0];if(!r)throw Error("Unexpected error: 0 tabValues");return r.value})({defaultValue:t,tabValues:i})),[f,g]=function(e){let{queryString:t=!1,groupId:n}=e,r=(0,a.k6)(),i=function(e){let{queryString:t=!1,groupId:n}=e;if("string"==typeof t)return t;if(!1===t)return null;if(!0===t&&!n)throw Error('Docusaurus error: The component groupId prop is required if queryString=true, because this value is used as the search param name. You can also provide an explicit value such as queryString="my-search-param".');return n??null}({queryString:t,groupId:n});return[(0,c._X)(i),(0,s.useCallback)(e=>{if(!i)return;let t=new URLSearchParams(r.location.search);t.set(i,e),r.replace({...r.location,search:t.toString()})},[i,r])]}({queryString:n,groupId:r}),[x,j]=function(e){let{groupId:t}=e,n=t?`docusaurus.tab.${t}`:null,[r,i]=(0,d.Nk)(n);return[r,(0,s.useCallback)(e=>{n&&i.set(e)},[n,i])]}({groupId:r}),b=(()=>{let e=f??x;return p({value:e,tabValues:i})?e:null})();return(0,o.Z)(()=>{b&&m(b)},[b]),{selectedValue:l,selectValue:(0,s.useCallback)(e=>{if(!p({value:e,tabValues:i}))throw Error(`Can't select invalid tab value=${e}`);m(e),g(e),j(e)},[g,j,i]),tabValues:i}}(e);return(0,r.jsxs)("div",{className:(0,i.Z)("tabs-container","tabList_Qoir"),children:[(0,r.jsx)(f,{...t,...e}),(0,r.jsx)(g,{...t,...e})]})}function j(e){let t=(0,m.Z)();return(0,r.jsx)(x,{...e,children:h(e.children)},String(t))}},56497:function(e,t,n){n.d(t,{Z:()=>i});var r=n(85893);n(67294);var s=n(71607);function i(e){let{children:t,fallback:n}=e;return(0,s.Z)()?(0,r.jsx)(r.Fragment,{children:t?.()}):n??null}},32240:function(e,t,n){n.d(t,{Z:()=>o});var r=n(85893),s=n(67294),i=n(96700),l=n(3620);let a=s.forwardRef(function(e,t){let{name:n,children:a}=e,o=function(e){let t=e;for(;(0,s.isValidElement)(t);)[t]=s.Children.toArray(t.props.children);if("string"!=typeof t)throw Error(`Could not extract APITable row name from JSX tree: +${JSON.stringify(e,null,2)}`);return t}(a),c=n?`${n}-${o}`:o,u=`#${c}`,d=(0,l.k6)();return(0,i.Z)().collectAnchor(c),(0,r.jsx)("tr",{id:c,tabIndex:0,ref:d.location.hash===u?t:void 0,onClick:e=>{let t="TD"===e.target.tagName.toUpperCase(),n=!!window.getSelection()?.toString();t&&!n&&d.push(u)},onKeyDown:e=>{"Enter"===e.key&&d.push(u)},children:a.props.children})});function o(e){let{children:t,name:n}=e;if("table"!==t.type)throw Error("Bad usage of APITable component.\nIt is probably that your Markdown table is malformed.\nMake sure to double-check you have the appropriate number of columns for each table row.");let[i,l]=s.Children.toArray(t.props.children),o=(0,s.useRef)(null);(0,s.useEffect)(()=>{o.current?.focus()},[o]);let c=s.Children.map(l.props.children,e=>(0,r.jsx)(a,{name:n,ref:o,children:e}));return(0,r.jsxs)("table",{className:"apiTable_e8hp",children:[i,(0,r.jsx)("tbody",{children:c})]})}},66359:function(e,t,n){n.d(t,{Z:()=>d});var r=n(85893);n(67294);var s=n(35363),i=n(90158),l=n(77827),a=n(15398),o=n(58636),c=n(27817);let u=void 0;function d(e){let{code:t,pluginName:n,presetOptionName:d}=e,h=(0,i.zu)(u).path;return(0,r.jsxs)(a.Z,{groupId:"api-config-ex",children:[(0,r.jsxs)(o.Z,{value:"preset",label:(0,l.I)({message:"Preset options"}),children:[(0,r.jsx)("p",{children:(0,r.jsx)(l.Z,{id:"apiDocs.configTabs.presetOptions.description",values:{presetLink:(0,r.jsx)(s.Z,{to:`${h}/using-plugins#docusauruspreset-classic`,children:(0,r.jsx)(l.Z,{children:"preset options"})})},children:"If you use a preset, configure this plugin through the {presetLink}:"})}),(0,r.jsx)(c.Z,{language:"js",title:"docusaurus.config.js",children:`module.exports = { + presets: [ + [ + '@docusaurus/preset-classic', + { + // highlight-start + ${d}: ${t.replace(/\n/g,"\n ")}, + // highlight-end + }, + ], + ], +};`})]}),(0,r.jsxs)(o.Z,{value:"plugin",label:(0,l.I)({message:"Plugin options"}),children:[(0,r.jsx)("p",{children:(0,r.jsx)(l.Z,{children:"If you are using a standalone plugin, provide options directly to the plugin:"})}),(0,r.jsx)(c.Z,{language:"js",title:"docusaurus.config.js",children:`module.exports = { + plugins: [ + [ + '${n}', + // highlight-start + ${t.replace(/\n/g,"\n ")}, + // highlight-end + ], + ], +};`})]})]})}},27817:function(e,t,n){n.d(t,{Z:()=>ef});var r={};n.r(r),n.d(r,{ButtonExample:()=>ed});var s=n(85893),i=n(67294),l=n(71607),a=n(90496),o=n(45245),c=n(26378);function u(){let{prism:e}=(0,c.L)(),{colorMode:t}=(0,o.I)(),n=e.theme,r=e.darkTheme||n;return"dark"===t?r:n}var d=n(55951),h=n(6324),p=n.n(h),m=n(50923);let f=/title=(? ["'])(?.*?)\1/,g=/\{(? [\d,-]+)\}/,x={js:{start:"\\/\\/",end:""},jsBlock:{start:"\\/\\*",end:"\\*\\/"},jsx:{start:"\\{\\s*\\/\\*",end:"\\*\\/\\s*\\}"},bash:{start:"#",end:""},html:{start:"\x3c!--",end:"--\x3e"}},j={...x,lua:{start:"--",end:""},wasm:{start:"\\;\\;",end:""},tex:{start:"%",end:""},vb:{start:"['\u2018\u2019]",end:""},vbnet:{start:"(?:_\\s*)?['\u2018\u2019]",end:""},rem:{start:"[Rr][Ee][Mm]\\b",end:""},f90:{start:"!",end:""},ml:{start:"\\(\\*",end:"\\*\\)"},cobol:{start:"\\*>",end:""}},b=Object.keys(x);function v(e,t){let n=e.map(e=>{let{start:n,end:r}=j[e];return`(?:${n}\\s*(${t.flatMap(e=>[e.line,e.block?.start,e.block?.end].filter(Boolean)).join("|")})\\s*${r})`}).join("|");return RegExp(`^\\s*(?:${n})\\s*$`)}let y=(0,i.createContext)(null);function w(e){let{metadata:t,wordWrap:n,children:r}=e,l=(0,i.useMemo)(()=>({metadata:t,wordWrap:n}),[t,n]);return(0,s.jsx)(y.Provider,{value:l,children:r})}function k(){let e=(0,i.useContext)(y);if(null===e)throw new m.i6("CodeBlockContextProvider");return e}function N(e){let{as:t,...n}=e,r=function(e){let t={color:"--prism-color",backgroundColor:"--prism-background-color"},n={};return Object.entries(e.plain).forEach(e=>{let[r,s]=e,i=t[r];i&&"string"==typeof s&&(n[i]=s)}),n}(u());return(0,s.jsx)(t,{...n,style:r,className:(0,a.Z)(n.className,"codeBlockContainer_jDV4",d.k.common.codeBlock)})}let C={codeBlock:"codeBlock_Gebt",codeBlockStandalone:"codeBlockStandalone_i_cY",codeBlockLines:"codeBlockLines_FJaf",codeBlockLinesWithNumbering:"codeBlockLinesWithNumbering_FU9Q"};function B(e){let{children:t,className:n}=e;return(0,s.jsx)(N,{as:"pre",tabIndex:0,className:(0,a.Z)(C.codeBlockStandalone,"thin-scrollbar",n),children:(0,s.jsx)("code",{className:C.codeBlockLines,children:t})})}let I={attributes:!0,characterData:!0,childList:!0,subtree:!0};function L(e){let{children:t}=e;return t}var Z=n(7316);function S(e){let{line:t,token:n,...r}=e;return(0,s.jsx)("span",{...r})}let T={codeLine:"codeLine_qRmp",codeLineNumber:"codeLineNumber_dS_J",codeLineContent:"codeLineContent_XF5l"};function E(e){let{line:t,classNames:n,showLineNumbers:r,getLineProps:i,getTokenProps:l}=e,o=function(e){let t=1===e.length&&"\n"===e[0].content?e[0]:void 0;return t?[{...t,content:""}]:e}(t),c=i({line:o,className:(0,a.Z)(n,r&&T.codeLine)}),u=o.map((e,t)=>{let n=l({token:e});return(0,s.jsx)(S,{...n,line:o,token:e,children:n.children},t)});return(0,s.jsxs)("span",{...c,children:[r?(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)("span",{className:T.codeLineNumber}),(0,s.jsx)("span",{className:T.codeLineContent,children:u})]}):u,(0,s.jsx)("br",{})]})}let _=i.forwardRef((e,t)=>(0,s.jsx)("pre",{ref:t,tabIndex:0,...e,className:(0,a.Z)(e.className,C.codeBlock,"thin-scrollbar")}));function A(e){let{metadata:t}=k();return(0,s.jsx)("code",{...e,className:(0,a.Z)(e.className,C.codeBlockLines,void 0!==t.lineNumbersStart&&C.codeBlockLinesWithNumbering),style:{...e.style,counterReset:void 0===t.lineNumbersStart?void 0:`line-count ${t.lineNumbersStart-1}`}})}function $(e){let{className:t}=e,{metadata:n,wordWrap:r}=k(),i=u(),{code:l,language:o,lineNumbersStart:c,lineClassNames:d}=n;return(0,s.jsx)(Z.y$,{theme:i,code:l,language:o,children:e=>{let{className:n,style:i,tokens:l,getLineProps:o,getTokenProps:u}=e;return(0,s.jsx)(_,{ref:r.codeBlockRef,className:(0,a.Z)(t,n),style:i,children:(0,s.jsx)(A,{children:l.map((e,t)=>(0,s.jsx)(E,{line:e,getLineProps:o,getTokenProps:u,classNames:d[t],showLineNumbers:void 0!==c},t))})})}})}var D=n(56497),F=n(44771),M=n(77827);function R(e){let{className:t,...n}=e;return(0,s.jsx)("button",{type:"button",...n,className:(0,a.Z)("clean-btn",t)})}function O(e){return(0,s.jsx)("svg",{viewBox:"0 0 24 24",...e,children:(0,s.jsx)("path",{fill:"currentColor",d:"M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"})})}function P(e){return(0,s.jsx)("svg",{viewBox:"0 0 24 24",...e,children:(0,s.jsx)("path",{fill:"currentColor",d:"M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"})})}let W={copyButtonCopied:"copyButtonCopied_wDuR",copyButtonIcons:"copyButtonIcons_gMWc",copyButtonIcon:"copyButtonIcon_GXfb",copyButtonSuccessIcon:"copyButtonSuccessIcon_ktUX"};function V(e){let{className:t}=e,{copyCode:n,isCopied:r}=function(){let{metadata:{code:e}}=k(),[t,n]=(0,i.useState)(!1),r=(0,i.useRef)(void 0),s=(0,i.useCallback)(()=>{(0,F.Z)(e),n(!0),r.current=window.setTimeout(()=>{n(!1)},1e3)},[e]);return(0,i.useEffect)(()=>()=>window.clearTimeout(r.current),[]),{copyCode:s,isCopied:t}}();return(0,s.jsx)(R,{"aria-label":r?(0,M.I)({id:"theme.CodeBlock.copied",message:"Copied",description:"The copied button label on code blocks"}):(0,M.I)({id:"theme.CodeBlock.copyButtonAriaLabel",message:"Copy code to clipboard",description:"The ARIA label for copy code blocks button"}),title:(0,M.I)({id:"theme.CodeBlock.copy",message:"Copy",description:"The copy button label on code blocks"}),className:(0,a.Z)(t,W.copyButton,r&&W.copyButtonCopied),onClick:n,children:(0,s.jsxs)("span",{className:W.copyButtonIcons,"aria-hidden":"true",children:[(0,s.jsx)(O,{className:W.copyButtonIcon}),(0,s.jsx)(P,{className:W.copyButtonSuccessIcon})]})})}function q(e){return(0,s.jsx)("svg",{viewBox:"0 0 24 24",...e,children:(0,s.jsx)("path",{fill:"currentColor",d:"M4 19h6v-2H4v2zM20 5H4v2h16V5zm-3 6H4v2h13.25c1.1 0 2 .9 2 2s-.9 2-2 2H15v-2l-3 3l3 3v-2h2c2.21 0 4-1.79 4-4s-1.79-4-4-4z"})})}let H={wordWrapButtonIcon:"wordWrapButtonIcon___5r",wordWrapButtonEnabled:"wordWrapButtonEnabled_nam_"};function U(e){let{className:t}=e,{wordWrap:n}=k();if(!(n.isEnabled||n.isCodeScrollable))return!1;let r=(0,M.I)({id:"theme.CodeBlock.wordWrapToggle",message:"Toggle word wrap",description:"The title attribute for toggle word wrapping button of code block lines"});return(0,s.jsx)(R,{onClick:()=>n.toggle(),className:(0,a.Z)(t,n.isEnabled&&H.wordWrapButtonEnabled),"aria-label":r,title:r,children:(0,s.jsx)(q,{className:H.wordWrapButtonIcon,"aria-hidden":"true"})})}function Y(e){let{className:t}=e;return(0,s.jsx)(D.Z,{children:()=>(0,s.jsxs)("div",{className:(0,a.Z)(t,"buttonGroup_KXnS"),children:[(0,s.jsx)(U,{}),(0,s.jsx)(V,{})]})})}let z={codeBlockContent:"codeBlockContent_cKMj",codeBlockTitle:"codeBlockTitle_U6Q0"};function X(e){let{className:t}=e,{metadata:n}=k();return(0,s.jsxs)(N,{as:"div",className:(0,a.Z)(t,n.className),children:[n.title&&(0,s.jsx)("div",{className:z.codeBlockTitle,children:(0,s.jsx)(L,{children:n.title})}),(0,s.jsxs)("div",{className:z.codeBlockContent,children:[(0,s.jsx)($,{}),(0,s.jsx)(Y,{})]})]})}function J(e){let t=function(e){let{prism:t}=(0,c.L)();return function(e){var t,n,r;let s=(n=(t={language:e.language,defaultLanguage:e.defaultLanguage,className:e.className}).language??function(e){if(!e)return;let t=e.split(" ").find(e=>e.startsWith("language-"));return t?.replace(/language-/,"")}(t.className)??t.defaultLanguage,n?.toLowerCase()??"text"),{lineClassNames:i,code:l}=function(e,t){let n=e.replace(/\r?\n$/,"");return function(e,t){let{metastring:n,magicComments:r}=t;if(n&&g.test(n)){let t=n.match(g).groups.range;if(0===r.length)throw Error(`A highlight range has been given in code block's metastring (\`\`\` ${n}), but no magic comment config is available. Docusaurus applies the first magic comment entry's className for metastring ranges.`);let s=r[0].className;return{lineClassNames:Object.fromEntries(p()(t).filter(e=>e>0).map(e=>[e-1,[s]])),code:e}}return null}(n,{...t})??function(e,t){let{language:n,magicComments:r}=t;if(void 0===n)return{lineClassNames:{},code:e};let s=function(e,t){switch(e){case"js":case"javascript":case"ts":case"typescript":return v(["js","jsBlock"],t);case"jsx":case"tsx":return v(["js","jsBlock","jsx"],t);case"html":return v(["js","jsBlock","html"],t);case"python":case"py":case"bash":return v(["bash"],t);case"markdown":case"md":return v(["html","jsx","bash"],t);case"tex":case"latex":case"matlab":return v(["tex"],t);case"lua":case"haskell":return v(["lua"],t);case"sql":return v(["lua","jsBlock"],t);case"wasm":return v(["wasm"],t);case"vb":case"vba":case"visual-basic":return v(["vb","rem"],t);case"vbnet":return v(["vbnet","rem"],t);case"batch":return v(["rem"],t);case"basic":return v(["rem","f90"],t);case"fsharp":return v(["js","ml"],t);case"ocaml":case"sml":return v(["ml"],t);case"fortran":return v(["f90"],t);case"cobol":return v(["cobol"],t);default:return v(b,t)}}(n,r),i=e.split(/\r?\n/),l=Object.fromEntries(r.map(e=>[e.className,{start:0,range:""}])),a=Object.fromEntries(r.filter(e=>e.line).map(e=>{let{className:t,line:n}=e;return[n,t]})),o=Object.fromEntries(r.filter(e=>e.block).map(e=>{let{className:t,block:n}=e;return[n.start,t]})),c=Object.fromEntries(r.filter(e=>e.block).map(e=>{let{className:t,block:n}=e;return[n.end,t]}));for(let e=0;e void 0!==e);a[n]?l[a[n]].range+=`${e},`:o[n]?l[o[n]].start=e:c[n]&&(l[c[n]].range+=`${l[c[n]].start}-${e-1},`),i.splice(e,1)}let u={};return Object.entries(l).forEach(e=>{let[t,{range:n}]=e;p()(n).forEach(e=>{u[e]??=[],u[e].push(t)})}),{code:i.join("\n"),lineClassNames:u}}(n,{...t})}(e.code,{metastring:e.metastring,magicComments:e.magicComments,language:s}),o=function(e){let{className:t,language:n}=e;return(0,a.Z)(t,n&&!t?.includes(`language-${n}`)&&`language-${n}`)}({className:e.className,language:s}),c=(r=e.metastring,(r?.match(f)?.groups.title??"")||e.title),u=function(e){let{showLineNumbers:t,metastring:n}=e;if("boolean"==typeof t)return t?1:void 0;if("number"==typeof t)return t;let r=n?.split(" ").find(e=>e.startsWith("showLineNumbers"));if(r)return r.startsWith("showLineNumbers=")?parseInt(r.replace("showLineNumbers=",""),10):1}({showLineNumbers:e.showLineNumbers,metastring:e.metastring});return{codeInput:e.code,code:l,className:o,language:s,title:c,lineNumbersStart:u,lineClassNames:i}}({code:e.children,className:e.className,metastring:e.metastring,magicComments:t.magicComments,defaultLanguage:t.defaultLanguage,language:e.language,title:e.title,showLineNumbers:e.showLineNumbers})}(e),n=function(){let[e,t]=(0,i.useState)(!1),[n,r]=(0,i.useState)(!1),s=(0,i.useRef)(null),l=(0,i.useCallback)(()=>{let n=s.current.querySelector("code");e?n.removeAttribute("style"):(n.style.whiteSpace="pre-wrap",n.style.overflowWrap="anywhere"),t(e=>!e)},[s,e]),a=(0,i.useCallback)(()=>{let{scrollWidth:e,clientWidth:t}=s.current;r(e>t||s.current.querySelector("code").hasAttribute("style"))},[s]),[o,c]=(0,i.useState)(),u=(0,i.useCallback)(()=>{c(s.current?.closest("[role=tabpanel][hidden]"))},[s,c]);return(0,i.useEffect)(()=>{u()},[u]),!function(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:I,r=(0,m.zX)(t),s=(0,m.Ql)(n);(0,i.useEffect)(()=>{let t=new MutationObserver(r);return e&&t.observe(e,s),()=>t.disconnect()},[e,r,s])}(o,e=>{e.forEach(e=>{"attributes"===e.type&&"hidden"===e.attributeName&&(a(),u())})},{attributes:!0,characterData:!1,childList:!1,subtree:!1}),(0,i.useEffect)(()=>{a()},[e,a]),(0,i.useEffect)(()=>(window.addEventListener("resize",a,{passive:!0}),()=>{window.removeEventListener("resize",a)}),[a]),{codeBlockRef:s,isEnabled:e,isCodeScrollable:n,toggle:l}}();return(0,s.jsx)(w,{metadata:t,wordWrap:n,children:(0,s.jsx)(X,{})})}function Q(e){let{children:t,...n}=e,r=(0,l.Z)(),a=i.Children.toArray(t).some(e=>(0,i.isValidElement)(e))?t:Array.isArray(t)?t.join(""):t;return(0,s.jsx)("string"==typeof a?J:B,{...n,children:a},String(r))}var K=n(10075);let G=e=>`${e};`;function ee(e){let{code:t,children:n,...r}=e,i=u(),l=r.metastring?.includes("noInline")??!1;return(0,s.jsx)(K.nu,{noInline:l,theme:i,...r,code:t?.replace(/\n$/,""),transformCode:r.transformCode??G,children:n})}function et(e){let{children:t}=e;return(0,s.jsx)("div",{className:"playgroundContainer_TDLX",children:t})}var en=n(85108),er=n(67490);function es(e){let{children:t}=e;return(0,s.jsx)("div",{className:(0,a.Z)("playgroundHeader_h_Hu"),children:t})}function ei(){return(0,s.jsx)("div",{children:"Loading..."})}function el(){return(0,s.jsx)(D.Z,{fallback:(0,s.jsx)(ei,{}),children:()=>(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(er.Z,{fallback:e=>(0,s.jsx)(en.Ac,{...e}),children:(0,s.jsx)(K.i5,{})}),(0,s.jsx)(K.IF,{})]})})}function ea(){return(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(es,{children:(0,s.jsx)(M.Z,{id:"theme.Playground.result",description:"The result label of the live codeblocks",children:"Result"})}),(0,s.jsx)("div",{className:"playgroundPreview_u2xE",children:(0,s.jsx)(el,{})})]})}function eo(){let e=(0,l.Z)();return(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(es,{children:(0,s.jsx)(M.Z,{id:"theme.Playground.liveEditor",description:"The live editor label of the live codeblocks",children:"Live Editor"})}),(0,s.jsx)(K.uz,{className:"playgroundEditor_uqZ4"},String(e))]})}function ec(){let{playgroundPosition:e}=(0,c.L)().liveCodeBlock;return(0,s.jsx)(s.Fragment,{children:"top"===e?(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(ea,{}),(0,s.jsx)(eo,{})]}):(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(eo,{}),(0,s.jsx)(ea,{})]})})}function eu(e){let{children:t,transformCode:n,...r}=e;return(0,s.jsx)(et,{children:(0,s.jsx)(ee,{code:t,...r,children:(0,s.jsx)(ec,{})})})}function ed(e){return(0,s.jsx)("button",{type:"button",...e,style:{backgroundColor:"white",color:"black",border:"solid red",borderRadius:20,padding:10,cursor:"pointer",...e.style}})}let eh={React:i,...i,...r};function ep(e){return(0,s.jsx)(eu,{scope:eh,...e})}function em(e){return e.live?(0,s.jsx)(ep,{...e}):(0,s.jsx)(Q,{...e})}function ef(e){return(0,s.jsx)(em,{...e})}}}]); \ No newline at end of file diff --git a/assets/js/0e9c6edc.7a9ea3fb.js b/assets/js/0e9c6edc.58063618.js similarity index 97% rename from assets/js/0e9c6edc.7a9ea3fb.js rename to assets/js/0e9c6edc.58063618.js index 1e998e2c5c..0fb4773d1e 100644 --- a/assets/js/0e9c6edc.7a9ea3fb.js +++ b/assets/js/0e9c6edc.58063618.js @@ -1 +1 @@ -"use strict";(self.webpackChunkwebsite=self.webpackChunkwebsite||[]).push([["59587"],{23141:function(e,n,s){s.d(n,{Z:()=>t});let t=s.p+"assets/images/social-card-8dc2413b4f9e86328bf77575e91171d7.png"},6789:function(e,n,s){s.d(n,{Z:()=>t});let t=s.p+"assets/images/doc-card-list-e52d727eadceb3d21cfc0f851f09aa93.png"},56594:function(e,n,s){s.d(n,{Z:()=>t});let t=s.p+"assets/images/social-card-8dc2413b4f9e86328bf77575e91171d7.png"},30959:function(e,n,s){s.r(n),s.d(n,{assets:()=>c,contentTitle:()=>a,default:()=>h,frontMatter:()=>r,metadata:()=>t,toc:()=>l});var t=s(46689),i=s(85893),o=s(80980);let r={title:"Docusaurus 2.1",authors:["slorber"],tags:["release"],image:"./img/social-card.png"},a=void 0,c={image:s(23141).Z,authorsImageUrls:[void 0]},l=[{value:"Highlights",id:"highlights",level:2},{value:"DocCardList improvements",id:"doccardlist-improvements",level:3},{value:" noindex
improvements",id:"noindex-improvements",level:3},{value:"Overriding default meta tags",id:"overriding-default-meta-tags",level:3},{value:"Ukrainian translations",id:"ukrainian-translations",level:3},{value:"Other changes",id:"other-changes",level:2}];function d(e){let n={a:"a",code:"code",h2:"h2",h3:"h3",img:"img",li:"li",p:"p",pre:"pre",strong:"strong",ul:"ul",...(0,o.a)(),...e.components};return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)(n.p,{children:["We are happy to announce ",(0,i.jsx)(n.strong,{children:"Docusaurus 2.1"}),", our very first minor version release."]}),"\n",(0,i.jsxs)(n.p,{children:["The upgrade should be easy: as explained in our ",(0,i.jsx)(n.a,{href:"/community/release-process",children:"release process documentation"}),", minor versions respect ",(0,i.jsx)(n.a,{href:"https://semver.org/",children:"Semantic Versioning"}),"."]}),"\n",(0,i.jsx)(n.p,{children:(0,i.jsx)(n.img,{alt:"Docusaurus 2.1 social card",src:s(56594).Z+"",width:"1200",height:"600"})}),"\n",(0,i.jsx)(n.h2,{id:"highlights",children:"Highlights"}),"\n",(0,i.jsx)(n.h3,{id:"doccardlist-improvements",children:"DocCardList improvements"}),"\n",(0,i.jsxs)(n.p,{children:["In ",(0,i.jsx)(n.a,{href:"https://github.com/facebook/docusaurus/pull/8008",children:"#8008"}),", we simplified the usage of the",(0,i.jsx)(n.code,{children:""})," component, that is notably used on sidebar category generated index pages."]}),"\n",(0,i.jsxs)(n.p,{children:["The ",(0,i.jsx)(n.code,{children:"items"})," prop is now optional, and will be automatically inferred from the content of the parent sidebar category:"]}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-diff",children:"import DocCardList from '@theme/DocCardList';\n- import {useCurrentSidebarCategory} from '@docusaurus/theme-common';\n\n- \n+ \n"})}),"\n",(0,i.jsx)(n.p,{children:"Also, we made it possible to use it on any document, including regular docs not linked to any sidebar category."}),"\n",(0,i.jsx)(n.p,{children:(0,i.jsx)(n.img,{alt:"simplified DocCardList component",src:s(6789).Z+"",width:"1062",height:"489"})}),"\n",(0,i.jsxs)(n.h3,{id:"noindex-improvements",children:[(0,i.jsx)(n.code,{children:"noindex"})," improvements"]}),"\n",(0,i.jsxs)(n.p,{children:["We improved the support of the ",(0,i.jsxs)(n.a,{href:"https://developers.google.com/search/docs/advanced/crawling/block-indexing",children:[(0,i.jsx)(n.code,{children:"noindex"})," meta ",(0,i.jsx)(n.code,{children:"robots"})," directive"]}),", a way to signal search engines you don't want a specific page to be indexed."]}),"\n",(0,i.jsxs)(n.p,{children:["In ",(0,i.jsx)(n.a,{href:"https://github.com/facebook/docusaurus/pull/7963",children:"#7963"}),", we allow ",(0,i.jsx)(n.code,{children:"noindex"})," to be configured on a per-docs-version basis."]}),"\n",(0,i.jsxs)(n.p,{children:["Use the following plugin options to tell crawlers you don't want the ",(0,i.jsx)(n.code,{children:"1.0.0"})," version to be indexed:"]}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-jsx",children:"const options = {\n versions: {\n '1.0.0': {\n noIndex: true,\n },\n },\n};\n"})}),"\n",(0,i.jsx)(n.p,{children:"In practice, Docusaurus will add the following meta to each page of that version:"}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-html",children:'\n'})}),"\n",(0,i.jsxs)(n.p,{children:["In ",(0,i.jsx)(n.a,{href:"https://github.com/facebook/docusaurus/pull/7964",children:"#7964"}),", we also fixed a bug where the sitemap plugin would still contain pages that have a ",(0,i.jsx)(n.code,{children:"noindex"})," directive. Now the sitemap plugin will reliably filter out all the pages containing ",(0,i.jsx)(n.code,{children:"noindex"})," directives."]}),"\n",(0,i.jsx)(n.h3,{id:"overriding-default-meta-tags",children:"Overriding default meta tags"}),"\n",(0,i.jsxs)(n.p,{children:["In ",(0,i.jsx)(n.a,{href:"https://github.com/facebook/docusaurus/pull/7952",children:"#7952"}),", it becomes possible to override default html meta tags you couldn't before:"]}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-jsx",children:'<>\n {siteConfig.noIndex && }\n \n>\n'})}),"\n",(0,i.jsxs)(n.p,{children:["It is now possible to use ",(0,i.jsx)(n.code,{children:""})," or ",(0,i.jsx)(n.code,{children:"themeConfig.metadata"}),":"]}),"\n",(0,i.jsxs)(n.ul,{children:["\n",(0,i.jsxs)(n.li,{children:["to override the ",(0,i.jsx)(n.code,{children:"viewport"})," meta"]}),"\n",(0,i.jsxs)(n.li,{children:["to override the ",(0,i.jsx)(n.code,{children:"robots"})," meta: you could mark your site as ",(0,i.jsx)(n.code,{children:"noIndex"}),", but except for specific pages that should be indexed"]}),"\n"]}),"\n",(0,i.jsx)(n.h3,{id:"ukrainian-translations",children:"Ukrainian translations"}),"\n",(0,i.jsxs)(n.p,{children:["In ",(0,i.jsx)(n.a,{href:"https://github.com/facebook/docusaurus/pull/7953",children:"#7953"}),", we added default classic theme translations for the Ukrainian language."]}),"\n",(0,i.jsx)(n.h2,{id:"other-changes",children:"Other changes"}),"\n",(0,i.jsxs)(n.p,{children:["Check the ",(0,i.jsx)(n.a,{href:"/changelog/2.1.0",children:"2.1.0 changelog entry"})," for an exhaustive list of changes."]})]})}function h(e={}){let{wrapper:n}={...(0,o.a)(),...e.components};return n?(0,i.jsx)(n,{...e,children:(0,i.jsx)(d,{...e})}):d(e)}},80980:function(e,n,s){s.d(n,{Z:()=>a,a:()=>r});var t=s(67294);let i={},o=t.createContext(i);function r(e){let n=t.useContext(o);return t.useMemo(function(){return"function"==typeof e?e(n):{...n,...e}},[n,e])}function a(e){let n;return n=e.disableParentContext?"function"==typeof e.components?e.components(i):e.components||i:r(e.components),t.createElement(o.Provider,{value:n},e.children)}},46689:function(e){e.exports=JSON.parse('{"permalink":"/blog/2022/09/01/docusaurus-2.1","editUrl":"https://github.com/facebook/docusaurus/edit/main/website/blog/2022/09-01-docusaurus-2.1/index.mdx","source":"@site/blog/2022/09-01-docusaurus-2.1/index.mdx","title":"Docusaurus 2.1","description":"We are happy to announce Docusaurus 2.1, our very first minor version release.","date":"2022-09-01T00:00:00.000Z","tags":[{"inline":false,"label":"Release","permalink":"/blog/tags/release","description":"Blog posts about Docusaurus\' new releases"}],"readingTime":1.725,"hasTruncateMarker":true,"authors":[{"name":"S\xe9bastien Lorber","title":"Docusaurus maintainer, This Week In React editor","url":"https://thisweekinreact.com","page":{"permalink":"/blog/authors/slorber"},"description":"A freelance React and React-Native developer near Paris and Docusaurus maintainer. Also runs ThisWeekInReact.com, a newsletter to stay updated with the React ecosystem.","socials":{"bluesky":"https://bsky.app/profile/sebastienlorber.com","x":"https://x.com/sebastienlorber","linkedin":"https://www.linkedin.com/in/sebastienlorber/","github":"https://github.com/slorber","instagram":"https://www.instagram.com/thisweekinreact","newsletter":"https://thisweekinreact.com"},"imageURL":"https://github.com/slorber.png","key":"slorber"}],"frontMatter":{"title":"Docusaurus 2.1","authors":["slorber"],"tags":["release"],"image":"./img/social-card.png"},"unlisted":false,"lastUpdatedAt":1744155424000,"lastUpdatedBy":"Ben McCann","prevItem":{"title":"Docusaurus 2.2","permalink":"/blog/releases/2.2"},"nextItem":{"title":"Announcing Docusaurus 2.0","permalink":"/blog/2022/08/01/announcing-docusaurus-2.0"}}')}}]); \ No newline at end of file +"use strict";(self.webpackChunkwebsite=self.webpackChunkwebsite||[]).push([["59587"],{23141:function(e,n,s){s.d(n,{Z:()=>t});let t=s.p+"assets/images/social-card-8dc2413b4f9e86328bf77575e91171d7.png"},6789:function(e,n,s){s.d(n,{Z:()=>t});let t=s.p+"assets/images/doc-card-list-e52d727eadceb3d21cfc0f851f09aa93.png"},56594:function(e,n,s){s.d(n,{Z:()=>t});let t=s.p+"assets/images/social-card-8dc2413b4f9e86328bf77575e91171d7.png"},30959:function(e,n,s){s.r(n),s.d(n,{assets:()=>c,contentTitle:()=>a,default:()=>h,frontMatter:()=>r,metadata:()=>t,toc:()=>l});var t=s(46689),i=s(85893),o=s(80980);let r={title:"Docusaurus 2.1",authors:["slorber"],tags:["release"],image:"./img/social-card.png"},a=void 0,c={image:s(23141).Z,authorsImageUrls:[void 0]},l=[{value:"Highlights",id:"highlights",level:2},{value:"DocCardList improvements",id:"doccardlist-improvements",level:3},{value:" noindex
improvements",id:"noindex-improvements",level:3},{value:"Overriding default meta tags",id:"overriding-default-meta-tags",level:3},{value:"Ukrainian translations",id:"ukrainian-translations",level:3},{value:"Other changes",id:"other-changes",level:2}];function d(e){let n={a:"a",code:"code",h2:"h2",h3:"h3",img:"img",li:"li",p:"p",pre:"pre",strong:"strong",ul:"ul",...(0,o.a)(),...e.components};return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)(n.p,{children:["We are happy to announce ",(0,i.jsx)(n.strong,{children:"Docusaurus 2.1"}),", our very first minor version release."]}),"\n",(0,i.jsxs)(n.p,{children:["The upgrade should be easy: as explained in our ",(0,i.jsx)(n.a,{href:"/community/release-process",children:"release process documentation"}),", minor versions respect ",(0,i.jsx)(n.a,{href:"https://semver.org/",children:"Semantic Versioning"}),"."]}),"\n",(0,i.jsx)(n.p,{children:(0,i.jsx)(n.img,{alt:"Docusaurus 2.1 social card",src:s(56594).Z+"",width:"1200",height:"600"})}),"\n",(0,i.jsx)(n.h2,{id:"highlights",children:"Highlights"}),"\n",(0,i.jsx)(n.h3,{id:"doccardlist-improvements",children:"DocCardList improvements"}),"\n",(0,i.jsxs)(n.p,{children:["In ",(0,i.jsx)(n.a,{href:"https://github.com/facebook/docusaurus/pull/8008",children:"#8008"}),", we simplified the usage of the",(0,i.jsx)(n.code,{children:""})," component, that is notably used on sidebar category generated index pages."]}),"\n",(0,i.jsxs)(n.p,{children:["The ",(0,i.jsx)(n.code,{children:"items"})," prop is now optional, and will be automatically inferred from the content of the parent sidebar category:"]}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-diff",children:"import DocCardList from '@theme/DocCardList';\n- import {useCurrentSidebarCategory} from '@docusaurus/theme-common';\n\n- \n+ \n"})}),"\n",(0,i.jsx)(n.p,{children:"Also, we made it possible to use it on any document, including regular docs not linked to any sidebar category."}),"\n",(0,i.jsx)(n.p,{children:(0,i.jsx)(n.img,{alt:"simplified DocCardList component",src:s(6789).Z+"",width:"1062",height:"489"})}),"\n",(0,i.jsxs)(n.h3,{id:"noindex-improvements",children:[(0,i.jsx)(n.code,{children:"noindex"})," improvements"]}),"\n",(0,i.jsxs)(n.p,{children:["We improved the support of the ",(0,i.jsxs)(n.a,{href:"https://developers.google.com/search/docs/advanced/crawling/block-indexing",children:[(0,i.jsx)(n.code,{children:"noindex"})," meta ",(0,i.jsx)(n.code,{children:"robots"})," directive"]}),", a way to signal search engines you don't want a specific page to be indexed."]}),"\n",(0,i.jsxs)(n.p,{children:["In ",(0,i.jsx)(n.a,{href:"https://github.com/facebook/docusaurus/pull/7963",children:"#7963"}),", we allow ",(0,i.jsx)(n.code,{children:"noindex"})," to be configured on a per-docs-version basis."]}),"\n",(0,i.jsxs)(n.p,{children:["Use the following plugin options to tell crawlers you don't want the ",(0,i.jsx)(n.code,{children:"1.0.0"})," version to be indexed:"]}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-jsx",children:"const options = {\n versions: {\n '1.0.0': {\n noIndex: true,\n },\n },\n};\n"})}),"\n",(0,i.jsx)(n.p,{children:"In practice, Docusaurus will add the following meta to each page of that version:"}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-html",children:'\n'})}),"\n",(0,i.jsxs)(n.p,{children:["In ",(0,i.jsx)(n.a,{href:"https://github.com/facebook/docusaurus/pull/7964",children:"#7964"}),", we also fixed a bug where the sitemap plugin would still contain pages that have a ",(0,i.jsx)(n.code,{children:"noindex"})," directive. Now the sitemap plugin will reliably filter out all the pages containing ",(0,i.jsx)(n.code,{children:"noindex"})," directives."]}),"\n",(0,i.jsx)(n.h3,{id:"overriding-default-meta-tags",children:"Overriding default meta tags"}),"\n",(0,i.jsxs)(n.p,{children:["In ",(0,i.jsx)(n.a,{href:"https://github.com/facebook/docusaurus/pull/7952",children:"#7952"}),", it becomes possible to override default html meta tags you couldn't before:"]}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-jsx",children:'<>\n {siteConfig.noIndex && }\n \n>\n'})}),"\n",(0,i.jsxs)(n.p,{children:["It is now possible to use ",(0,i.jsx)(n.code,{children:""})," or ",(0,i.jsx)(n.code,{children:"themeConfig.metadata"}),":"]}),"\n",(0,i.jsxs)(n.ul,{children:["\n",(0,i.jsxs)(n.li,{children:["to override the ",(0,i.jsx)(n.code,{children:"viewport"})," meta"]}),"\n",(0,i.jsxs)(n.li,{children:["to override the ",(0,i.jsx)(n.code,{children:"robots"})," meta: you could mark your site as ",(0,i.jsx)(n.code,{children:"noIndex"}),", but except for specific pages that should be indexed"]}),"\n"]}),"\n",(0,i.jsx)(n.h3,{id:"ukrainian-translations",children:"Ukrainian translations"}),"\n",(0,i.jsxs)(n.p,{children:["In ",(0,i.jsx)(n.a,{href:"https://github.com/facebook/docusaurus/pull/7953",children:"#7953"}),", we added default classic theme translations for the Ukrainian language."]}),"\n",(0,i.jsx)(n.h2,{id:"other-changes",children:"Other changes"}),"\n",(0,i.jsxs)(n.p,{children:["Check the ",(0,i.jsx)(n.a,{href:"/changelog/2.1.0",children:"2.1.0 changelog entry"})," for an exhaustive list of changes."]})]})}function h(e={}){let{wrapper:n}={...(0,o.a)(),...e.components};return n?(0,i.jsx)(n,{...e,children:(0,i.jsx)(d,{...e})}):d(e)}},80980:function(e,n,s){s.d(n,{Z:()=>a,a:()=>r});var t=s(67294);let i={},o=t.createContext(i);function r(e){let n=t.useContext(o);return t.useMemo(function(){return"function"==typeof e?e(n):{...n,...e}},[n,e])}function a(e){let n;return n=e.disableParentContext?"function"==typeof e.components?e.components(i):e.components||i:r(e.components),t.createElement(o.Provider,{value:n},e.children)}},46689:function(e){e.exports=JSON.parse('{"permalink":"/blog/2022/09/01/docusaurus-2.1","editUrl":"https://github.com/facebook/docusaurus/edit/main/website/blog/2022/09-01-docusaurus-2.1/index.mdx","source":"@site/blog/2022/09-01-docusaurus-2.1/index.mdx","title":"Docusaurus 2.1","description":"We are happy to announce Docusaurus 2.1, our very first minor version release.","date":"2022-09-01T00:00:00.000Z","tags":[{"inline":false,"label":"Release","permalink":"/blog/tags/release","description":"Blog posts about Docusaurus\' new releases"}],"readingTime":1.725,"hasTruncateMarker":true,"authors":[{"name":"S\xe9bastien Lorber","title":"Docusaurus maintainer, This Week In React editor","url":"https://thisweekinreact.com","page":{"permalink":"/blog/authors/slorber"},"description":"A freelance React and React-Native developer near Paris and Docusaurus maintainer. Also runs ThisWeekInReact.com, a newsletter to stay updated with the React ecosystem.","socials":{"bluesky":"https://bsky.app/profile/sebastienlorber.com","x":"https://x.com/sebastienlorber","linkedin":"https://www.linkedin.com/in/sebastienlorber/","github":"https://github.com/slorber","instagram":"https://www.instagram.com/thisweekinreact","newsletter":"https://thisweekinreact.com"},"imageURL":"https://github.com/slorber.png","key":"slorber"}],"frontMatter":{"title":"Docusaurus 2.1","authors":["slorber"],"tags":["release"],"image":"./img/social-card.png"},"unlisted":false,"lastUpdatedAt":1744293302000,"lastUpdatedBy":"S\xe9bastien Lorber","prevItem":{"title":"Docusaurus 2.2","permalink":"/blog/releases/2.2"},"nextItem":{"title":"Announcing Docusaurus 2.0","permalink":"/blog/2022/08/01/announcing-docusaurus-2.0"}}')}}]); \ No newline at end of file diff --git a/assets/js/0ec69376.d5791665.js b/assets/js/0ec69376.2f34a7ad.js similarity index 63% rename from assets/js/0ec69376.d5791665.js rename to assets/js/0ec69376.2f34a7ad.js index 268a0a1017..6c2139e162 100644 --- a/assets/js/0ec69376.d5791665.js +++ b/assets/js/0ec69376.2f34a7ad.js @@ -1 +1 @@ -"use strict";(self.webpackChunkwebsite=self.webpackChunkwebsite||[]).push([["60263"],{9676:function(e,t,s){s.d(t,{Z:()=>a});let a=s.p+"assets/images/social-card-7b2ed059f27fc8b64f3f20025ebb382f.png"},24506:function(e,t,s){s.d(t,{Z:()=>a});let a=s.p+"assets/images/social-card-7b2ed059f27fc8b64f3f20025ebb382f.png"},72345:function(e,t,s){s.r(t),s.d(t,{assets:()=>c,contentTitle:()=>i,default:()=>p,frontMatter:()=>o,metadata:()=>a,toc:()=>l});var a=s(23970),n=s(85893),r=s(80980);let o={title:"Docusaurus 3.5",authors:["slorber"],tags:["release"],image:"./img/social-card.png",date:new Date("2024-08-09T00:00:00.000Z")},i=void 0,c={image:s(9676).Z,authorsImageUrls:[void 0]},l=[];function u(e){let t={a:"a",img:"img",p:"p",strong:"strong",...(0,r.a)(),...e.components};return(0,n.jsxs)(n.Fragment,{children:[(0,n.jsxs)(t.p,{children:["We are happy to announce ",(0,n.jsx)(t.strong,{children:"Docusaurus 3.5"}),"."]}),"\n",(0,n.jsxs)(t.p,{children:["This release contains many ",(0,n.jsx)(t.strong,{children:"new exciting blog features"}),"."]}),"\n",(0,n.jsxs)(t.p,{children:["Upgrading should be easy. Our ",(0,n.jsx)(t.a,{href:"/community/release-process",children:"release process"})," respects ",(0,n.jsx)(t.a,{href:"https://semver.org/",children:"Semantic Versioning"}),". Minor versions do not include any breaking changes."]}),"\n",(0,n.jsx)(t.p,{children:(0,n.jsx)(t.img,{alt:"Docusaurus blog post social card",src:s(24506).Z+"",width:"1200",height:"600"})})]})}function p(e={}){let{wrapper:t}={...(0,r.a)(),...e.components};return t?(0,n.jsx)(t,{...e,children:(0,n.jsx)(u,{...e})}):u(e)}},80980:function(e,t,s){s.d(t,{Z:()=>i,a:()=>o});var a=s(67294);let n={},r=a.createContext(n);function o(e){let t=a.useContext(r);return a.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(n):e.components||n:o(e.components),a.createElement(r.Provider,{value:t},e.children)}},23970:function(e){e.exports=JSON.parse('{"permalink":"/blog/releases/3.5","editUrl":"https://github.com/facebook/docusaurus/edit/main/website/blog/releases/3.5/index.mdx","source":"@site/blog/releases/3.5/index.mdx","title":"Docusaurus 3.5","description":"We are happy to announce Docusaurus 3.5.","date":"2024-08-09T00:00:00.000Z","tags":[{"inline":false,"label":"Release","permalink":"/blog/tags/release","description":"Blog posts about Docusaurus\' new releases"}],"readingTime":3.91,"hasTruncateMarker":true,"authors":[{"name":"S\xe9bastien Lorber","title":"Docusaurus maintainer, This Week In React editor","url":"https://thisweekinreact.com","page":{"permalink":"/blog/authors/slorber"},"description":"A freelance React and React-Native developer near Paris and Docusaurus maintainer. Also runs ThisWeekInReact.com, a newsletter to stay updated with the React ecosystem.","socials":{"bluesky":"https://bsky.app/profile/sebastienlorber.com","x":"https://x.com/sebastienlorber","linkedin":"https://www.linkedin.com/in/sebastienlorber/","github":"https://github.com/slorber","instagram":"https://www.instagram.com/thisweekinreact","newsletter":"https://thisweekinreact.com"},"imageURL":"https://github.com/slorber.png","key":"slorber"}],"frontMatter":{"title":"Docusaurus 3.5","authors":["slorber"],"tags":["release"],"image":"./img/social-card.png","date":"2024-08-09T00:00:00.000Z"},"unlisted":false,"lastUpdatedAt":1744155424000,"lastUpdatedBy":"Ben McCann","prevItem":{"title":"Docusaurus 3.6","permalink":"/blog/releases/3.6"},"nextItem":{"title":"Docusaurus 3.4","permalink":"/blog/releases/3.4"}}')}}]); \ No newline at end of file +"use strict";(self.webpackChunkwebsite=self.webpackChunkwebsite||[]).push([["60263"],{9676:function(e,t,s){s.d(t,{Z:()=>a});let a=s.p+"assets/images/social-card-7b2ed059f27fc8b64f3f20025ebb382f.png"},24506:function(e,t,s){s.d(t,{Z:()=>a});let a=s.p+"assets/images/social-card-7b2ed059f27fc8b64f3f20025ebb382f.png"},72345:function(e,t,s){s.r(t),s.d(t,{assets:()=>c,contentTitle:()=>i,default:()=>p,frontMatter:()=>o,metadata:()=>a,toc:()=>l});var a=s(23970),r=s(85893),n=s(80980);let o={title:"Docusaurus 3.5",authors:["slorber"],tags:["release"],image:"./img/social-card.png",date:new Date("2024-08-09T00:00:00.000Z")},i=void 0,c={image:s(9676).Z,authorsImageUrls:[void 0]},l=[];function u(e){let t={a:"a",img:"img",p:"p",strong:"strong",...(0,n.a)(),...e.components};return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsxs)(t.p,{children:["We are happy to announce ",(0,r.jsx)(t.strong,{children:"Docusaurus 3.5"}),"."]}),"\n",(0,r.jsxs)(t.p,{children:["This release contains many ",(0,r.jsx)(t.strong,{children:"new exciting blog features"}),"."]}),"\n",(0,r.jsxs)(t.p,{children:["Upgrading should be easy. Our ",(0,r.jsx)(t.a,{href:"/community/release-process",children:"release process"})," respects ",(0,r.jsx)(t.a,{href:"https://semver.org/",children:"Semantic Versioning"}),". Minor versions do not include any breaking changes."]}),"\n",(0,r.jsx)(t.p,{children:(0,r.jsx)(t.img,{alt:"Docusaurus blog post social card",src:s(24506).Z+"",width:"1200",height:"600"})})]})}function p(e={}){let{wrapper:t}={...(0,n.a)(),...e.components};return t?(0,r.jsx)(t,{...e,children:(0,r.jsx)(u,{...e})}):u(e)}},80980:function(e,t,s){s.d(t,{Z:()=>i,a:()=>o});var a=s(67294);let r={},n=a.createContext(r);function o(e){let t=a.useContext(n);return a.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),a.createElement(n.Provider,{value:t},e.children)}},23970:function(e){e.exports=JSON.parse('{"permalink":"/blog/releases/3.5","editUrl":"https://github.com/facebook/docusaurus/edit/main/website/blog/releases/3.5/index.mdx","source":"@site/blog/releases/3.5/index.mdx","title":"Docusaurus 3.5","description":"We are happy to announce Docusaurus 3.5.","date":"2024-08-09T00:00:00.000Z","tags":[{"inline":false,"label":"Release","permalink":"/blog/tags/release","description":"Blog posts about Docusaurus\' new releases"}],"readingTime":3.91,"hasTruncateMarker":true,"authors":[{"name":"S\xe9bastien Lorber","title":"Docusaurus maintainer, This Week In React editor","url":"https://thisweekinreact.com","page":{"permalink":"/blog/authors/slorber"},"description":"A freelance React and React-Native developer near Paris and Docusaurus maintainer. Also runs ThisWeekInReact.com, a newsletter to stay updated with the React ecosystem.","socials":{"bluesky":"https://bsky.app/profile/sebastienlorber.com","x":"https://x.com/sebastienlorber","linkedin":"https://www.linkedin.com/in/sebastienlorber/","github":"https://github.com/slorber","instagram":"https://www.instagram.com/thisweekinreact","newsletter":"https://thisweekinreact.com"},"imageURL":"https://github.com/slorber.png","key":"slorber"}],"frontMatter":{"title":"Docusaurus 3.5","authors":["slorber"],"tags":["release"],"image":"./img/social-card.png","date":"2024-08-09T00:00:00.000Z"},"unlisted":false,"lastUpdatedAt":1744293302000,"lastUpdatedBy":"S\xe9bastien Lorber","prevItem":{"title":"Docusaurus 3.6","permalink":"/blog/releases/3.6"},"nextItem":{"title":"Docusaurus 3.4","permalink":"/blog/releases/3.4"}}')}}]); \ No newline at end of file diff --git a/assets/js/1267474e.81d94305.js b/assets/js/1267474e.81d94305.js new file mode 100644 index 0000000000..525e4f80d7 --- /dev/null +++ b/assets/js/1267474e.81d94305.js @@ -0,0 +1 @@ +"use strict";(self.webpackChunkwebsite=self.webpackChunkwebsite||[]).push([["7390"],{46597:function(e,t,n){n.r(t),n.d(t,{frontMatter:()=>l,default:()=>m,contentTitle:()=>d,assets:()=>c,toc:()=>u,metadata:()=>r});var r=JSON.parse('{"id":"migration/v2/migration-automated","title":"Automated migration","description":"The migration CLI automatically migrates your v1 website to a v2 website.","source":"@site/docs/migration/v2/migration-automated.mdx","sourceDirName":"migration/v2","slug":"/migration/v2/automated","permalink":"/docs/migration/v2/automated","draft":false,"unlisted":false,"editUrl":"https://github.com/facebook/docusaurus/edit/main/website/docs/migration/v2/migration-automated.mdx","tags":[],"version":"current","lastUpdatedBy":"S\xe9bastien Lorber","lastUpdatedAt":1744293302000,"frontMatter":{"slug":"/migration/v2/automated"},"sidebar":"docs","previous":{"title":"Overview","permalink":"/docs/migration/v2"},"next":{"title":"Manual migration","permalink":"/docs/migration/v2/manual"}}'),a=n(85893),i=n(80980),s=n(15398),o=n(58636);let l={slug:"/migration/v2/automated"},d="Automated migration",c={},u=[{value:"Options",id:"options",level:4}];function h(e){let t={admonition:"admonition",code:"code",h1:"h1",h4:"h4",header:"header",li:"li",ol:"ol",p:"p",pre:"pre",table:"table",tbody:"tbody",td:"td",th:"th",thead:"thead",tr:"tr",ul:"ul",...(0,i.a)(),...e.components};return(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(t.header,{children:(0,a.jsx)(t.h1,{id:"automated-migration",children:"Automated migration"})}),"\n",(0,a.jsx)(t.p,{children:"The migration CLI automatically migrates your v1 website to a v2 website."}),"\n",(0,a.jsx)(t.admonition,{type:"info",children:(0,a.jsx)(t.p,{children:"Manual work is still required after using the migration CLI, as we can't automate a full migration"})}),"\n",(0,a.jsx)(t.p,{children:"The migration CLI migrates:"}),"\n",(0,a.jsxs)(t.ul,{children:["\n",(0,a.jsxs)(t.li,{children:["Site configurations (from ",(0,a.jsx)(t.code,{children:"siteConfig.js"})," to ",(0,a.jsx)(t.code,{children:"docusaurus.config.js"}),")"]}),"\n",(0,a.jsx)(t.li,{children:(0,a.jsx)(t.code,{children:"package.json"})}),"\n",(0,a.jsx)(t.li,{children:(0,a.jsx)(t.code,{children:"sidebars.json"})}),"\n",(0,a.jsx)(t.li,{children:(0,a.jsx)(t.code,{children:"/docs"})}),"\n",(0,a.jsx)(t.li,{children:(0,a.jsx)(t.code,{children:"/blog"})}),"\n",(0,a.jsx)(t.li,{children:(0,a.jsx)(t.code,{children:"/static"})}),"\n",(0,a.jsxs)(t.li,{children:[(0,a.jsx)(t.code,{children:"versioned_sidebar.json"})," and ",(0,a.jsx)(t.code,{children:"/versioned_docs"})," if your site uses versioning"]}),"\n"]}),"\n",(0,a.jsx)(t.p,{children:"To use the migration CLI, follow these steps:"}),"\n",(0,a.jsxs)(t.ol,{children:["\n",(0,a.jsxs)(t.li,{children:["\n",(0,a.jsxs)(t.p,{children:["Before using the migration CLI, ensure that ",(0,a.jsx)(t.code,{children:"/docs"}),", ",(0,a.jsx)(t.code,{children:"/blog"}),", ",(0,a.jsx)(t.code,{children:"/static"}),", ",(0,a.jsx)(t.code,{children:"sidebars.json"}),", ",(0,a.jsx)(t.code,{children:"siteConfig.js"}),", ",(0,a.jsx)(t.code,{children:"package.json"})," follow the expected structure."]}),"\n"]}),"\n",(0,a.jsxs)(t.li,{children:["\n",(0,a.jsx)(t.p,{children:"To migrate your v1 website, run the migration CLI with the appropriate filesystem paths:"}),"\n"]}),"\n"]}),"\n",(0,a.jsx)(t.pre,{children:(0,a.jsx)(t.code,{className:"language-bash",children:"# migration command format\nnpx @docusaurus/migrate migrate \n\n# example\nnpx @docusaurus/migrate migrate ./v1-website ./v2-website\n"})}),"\n",(0,a.jsxs)(t.ol,{start:"3",children:["\n",(0,a.jsx)(t.li,{children:"To view your new website locally, go into your v2 website's directory and start your development server."}),"\n"]}),"\n",(0,a.jsxs)(s.Z,{groupId:"npm2yarn",children:[(0,a.jsx)(o.Z,{value:"npm",children:(0,a.jsx)(t.pre,{children:(0,a.jsx)(t.code,{className:"language-bash",children:"cd ./v2-website\nnpm install\nnpm start\n"})})}),(0,a.jsx)(o.Z,{value:"yarn",label:"Yarn",children:(0,a.jsx)(t.pre,{children:(0,a.jsx)(t.code,{className:"language-bash",children:"cd ./v2-website\nyarn install\nyarn start\n"})})}),(0,a.jsx)(o.Z,{value:"pnpm",label:"pnpm",children:(0,a.jsx)(t.pre,{children:(0,a.jsx)(t.code,{className:"language-bash",children:"cd ./v2-website\npnpm install\npnpm start\n"})})}),(0,a.jsx)(o.Z,{value:"bun",label:"Bun",children:(0,a.jsx)(t.pre,{children:(0,a.jsx)(t.code,{className:"language-bash",children:"cd ./v2-website\nbun install\nbun start\n"})})})]}),"\n",(0,a.jsx)(t.admonition,{type:"danger",children:(0,a.jsx)(t.p,{children:"The migration CLI updates existing files. Be sure to have committed them first!"})}),"\n",(0,a.jsx)(t.h4,{id:"options",children:"Options"}),"\n",(0,a.jsx)(t.p,{children:"You can add option flags to the migration CLI to automatically migrate Markdown content and pages to v2. It is likely that you will still need to make some manual changes to achieve your desired result."}),"\n",(0,a.jsxs)(t.table,{children:[(0,a.jsx)(t.thead,{children:(0,a.jsxs)(t.tr,{children:[(0,a.jsx)(t.th,{children:"Name"}),(0,a.jsx)(t.th,{children:"Description"})]})}),(0,a.jsxs)(t.tbody,{children:[(0,a.jsxs)(t.tr,{children:[(0,a.jsx)(t.td,{children:(0,a.jsx)(t.code,{children:"--mdx"})}),(0,a.jsx)(t.td,{children:"Add this flag to convert Markdown to MDX automatically"})]}),(0,a.jsxs)(t.tr,{children:[(0,a.jsx)(t.td,{children:(0,a.jsx)(t.code,{children:"--page"})}),(0,a.jsx)(t.td,{children:"Add this flag to migrate pages automatically"})]})]})]}),"\n",(0,a.jsx)(t.pre,{children:(0,a.jsx)(t.code,{className:"language-bash",children:"# example using options\nnpx @docusaurus/migrate migrate --mdx --page ./v1-website ./v2-website\n"})}),"\n",(0,a.jsxs)(t.admonition,{type:"danger",children:[(0,a.jsx)(t.p,{children:"The migration of pages and MDX is still a work in progress."}),(0,a.jsxs)(t.p,{children:["We recommend you to try to run the pages without these options, commit, and then try to run the migration again with the ",(0,a.jsx)(t.code,{children:"--page"})," and ",(0,a.jsx)(t.code,{children:"--mdx"})," options."]}),(0,a.jsx)(t.p,{children:"This way, you'd be able to easily inspect and fix the diff."})]})]})}function m(e={}){let{wrapper:t}={...(0,i.a)(),...e.components};return t?(0,a.jsx)(t,{...e,children:(0,a.jsx)(h,{...e})}):h(e)}},58636:function(e,t,n){n.d(t,{Z:()=>i});var r=n(85893);n(67294);var a=n(90496);function i(e){let{children:t,hidden:n,className:i}=e;return(0,r.jsx)("div",{role:"tabpanel",className:(0,a.Z)("tabItem_pnkT",i),hidden:n,children:t})}},15398:function(e,t,n){n.d(t,{Z:()=>f});var r=n(85893),a=n(67294),i=n(90496),s=n(54947),o=n(3620),l=n(844),d=n(97486),c=n(32263),u=n(16971);function h(e){return a.Children.toArray(e).filter(e=>"\n"!==e).map(e=>{if(!e||(0,a.isValidElement)(e)&&function(e){let{props:t}=e;return!!t&&"object"==typeof t&&"value"in t}(e))return e;throw Error(`Docusaurus error: Bad child <${"string"==typeof e.type?e.type:e.type.name}>: all children of the component should be , and every should have a unique "value" prop.`)})?.filter(Boolean)??[]}function m(e){let{value:t,tabValues:n}=e;return n.some(e=>e.value===t)}var p=n(71607);function x(e){let{className:t,block:n,selectedValue:a,selectValue:o,tabValues:l}=e,d=[],{blockElementScrollPositionUntilNextRender:c}=(0,s.o5)(),u=e=>{let t=e.currentTarget,n=l[d.indexOf(t)].value;n!==a&&(c(t),o(n))},h=e=>{let t=null;switch(e.key){case"Enter":u(e);break;case"ArrowRight":{let n=d.indexOf(e.currentTarget)+1;t=d[n]??d[0];break}case"ArrowLeft":{let n=d.indexOf(e.currentTarget)-1;t=d[n]??d[d.length-1]}}t?.focus()};return(0,r.jsx)("ul",{role:"tablist","aria-orientation":"horizontal",className:(0,i.Z)("tabs",{"tabs--block":n},t),children:l.map(e=>{let{value:t,label:n,attributes:s}=e;return(0,r.jsx)("li",{role:"tab",tabIndex:a===t?0:-1,"aria-selected":a===t,ref:e=>{d.push(e)},onKeyDown:h,onClick:u,...s,className:(0,i.Z)("tabs__item","tabItem_AQgk",s?.className,{"tabs__item--active":a===t}),children:n??t},t)})})}function g(e){let{lazy:t,children:n,selectedValue:s}=e,o=(Array.isArray(n)?n:[n]).filter(Boolean);if(t){let e=o.find(e=>e.props.value===s);return e?(0,a.cloneElement)(e,{className:(0,i.Z)("margin-top--md",e.props.className)}):null}return(0,r.jsx)("div",{className:"margin-top--md",children:o.map((e,t)=>(0,a.cloneElement)(e,{key:t,hidden:e.props.value!==s}))})}function j(e){let t=function(e){let{defaultValue:t,queryString:n=!1,groupId:r}=e,i=function(e){let{values:t,children:n}=e;return(0,a.useMemo)(()=>{let e=t??h(n).map(e=>{let{props:{value:t,label:n,attributes:r,default:a}}=e;return{value:t,label:n,attributes:r,default:a}}),r=(0,c.lx)(e,(e,t)=>e.value===t.value);if(r.length>0)throw Error(`Docusaurus error: Duplicate values "${r.map(e=>e.value).join(", ")}" found in . Every value needs to be unique.`);return e},[t,n])}(e),[s,p]=(0,a.useState)(()=>(function(e){let{defaultValue:t,tabValues:n}=e;if(0===n.length)throw Error("Docusaurus error: the component requires at least one children component");if(t){if(!m({value:t,tabValues:n}))throw Error(`Docusaurus error: The has a defaultValue "${t}" but none of its children has the corresponding value. Available values are: ${n.map(e=>e.value).join(", ")}. If you intend to show no default tab, use defaultValue={null} instead.`);return t}let r=n.find(e=>e.default)??n[0];if(!r)throw Error("Unexpected error: 0 tabValues");return r.value})({defaultValue:t,tabValues:i})),[x,g]=function(e){let{queryString:t=!1,groupId:n}=e,r=(0,o.k6)(),i=function(e){let{queryString:t=!1,groupId:n}=e;if("string"==typeof t)return t;if(!1===t)return null;if(!0===t&&!n)throw Error('Docusaurus error: The component groupId prop is required if queryString=true, because this value is used as the search param name. You can also provide an explicit value such as queryString="my-search-param".');return n??null}({queryString:t,groupId:n});return[(0,d._X)(i),(0,a.useCallback)(e=>{if(!i)return;let t=new URLSearchParams(r.location.search);t.set(i,e),r.replace({...r.location,search:t.toString()})},[i,r])]}({queryString:n,groupId:r}),[j,f]=function(e){let{groupId:t}=e,n=t?`docusaurus.tab.${t}`:null,[r,i]=(0,u.Nk)(n);return[r,(0,a.useCallback)(e=>{n&&i.set(e)},[n,i])]}({groupId:r}),b=(()=>{let e=x??j;return m({value:e,tabValues:i})?e:null})();return(0,l.Z)(()=>{b&&p(b)},[b]),{selectedValue:s,selectValue:(0,a.useCallback)(e=>{if(!m({value:e,tabValues:i}))throw Error(`Can't select invalid tab value=${e}`);p(e),g(e),f(e)},[g,f,i]),tabValues:i}}(e);return(0,r.jsxs)("div",{className:(0,i.Z)("tabs-container","tabList_Qoir"),children:[(0,r.jsx)(x,{...t,...e}),(0,r.jsx)(g,{...t,...e})]})}function f(e){let t=(0,p.Z)();return(0,r.jsx)(j,{...e,children:h(e.children)},String(t))}},80980:function(e,t,n){n.d(t,{Z:()=>o,a:()=>s});var r=n(67294);let a={},i=r.createContext(a);function s(e){let t=r.useContext(i);return r.useMemo(function(){return"function"==typeof e?e(t):{...t,...e}},[t,e])}function o(e){let t;return t=e.disableParentContext?"function"==typeof e.components?e.components(a):e.components||a:s(e.components),r.createElement(i.Provider,{value:t},e.children)}}}]); \ No newline at end of file diff --git a/assets/js/1267474e.a457eb9d.js b/assets/js/1267474e.a457eb9d.js deleted file mode 100644 index dc66a1bbae..0000000000 --- a/assets/js/1267474e.a457eb9d.js +++ /dev/null @@ -1 +0,0 @@ -"use strict";(self.webpackChunkwebsite=self.webpackChunkwebsite||[]).push([["7390"],{46597:function(e,t,n){n.r(t),n.d(t,{frontMatter:()=>l,default:()=>m,contentTitle:()=>d,assets:()=>c,toc:()=>u,metadata:()=>r});var r=JSON.parse('{"id":"migration/v2/migration-automated","title":"Automated migration","description":"The migration CLI automatically migrates your v1 website to a v2 website.","source":"@site/docs/migration/v2/migration-automated.mdx","sourceDirName":"migration/v2","slug":"/migration/v2/automated","permalink":"/docs/migration/v2/automated","draft":false,"unlisted":false,"editUrl":"https://github.com/facebook/docusaurus/edit/main/website/docs/migration/v2/migration-automated.mdx","tags":[],"version":"current","lastUpdatedBy":"Ben McCann","lastUpdatedAt":1744155424000,"frontMatter":{"slug":"/migration/v2/automated"},"sidebar":"docs","previous":{"title":"Overview","permalink":"/docs/migration/v2"},"next":{"title":"Manual migration","permalink":"/docs/migration/v2/manual"}}'),a=n(85893),i=n(80980),s=n(15398),o=n(58636);let l={slug:"/migration/v2/automated"},d="Automated migration",c={},u=[{value:"Options",id:"options",level:4}];function h(e){let t={admonition:"admonition",code:"code",h1:"h1",h4:"h4",header:"header",li:"li",ol:"ol",p:"p",pre:"pre",table:"table",tbody:"tbody",td:"td",th:"th",thead:"thead",tr:"tr",ul:"ul",...(0,i.a)(),...e.components};return(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(t.header,{children:(0,a.jsx)(t.h1,{id:"automated-migration",children:"Automated migration"})}),"\n",(0,a.jsx)(t.p,{children:"The migration CLI automatically migrates your v1 website to a v2 website."}),"\n",(0,a.jsx)(t.admonition,{type:"info",children:(0,a.jsx)(t.p,{children:"Manual work is still required after using the migration CLI, as we can't automate a full migration"})}),"\n",(0,a.jsx)(t.p,{children:"The migration CLI migrates:"}),"\n",(0,a.jsxs)(t.ul,{children:["\n",(0,a.jsxs)(t.li,{children:["Site configurations (from ",(0,a.jsx)(t.code,{children:"siteConfig.js"})," to ",(0,a.jsx)(t.code,{children:"docusaurus.config.js"}),")"]}),"\n",(0,a.jsx)(t.li,{children:(0,a.jsx)(t.code,{children:"package.json"})}),"\n",(0,a.jsx)(t.li,{children:(0,a.jsx)(t.code,{children:"sidebars.json"})}),"\n",(0,a.jsx)(t.li,{children:(0,a.jsx)(t.code,{children:"/docs"})}),"\n",(0,a.jsx)(t.li,{children:(0,a.jsx)(t.code,{children:"/blog"})}),"\n",(0,a.jsx)(t.li,{children:(0,a.jsx)(t.code,{children:"/static"})}),"\n",(0,a.jsxs)(t.li,{children:[(0,a.jsx)(t.code,{children:"versioned_sidebar.json"})," and ",(0,a.jsx)(t.code,{children:"/versioned_docs"})," if your site uses versioning"]}),"\n"]}),"\n",(0,a.jsx)(t.p,{children:"To use the migration CLI, follow these steps:"}),"\n",(0,a.jsxs)(t.ol,{children:["\n",(0,a.jsxs)(t.li,{children:["\n",(0,a.jsxs)(t.p,{children:["Before using the migration CLI, ensure that ",(0,a.jsx)(t.code,{children:"/docs"}),", ",(0,a.jsx)(t.code,{children:"/blog"}),", ",(0,a.jsx)(t.code,{children:"/static"}),", ",(0,a.jsx)(t.code,{children:"sidebars.json"}),", ",(0,a.jsx)(t.code,{children:"siteConfig.js"}),", ",(0,a.jsx)(t.code,{children:"package.json"})," follow the expected structure."]}),"\n"]}),"\n",(0,a.jsxs)(t.li,{children:["\n",(0,a.jsx)(t.p,{children:"To migrate your v1 website, run the migration CLI with the appropriate filesystem paths:"}),"\n"]}),"\n"]}),"\n",(0,a.jsx)(t.pre,{children:(0,a.jsx)(t.code,{className:"language-bash",children:"# migration command format\nnpx @docusaurus/migrate migrate \n\n# example\nnpx @docusaurus/migrate migrate ./v1-website ./v2-website\n"})}),"\n",(0,a.jsxs)(t.ol,{start:"3",children:["\n",(0,a.jsx)(t.li,{children:"To view your new website locally, go into your v2 website's directory and start your development server."}),"\n"]}),"\n",(0,a.jsxs)(s.Z,{groupId:"npm2yarn",children:[(0,a.jsx)(o.Z,{value:"npm",children:(0,a.jsx)(t.pre,{children:(0,a.jsx)(t.code,{className:"language-bash",children:"cd ./v2-website\nnpm install\nnpm start\n"})})}),(0,a.jsx)(o.Z,{value:"yarn",label:"Yarn",children:(0,a.jsx)(t.pre,{children:(0,a.jsx)(t.code,{className:"language-bash",children:"cd ./v2-website\nyarn install\nyarn start\n"})})}),(0,a.jsx)(o.Z,{value:"pnpm",label:"pnpm",children:(0,a.jsx)(t.pre,{children:(0,a.jsx)(t.code,{className:"language-bash",children:"cd ./v2-website\npnpm install\npnpm start\n"})})}),(0,a.jsx)(o.Z,{value:"bun",label:"Bun",children:(0,a.jsx)(t.pre,{children:(0,a.jsx)(t.code,{className:"language-bash",children:"cd ./v2-website\nbun install\nbun start\n"})})})]}),"\n",(0,a.jsx)(t.admonition,{type:"danger",children:(0,a.jsx)(t.p,{children:"The migration CLI updates existing files. Be sure to have committed them first!"})}),"\n",(0,a.jsx)(t.h4,{id:"options",children:"Options"}),"\n",(0,a.jsx)(t.p,{children:"You can add option flags to the migration CLI to automatically migrate Markdown content and pages to v2. It is likely that you will still need to make some manual changes to achieve your desired result."}),"\n",(0,a.jsxs)(t.table,{children:[(0,a.jsx)(t.thead,{children:(0,a.jsxs)(t.tr,{children:[(0,a.jsx)(t.th,{children:"Name"}),(0,a.jsx)(t.th,{children:"Description"})]})}),(0,a.jsxs)(t.tbody,{children:[(0,a.jsxs)(t.tr,{children:[(0,a.jsx)(t.td,{children:(0,a.jsx)(t.code,{children:"--mdx"})}),(0,a.jsx)(t.td,{children:"Add this flag to convert Markdown to MDX automatically"})]}),(0,a.jsxs)(t.tr,{children:[(0,a.jsx)(t.td,{children:(0,a.jsx)(t.code,{children:"--page"})}),(0,a.jsx)(t.td,{children:"Add this flag to migrate pages automatically"})]})]})]}),"\n",(0,a.jsx)(t.pre,{children:(0,a.jsx)(t.code,{className:"language-bash",children:"# example using options\nnpx @docusaurus/migrate migrate --mdx --page ./v1-website ./v2-website\n"})}),"\n",(0,a.jsxs)(t.admonition,{type:"danger",children:[(0,a.jsx)(t.p,{children:"The migration of pages and MDX is still a work in progress."}),(0,a.jsxs)(t.p,{children:["We recommend you to try to run the pages without these options, commit, and then try to run the migration again with the ",(0,a.jsx)(t.code,{children:"--page"})," and ",(0,a.jsx)(t.code,{children:"--mdx"})," options."]}),(0,a.jsx)(t.p,{children:"This way, you'd be able to easily inspect and fix the diff."})]})]})}function m(e={}){let{wrapper:t}={...(0,i.a)(),...e.components};return t?(0,a.jsx)(t,{...e,children:(0,a.jsx)(h,{...e})}):h(e)}},58636:function(e,t,n){n.d(t,{Z:()=>i});var r=n(85893);n(67294);var a=n(90496);function i(e){let{children:t,hidden:n,className:i}=e;return(0,r.jsx)("div",{role:"tabpanel",className:(0,a.Z)("tabItem_pnkT",i),hidden:n,children:t})}},15398:function(e,t,n){n.d(t,{Z:()=>f});var r=n(85893),a=n(67294),i=n(90496),s=n(54947),o=n(3620),l=n(844),d=n(97486),c=n(32263),u=n(16971);function h(e){return a.Children.toArray(e).filter(e=>"\n"!==e).map(e=>{if(!e||(0,a.isValidElement)(e)&&function(e){let{props:t}=e;return!!t&&"object"==typeof t&&"value"in t}(e))return e;throw Error(`Docusaurus error: Bad child <${"string"==typeof e.type?e.type:e.type.name}>: all children of the component should be , and every should have a unique "value" prop.`)})?.filter(Boolean)??[]}function m(e){let{value:t,tabValues:n}=e;return n.some(e=>e.value===t)}var p=n(71607);function x(e){let{className:t,block:n,selectedValue:a,selectValue:o,tabValues:l}=e,d=[],{blockElementScrollPositionUntilNextRender:c}=(0,s.o5)(),u=e=>{let t=e.currentTarget,n=l[d.indexOf(t)].value;n!==a&&(c(t),o(n))},h=e=>{let t=null;switch(e.key){case"Enter":u(e);break;case"ArrowRight":{let n=d.indexOf(e.currentTarget)+1;t=d[n]??d[0];break}case"ArrowLeft":{let n=d.indexOf(e.currentTarget)-1;t=d[n]??d[d.length-1]}}t?.focus()};return(0,r.jsx)("ul",{role:"tablist","aria-orientation":"horizontal",className:(0,i.Z)("tabs",{"tabs--block":n},t),children:l.map(e=>{let{value:t,label:n,attributes:s}=e;return(0,r.jsx)("li",{role:"tab",tabIndex:a===t?0:-1,"aria-selected":a===t,ref:e=>{d.push(e)},onKeyDown:h,onClick:u,...s,className:(0,i.Z)("tabs__item","tabItem_AQgk",s?.className,{"tabs__item--active":a===t}),children:n??t},t)})})}function g(e){let{lazy:t,children:n,selectedValue:s}=e,o=(Array.isArray(n)?n:[n]).filter(Boolean);if(t){let e=o.find(e=>e.props.value===s);return e?(0,a.cloneElement)(e,{className:(0,i.Z)("margin-top--md",e.props.className)}):null}return(0,r.jsx)("div",{className:"margin-top--md",children:o.map((e,t)=>(0,a.cloneElement)(e,{key:t,hidden:e.props.value!==s}))})}function j(e){let t=function(e){let{defaultValue:t,queryString:n=!1,groupId:r}=e,i=function(e){let{values:t,children:n}=e;return(0,a.useMemo)(()=>{let e=t??h(n).map(e=>{let{props:{value:t,label:n,attributes:r,default:a}}=e;return{value:t,label:n,attributes:r,default:a}}),r=(0,c.lx)(e,(e,t)=>e.value===t.value);if(r.length>0)throw Error(`Docusaurus error: Duplicate values "${r.map(e=>e.value).join(", ")}" found in . Every value needs to be unique.`);return e},[t,n])}(e),[s,p]=(0,a.useState)(()=>(function(e){let{defaultValue:t,tabValues:n}=e;if(0===n.length)throw Error("Docusaurus error: the component requires at least one children component");if(t){if(!m({value:t,tabValues:n}))throw Error(`Docusaurus error: The has a defaultValue "${t}" but none of its children has the corresponding value. Available values are: ${n.map(e=>e.value).join(", ")}. If you intend to show no default tab, use defaultValue={null} instead.`);return t}let r=n.find(e=>e.default)??n[0];if(!r)throw Error("Unexpected error: 0 tabValues");return r.value})({defaultValue:t,tabValues:i})),[x,g]=function(e){let{queryString:t=!1,groupId:n}=e,r=(0,o.k6)(),i=function(e){let{queryString:t=!1,groupId:n}=e;if("string"==typeof t)return t;if(!1===t)return null;if(!0===t&&!n)throw Error('Docusaurus error: The component groupId prop is required if queryString=true, because this value is used as the search param name. You can also provide an explicit value such as queryString="my-search-param".');return n??null}({queryString:t,groupId:n});return[(0,d._X)(i),(0,a.useCallback)(e=>{if(!i)return;let t=new URLSearchParams(r.location.search);t.set(i,e),r.replace({...r.location,search:t.toString()})},[i,r])]}({queryString:n,groupId:r}),[j,f]=function(e){let{groupId:t}=e,n=t?`docusaurus.tab.${t}`:null,[r,i]=(0,u.Nk)(n);return[r,(0,a.useCallback)(e=>{n&&i.set(e)},[n,i])]}({groupId:r}),b=(()=>{let e=x??j;return m({value:e,tabValues:i})?e:null})();return(0,l.Z)(()=>{b&&p(b)},[b]),{selectedValue:s,selectValue:(0,a.useCallback)(e=>{if(!m({value:e,tabValues:i}))throw Error(`Can't select invalid tab value=${e}`);p(e),g(e),f(e)},[g,f,i]),tabValues:i}}(e);return(0,r.jsxs)("div",{className:(0,i.Z)("tabs-container","tabList_Qoir"),children:[(0,r.jsx)(x,{...t,...e}),(0,r.jsx)(g,{...t,...e})]})}function f(e){let t=(0,p.Z)();return(0,r.jsx)(j,{...e,children:h(e.children)},String(t))}},80980:function(e,t,n){n.d(t,{Z:()=>o,a:()=>s});var r=n(67294);let a={},i=r.createContext(a);function s(e){let t=r.useContext(i);return r.useMemo(function(){return"function"==typeof e?e(t):{...t,...e}},[t,e])}function o(e){let t;return t=e.disableParentContext?"function"==typeof e.components?e.components(a):e.components||a:s(e.components),r.createElement(i.Provider,{value:t},e.children)}}}]); \ No newline at end of file diff --git a/assets/js/138ea42e.dfc0e634.js b/assets/js/138ea42e.58988c16.js similarity index 90% rename from assets/js/138ea42e.dfc0e634.js rename to assets/js/138ea42e.58988c16.js index 2b8e3451f4..3c841fa9a3 100644 --- a/assets/js/138ea42e.dfc0e634.js +++ b/assets/js/138ea42e.58988c16.js @@ -1 +1 @@ -"use strict";(self.webpackChunkwebsite=self.webpackChunkwebsite||[]).push([["18796"],{54941:function(e,t,a){a.r(t),a.d(t,{assets:()=>u,contentTitle:()=>r,default:()=>d,frontMatter:()=>i,metadata:()=>s,toc:()=>l});var s=a(50457),n=a(85893),o=a(80980);let i={title:"Towards Docusaurus 2",authors:"endiliey",tags:["new","adoption"]},r=void 0,u={authorsImageUrls:[void 0]},l=[];function c(e){let t={a:"a",p:"p",...(0,o.a)(),...e.components};return(0,n.jsxs)(n.Fragment,{children:[(0,n.jsxs)(t.p,{children:["Docusaurus was ",(0,n.jsx)(t.a,{href:"https://v1.docusaurus.io/blog/2017/12/14/introducing-docusaurus",children:"officially announced"})," over nine months ago as a way to easily build open source documentation websites. Since then, it has amassed over 8,600 GitHub Stars, and is used by many popular open source projects such as ",(0,n.jsx)(t.a,{href:"https://facebook.github.io/react-native/",children:"React Native"}),", ",(0,n.jsx)(t.a,{href:"https://babeljs.io/",children:"Babel"}),", ",(0,n.jsx)(t.a,{href:"https://jestjs.io/",children:"Jest"}),", ",(0,n.jsx)(t.a,{href:"https://reasonml.github.io/",children:"Reason"})," and ",(0,n.jsx)(t.a,{href:"https://prettier.io/",children:"Prettier"}),"."]}),"\n",(0,n.jsx)(t.p,{children:"There is a saying that the very best software is constantly evolving, and the very worst is not. In case you are not aware, we have been planning and working on the next version of Docusaurus \uD83C\uDF89."})]})}function d(e={}){let{wrapper:t}={...(0,o.a)(),...e.components};return t?(0,n.jsx)(t,{...e,children:(0,n.jsx)(c,{...e})}):c(e)}},80980:function(e,t,a){a.d(t,{Z:()=>r,a:()=>i});var s=a(67294);let n={},o=s.createContext(n);function i(e){let t=s.useContext(o);return s.useMemo(function(){return"function"==typeof e?e(t):{...t,...e}},[t,e])}function r(e){let t;return t=e.disableParentContext?"function"==typeof e.components?e.components(n):e.components||n:i(e.components),s.createElement(o.Provider,{value:t},e.children)}},50457:function(e){e.exports=JSON.parse('{"permalink":"/blog/2018/09/11/Towards-Docusaurus-2","editUrl":"https://github.com/facebook/docusaurus/edit/main/website/blog/2018/09-11-Towards-Docusaurus-2.mdx","source":"@site/blog/2018/09-11-Towards-Docusaurus-2.mdx","title":"Towards Docusaurus 2","description":"Docusaurus was officially announced over nine months ago as a way to easily build open source documentation websites. Since then, it has amassed over 8,600 GitHub Stars, and is used by many popular open source projects such as React Native, Babel, Jest, Reason and Prettier.","date":"2018-09-11T00:00:00.000Z","tags":[{"inline":false,"label":"New","permalink":"/blog/tags/new"},{"inline":false,"label":"Adoption","permalink":"/blog/tags/adoption"}],"readingTime":9.25,"hasTruncateMarker":true,"authors":[{"name":"Endilie Yacop Sucipto","title":"Maintainer of Docusaurus","url":"https://github.com/endiliey","imageURL":"https://github.com/endiliey.png","key":"endiliey","page":null}],"frontMatter":{"title":"Towards Docusaurus 2","authors":"endiliey","tags":["new","adoption"]},"unlisted":false,"lastUpdatedAt":1744155424000,"lastUpdatedBy":"Ben McCann","prevItem":{"title":"Happy 1st Birthday Slash!","permalink":"/blog/2018/12/14/Happy-First-Birthday-Slash"},"nextItem":{"title":"How I Converted Profilo to Docusaurus in Under 2 Hours","permalink":"/blog/2018/04/30/How-I-Converted-Profilo-To-Docusaurus"}}')}}]); \ No newline at end of file +"use strict";(self.webpackChunkwebsite=self.webpackChunkwebsite||[]).push([["18796"],{54941:function(e,t,a){a.r(t),a.d(t,{assets:()=>u,contentTitle:()=>r,default:()=>d,frontMatter:()=>i,metadata:()=>s,toc:()=>l});var s=a(50457),n=a(85893),o=a(80980);let i={title:"Towards Docusaurus 2",authors:"endiliey",tags:["new","adoption"]},r=void 0,u={authorsImageUrls:[void 0]},l=[];function c(e){let t={a:"a",p:"p",...(0,o.a)(),...e.components};return(0,n.jsxs)(n.Fragment,{children:[(0,n.jsxs)(t.p,{children:["Docusaurus was ",(0,n.jsx)(t.a,{href:"https://v1.docusaurus.io/blog/2017/12/14/introducing-docusaurus",children:"officially announced"})," over nine months ago as a way to easily build open source documentation websites. Since then, it has amassed over 8,600 GitHub Stars, and is used by many popular open source projects such as ",(0,n.jsx)(t.a,{href:"https://facebook.github.io/react-native/",children:"React Native"}),", ",(0,n.jsx)(t.a,{href:"https://babeljs.io/",children:"Babel"}),", ",(0,n.jsx)(t.a,{href:"https://jestjs.io/",children:"Jest"}),", ",(0,n.jsx)(t.a,{href:"https://reasonml.github.io/",children:"Reason"})," and ",(0,n.jsx)(t.a,{href:"https://prettier.io/",children:"Prettier"}),"."]}),"\n",(0,n.jsx)(t.p,{children:"There is a saying that the very best software is constantly evolving, and the very worst is not. In case you are not aware, we have been planning and working on the next version of Docusaurus \uD83C\uDF89."})]})}function d(e={}){let{wrapper:t}={...(0,o.a)(),...e.components};return t?(0,n.jsx)(t,{...e,children:(0,n.jsx)(c,{...e})}):c(e)}},80980:function(e,t,a){a.d(t,{Z:()=>r,a:()=>i});var s=a(67294);let n={},o=s.createContext(n);function i(e){let t=s.useContext(o);return s.useMemo(function(){return"function"==typeof e?e(t):{...t,...e}},[t,e])}function r(e){let t;return t=e.disableParentContext?"function"==typeof e.components?e.components(n):e.components||n:i(e.components),s.createElement(o.Provider,{value:t},e.children)}},50457:function(e){e.exports=JSON.parse('{"permalink":"/blog/2018/09/11/Towards-Docusaurus-2","editUrl":"https://github.com/facebook/docusaurus/edit/main/website/blog/2018/09-11-Towards-Docusaurus-2.mdx","source":"@site/blog/2018/09-11-Towards-Docusaurus-2.mdx","title":"Towards Docusaurus 2","description":"Docusaurus was officially announced over nine months ago as a way to easily build open source documentation websites. Since then, it has amassed over 8,600 GitHub Stars, and is used by many popular open source projects such as React Native, Babel, Jest, Reason and Prettier.","date":"2018-09-11T00:00:00.000Z","tags":[{"inline":false,"label":"New","permalink":"/blog/tags/new"},{"inline":false,"label":"Adoption","permalink":"/blog/tags/adoption"}],"readingTime":9.25,"hasTruncateMarker":true,"authors":[{"name":"Endilie Yacop Sucipto","title":"Maintainer of Docusaurus","url":"https://github.com/endiliey","imageURL":"https://github.com/endiliey.png","key":"endiliey","page":null}],"frontMatter":{"title":"Towards Docusaurus 2","authors":"endiliey","tags":["new","adoption"]},"unlisted":false,"lastUpdatedAt":1744293302000,"lastUpdatedBy":"S\xe9bastien Lorber","prevItem":{"title":"Happy 1st Birthday Slash!","permalink":"/blog/2018/12/14/Happy-First-Birthday-Slash"},"nextItem":{"title":"How I Converted Profilo to Docusaurus in Under 2 Hours","permalink":"/blog/2018/04/30/How-I-Converted-Profilo-To-Docusaurus"}}')}}]); \ No newline at end of file diff --git a/assets/js/141512d1.40f771c4.js b/assets/js/141512d1.9e2eacde.js similarity index 99% rename from assets/js/141512d1.40f771c4.js rename to assets/js/141512d1.9e2eacde.js index 721874552e..6088b82396 100644 --- a/assets/js/141512d1.40f771c4.js +++ b/assets/js/141512d1.9e2eacde.js @@ -1 +1 @@ -"use strict";(self.webpackChunkwebsite=self.webpackChunkwebsite||[]).push([["80261"],{55732:function(e,n,s){s.d(n,{Z:()=>r});let r=s.p+"assets/images/social-card-1c688c53b51bdaa6e15ae532bf756276.png"},85345:function(e,n,s){s.d(n,{Z:()=>r});let r=s.p+"assets/images/mdx-checker-output-0f96cc19fd3ed4d55901ca90ad657c14.png"},51476:function(e,n,s){s.d(n,{Z:()=>r});let r=s.p+"assets/images/mdx2-playground-options-eab88e8328a6902759c4236ffc93d9c6.png"},32007:function(e,n,s){s.d(n,{Z:()=>r});let r=s.p+"assets/images/social-card-1c688c53b51bdaa6e15ae532bf756276.png"},27753:function(e,n,s){s.r(n),s.d(n,{assets:()=>c,contentTitle:()=>a,default:()=>h,frontMatter:()=>t,metadata:()=>r,toc:()=>d});var r=s(24174),o=s(85893),i=s(80980);let t={title:"Preparing your site for Docusaurus v3",authors:["slorber"],tags:["maintenance"],slug:"/preparing-your-site-for-docusaurus-v3",image:"./img/social-card.png"},a=void 0,c={image:s(55732).Z,authorsImageUrls:[void 0]},d=[{value:"Preparatory work",id:"preparatory-work",level:2},{value:"Preparing content for MDX v3",id:"preparing-content-for-mdx-v3",level:2},{value:"Using the MDX playground",id:"using-the-mdx-playground",level:3},{value:"Using the MDX checker CLI",id:"using-the-mdx-checker-cli",level:3},{value:"Common MDX problems",id:"common-mdx-problems",level:3},{value:"Bad usage of {
",id:"bad-usage-of-",level:4},{value:"Bad usage of<
",id:"bad-usage-of--1",level:4},{value:"Bad usage of GFM Autolink",id:"bad-usage-of-gfm-autolink",level:4},{value:"Lower-case MDXComponent mapping",id:"lower-case-mdxcomponent-mapping",level:4},{value:"Unintended extra paragraphs",id:"unintended-extra-paragraphs",level:4},{value:"Unintended usage of directives",id:"unintended-usage-of-directives",level:4},{value:"Unsupported indented code blocks",id:"unsupported-indented-code-blocks",level:4},{value:"MDX plugins",id:"mdx-plugins",level:3},{value:"Other breaking changes",id:"other-breaking-changes",level:2},{value:"Node.js 18.0",id:"nodejs-180",level:3},{value:"React 18.0",id:"react-180",level:3},{value:"TypeScript 5.0",id:"typescript-50",level:3},{value:"TypeScript base config",id:"typescript-base-config",level:3},{value:"Admonition warning",id:"admonition-warning",level:3},{value:"Versioned sidebars",id:"versioned-sidebars",level:3},{value:"Try Docusaurus v3 today",id:"try-docusaurus-v3-today",level:2},{value:"Ask for help",id:"ask-for-help",level:2},{value:"Conclusion",id:"conclusion",level:2}];function l(e){let n={a:"a",admonition:"admonition",blockquote:"blockquote",code:"code",h2:"h2",h3:"h3",h4:"h4",img:"img",li:"li",p:"p",pre:"pre",strong:"strong",ul:"ul",...(0,i.a)(),...e.components},{Details:r}=n;return r||function(e,n){throw Error("Expected "+(n?"component":"object")+" `"+e+"` to be defined: you likely forgot to import, pass, or provide it.")}("Details",!0),(0,o.jsxs)(o.Fragment,{children:[(0,o.jsx)(n.admonition,{type:"warning",children:(0,o.jsxs)(n.p,{children:["This blog post was written when Docusaurus v3 was in beta. There are some changes in dependency versions and upgrade steps you should be aware of if upgrading to Docusaurus v3 current stable releases. Use the ",(0,o.jsx)(n.a,{href:"https://docusaurus.io/docs/next/migration/v3",children:"upgrade guide"})," for the most up-to-date migration steps."]})}),"\n",(0,o.jsxs)(n.p,{children:[(0,o.jsx)(n.strong,{children:"Docusaurus v3"})," is now ",(0,o.jsx)(n.a,{href:"https://github.com/facebook/docusaurus/discussions/9312",children:(0,o.jsx)(n.strong,{children:"in beta"})})," and the official release is around the corner. This is the perfect time to start ",(0,o.jsx)(n.strong,{children:"preparing your site"})," for this new major version."]}),"\n",(0,o.jsxs)(n.p,{children:["Docusaurus v3 comes with a few ",(0,o.jsx)(n.strong,{children:"breaking changes"}),", many of which can be ",(0,o.jsx)(n.strong,{children:"handled today under Docusaurus v2"}),". Preparing your site ahead of time can be done incrementally, and will make it easier to upgrade to v3."]}),"\n",(0,o.jsxs)(n.p,{children:["The main breaking change is the upgrade from MDX v1 to MDX v3. Read the ",(0,o.jsx)(n.a,{href:"https://mdxjs.com/blog/v2/",children:(0,o.jsx)(n.strong,{children:"MDX v2"})})," and ",(0,o.jsx)(n.a,{href:"https://mdxjs.com/blog/v3/",children:(0,o.jsx)(n.strong,{children:"MDX v3"})})," release notes for details. MDX will now compile your Markdown content ",(0,o.jsx)(n.strong,{children:"more strictly"})," and with ",(0,o.jsx)(n.strong,{children:"subtle differences"}),"."]}),"\n",(0,o.jsx)(n.p,{children:"This article will mostly focus on how to prepare your content for this new MDX version, and will also list a few other breaking changes that you can handle today."}),"\n",(0,o.jsx)(n.p,{children:(0,o.jsx)(n.img,{alt:"Preparing your site for Docusaurus v3 - social card",src:s(32007).Z+"",width:"1040",height:"546"})}),"\n",(0,o.jsx)(n.admonition,{type:"warning",children:(0,o.jsxs)(n.p,{children:["This article mentions most Docusaurus v3 breaking changes, but is not exhaustive. Read the ",(0,o.jsx)(n.a,{href:"https://github.com/facebook/docusaurus/discussions/9312",children:"v3.0.0-beta.0 release notes"})," for an exhaustive list."]})}),"\n",(0,o.jsxs)(n.admonition,{title:"Don't be afraid",type:"tip",children:[(0,o.jsx)(n.p,{children:"There's a lot of content in this blog post, but many Docusaurus v2 sites can upgrade with very few changes."}),(0,o.jsxs)(n.p,{children:["If your site is relatively small, with only a few customizations, you can probably ",(0,o.jsx)(n.a,{href:"#try-docusaurus-v3-today",children:"upgrade to Docusaurus v3"})," immediately."]})]}),"\n",(0,o.jsx)(n.h2,{id:"preparatory-work",children:"Preparatory work"}),"\n",(0,o.jsxs)(n.p,{children:["Before preparing for the Docusaurus v3 upgrade, we recommend upgrading to the latest ",(0,o.jsx)(n.a,{href:"/versions",children:"Docusaurus v2 version"}),"."]}),"\n",(0,o.jsxs)(n.p,{children:["Depending on the complexity of your site, it may be a good idea to adopt the ",(0,o.jsx)(n.a,{href:"/blog/upgrading-frontend-dependencies-with-confidence-using-visual-regression-testing",children:"visual regression testing workflow"})," that we recently presented. It could help you catch unexpected visual side effects occurring during the Docusaurus v3 upgrade."]}),"\n",(0,o.jsxs)(n.p,{children:["We also recommend using the ",(0,o.jsx)(n.code,{children:".mdx"})," extension whenever you use JSX, ",(0,o.jsx)(n.code,{children:"import"}),", or ",(0,o.jsx)(n.code,{children:"export"})," (i.e. MDX features) inside a Markdown file. It is semantically more correct and improves compatibility with external tools (IDEs, formatters, linters, etc.). In future versions of Docusaurus, ",(0,o.jsx)(n.code,{children:".md"})," files will be parsed as standard ",(0,o.jsx)(n.a,{href:"https://commonmark.org/",children:"CommonMark"}),", which does not support these features. In Docusaurus v3, ",(0,o.jsx)(n.code,{children:".md"})," files keep being compiled as MDX files, but it will be possible to ",(0,o.jsx)(n.a,{href:"https://github.com/facebook/docusaurus/issues/3018",children:"opt-in for CommonMark"}),"."]}),"\n",(0,o.jsx)(n.h2,{id:"preparing-content-for-mdx-v3",children:"Preparing content for MDX v3"}),"\n",(0,o.jsxs)(n.p,{children:["MDX is a major dependency of Docusaurus responsible for compiling your ",(0,o.jsx)(n.code,{children:".md"})," and ",(0,o.jsx)(n.code,{children:".mdx"})," files to React components."]}),"\n",(0,o.jsxs)(n.p,{children:["MDX v3 is much better, but also comes with changes that probably require you to refactor your content a bit. MDX v3 is stricter, and some components that compiled fine under v1 might now fail to compile under v3, most likely because of ",(0,o.jsx)(n.code,{children:"{"})," and ",(0,o.jsx)(n.code,{children:"<"})," characters."]}),"\n",(0,o.jsxs)(n.p,{children:["Upgrading MDX comes with all the breaking changes documented on the ",(0,o.jsx)(n.a,{href:"https://mdxjs.com/blog/v2/",children:"MDX v2"})," and ",(0,o.jsx)(n.a,{href:"https://mdxjs.com/blog/v3/",children:"MDX v3"})," release blog posts. Most breaking changes come from MDX v2. The ",(0,o.jsx)(n.a,{href:"https://mdxjs.com/migrating/v2/",children:"MDX v2 migration guide"})," has a section on how to ",(0,o.jsx)(n.a,{href:"https://mdxjs.com/migrating/v2/#update-mdx-files",children:"update MDX files"})," that will be particularly relevant to us. Also make sure to read the ",(0,o.jsx)(n.a,{href:"https://mdxjs.com/docs/troubleshooting-mdx/",children:"Troubleshooting MDX"})," page that can help you interpret common MDX error messages."]}),"\n",(0,o.jsxs)(n.p,{children:["Make sure to also read our updated ",(0,o.jsx)(n.a,{href:"/docs/markdown-features/react",children:(0,o.jsx)(n.strong,{children:"MDX and React"})})," documentation page."]}),"\n",(0,o.jsx)(n.admonition,{title:"Ask for help",type:"tip",children:(0,o.jsxs)(n.p,{children:["We have a dedicated ",(0,o.jsx)(n.a,{href:"https://github.com/facebook/docusaurus/discussions/9053",children:"MDX v3 - Upgrade Support"})," discussion."]})}),"\n",(0,o.jsx)(n.h3,{id:"using-the-mdx-playground",children:"Using the MDX playground"}),"\n",(0,o.jsxs)(n.p,{children:["The MDX playground is your new best friend. It permits to understand how your content is ",(0,o.jsx)(n.strong,{children:"compiled to React components"}),", and troubleshoot compilation or rendering issues in isolation."]}),"\n",(0,o.jsx)(n.p,{children:"Each MDX version comes with its own playground:"}),"\n",(0,o.jsxs)(n.ul,{children:["\n",(0,o.jsx)(n.li,{children:(0,o.jsx)(n.a,{href:"https://mdxjs.com/playground/",children:"MDX playground - current version"})}),"\n",(0,o.jsx)(n.li,{children:(0,o.jsx)(n.a,{href:"https://mdx-git-renovate-babel-monorepo-mdx.vercel.app/playground/",children:"MDX playground - v1"})}),"\n"]}),"\n",(0,o.jsxs)(r,{children:[(0,o.jsx)("summary",{children:"Configuring the MDX playground options for Docusaurus"}),(0,o.jsxs)(n.p,{children:["To obtain a compilation behavior similar to what Docusaurus v2 uses, please turn on these options on the ",(0,o.jsx)(n.a,{href:"https://mdxjs.com/playground/",children:"MDX playground"}),":"]}),(0,o.jsxs)(n.ul,{children:["\n",(0,o.jsxs)(n.li,{children:["Use ",(0,o.jsx)(n.code,{children:"MDX"})]}),"\n",(0,o.jsxs)(n.li,{children:["Use ",(0,o.jsx)(n.code,{children:"remark-gfm"})]}),"\n",(0,o.jsxs)(n.li,{children:["Use ",(0,o.jsx)(n.code,{children:"remark-directive"})]}),"\n"]}),(0,o.jsx)(n.p,{children:(0,o.jsx)(n.img,{alt:"Screenshot of the MDX playground's options panel, with only the "Use MDX", "Use remark-gfm", and "Use remark-directive" options checked",src:s(51476).Z+"",width:"1968",height:"1316"})})]}),"\n",(0,o.jsx)(n.p,{children:"Using the two MDX playgrounds side-by-side, you will soon notice that some content is compiled differently or fails to compile in v3."}),"\n",(0,o.jsx)(n.admonition,{title:"Making your content future-proof",type:"tip",children:(0,o.jsxs)(n.p,{children:["The goal will be to refactor your problematic content so that it ",(0,o.jsx)(n.strong,{children:"works fine with both versions of MDX"}),". This way, when you upgrade to Docusaurus v3, this content will already work out-of-the-box."]})}),"\n",(0,o.jsx)(n.h3,{id:"using-the-mdx-checker-cli",children:"Using the MDX checker CLI"}),"\n",(0,o.jsxs)(n.p,{children:["We provide a ",(0,o.jsx)(n.a,{href:"https://github.com/slorber/docusaurus-mdx-checker",children:"docusaurus-mdx-checker"})," CLI that permits to easily spot problematic content. Run this command today on your Docusaurus v2 site to obtain a list of files that will fail to compile under MDX v3."]}),"\n",(0,o.jsx)(n.pre,{children:(0,o.jsx)(n.code,{className:"language-bash",children:"npx docusaurus-mdx-checker\n"})}),"\n",(0,o.jsx)(n.p,{children:"For each compilation issue, the CLI will log the file path and a line number to look at."}),"\n",(0,o.jsx)(n.p,{children:(0,o.jsx)(n.img,{alt:"Screenshot of the terminal showing an example MDX checker CLI output, with a few error messages",src:s(85345).Z+"",width:"1161",height:"417"})}),"\n",(0,o.jsx)(n.admonition,{type:"tip",children:(0,o.jsx)(n.p,{children:"Use this CLI to estimate of how much work will be required to make your content compatible with MDX v3."})}),"\n",(0,o.jsxs)(n.admonition,{type:"warning",children:[(0,o.jsx)(n.p,{children:"This CLI is a best effort, and will only report compilation errors."}),(0,o.jsxs)(n.p,{children:["It will not report subtle compilation changes that do not produce errors but can affect how your content is displayed. To catch these problems, we recommend using ",(0,o.jsx)(n.a,{href:"/blog/upgrading-frontend-dependencies-with-confidence-using-visual-regression-testing",children:"visual regression tests"}),"."]})]}),"\n",(0,o.jsx)(n.h3,{id:"common-mdx-problems",children:"Common MDX problems"}),"\n",(0,o.jsx)(n.p,{children:"We upgraded a few Docusaurus sites to Docusaurus v3 and MDX v3:"}),"\n",(0,o.jsxs)(n.ul,{children:["\n",(0,o.jsx)(n.li,{children:(0,o.jsx)(n.a,{href:"https://github.com/facebook/docusaurus/pull/8288",children:"Docusaurus PR"})}),"\n",(0,o.jsx)(n.li,{children:(0,o.jsx)(n.a,{href:"https://github.com/facebook/react-native-website/pull/3780",children:"React-Native PR"})}),"\n",(0,o.jsx)(n.li,{children:(0,o.jsx)(n.a,{href:"https://github.com/jestjs/jest/pull/14463",children:"Jest PR"})}),"\n"]}),"\n",(0,o.jsx)(n.p,{children:"These upgrades permitted us to aggregate the most common content problems, and document how to best handle them."}),"\n",(0,o.jsxs)(n.h4,{id:"bad-usage-of-",children:["Bad usage of ",(0,o.jsx)(n.code,{children:"{"})]}),"\n",(0,o.jsxs)(n.p,{children:["The ",(0,o.jsx)(n.code,{children:"{"})," character is used for opening ",(0,o.jsx)(n.a,{href:"https://mdxjs.com/docs/what-is-mdx/#expressions",children:"JavaScript expressions"}),". MDX will now fail if what you put inside ",(0,o.jsx)(n.code,{children:"{expression}"})," is not a valid expression."]}),"\n",(0,o.jsx)(n.pre,{children:(0,o.jsx)(n.code,{className:"language-md",metastring:'title="example.md"',children:"The object shape looks like {username: string, age: number}\n"})}),"\n",(0,o.jsx)(n.admonition,{title:"Error message",type:"danger",children:(0,o.jsxs)(n.blockquote,{children:["\n",(0,o.jsx)(n.p,{children:"Could not parse expression with acorn: Unexpected content after expression"}),"\n"]})}),"\n",(0,o.jsxs)(n.admonition,{title:"How to prepare",type:"tip",children:[(0,o.jsx)(n.p,{children:"Available options to fix this error:"}),(0,o.jsxs)(n.ul,{children:["\n",(0,o.jsxs)(n.li,{children:["Use inline code: ",(0,o.jsx)(n.code,{children:"{username: string, age: number}"})]}),"\n",(0,o.jsxs)(n.li,{children:["Use the HTML code: ",(0,o.jsx)(n.code,{children:"{"})]}),"\n",(0,o.jsxs)(n.li,{children:["Escape it: ",(0,o.jsx)(n.code,{children:"\\{"})]}),"\n"]})]}),"\n",(0,o.jsxs)(n.h4,{id:"bad-usage-of--1",children:["Bad usage of ",(0,o.jsx)(n.code,{children:"<"})]}),"\n",(0,o.jsxs)(n.p,{children:["The ",(0,o.jsx)(n.code,{children:"<"})," character is used for opening ",(0,o.jsx)(n.a,{href:"https://mdxjs.com/docs/what-is-mdx/#jsx",children:"JSX tags"}),". MDX will now fail if it thinks your JSX is invalid."]}),"\n",(0,o.jsx)(n.pre,{children:(0,o.jsx)(n.code,{className:"language-md",metastring:'title="example.md"',children:'Use Android version <5\n\nYou can use a generic type like Array\n\nFollow the template "Road to "\n'})}),"\n",(0,o.jsxs)(n.admonition,{title:"Error messages",type:"danger",children:[(0,o.jsxs)(n.blockquote,{children:["\n",(0,o.jsxs)(n.p,{children:["Unexpected character ",(0,o.jsx)(n.code,{children:"5"})," (U+0035) before name, expected a character that can start a name, such as a letter, ",(0,o.jsx)(n.code,{children:"$"}),", or ",(0,o.jsx)(n.code,{children:"_"})]}),"\n"]}),(0,o.jsxs)(n.blockquote,{children:["\n",(0,o.jsxs)(n.p,{children:["Expected a closing tag for ",(0,o.jsx)(n.code,{children:" "})," (1:6-1:9) before the end of ",(0,o.jsx)(n.code,{children:"paragraph"})," end-tag-mismatch mdast-util-mdx-jsx"]}),"\n"]}),(0,o.jsxs)(n.blockquote,{children:["\n",(0,o.jsxs)(n.p,{children:["Expected a closing tag for ",(0,o.jsx)(n.code,{children:" "})," (134:19-134:39) before the end of ",(0,o.jsx)(n.code,{children:"paragraph"})]}),"\n"]})]}),"\n",(0,o.jsxs)(n.admonition,{title:"How to prepare",type:"tip",children:[(0,o.jsx)(n.p,{children:"Available options to fix this error:"}),(0,o.jsxs)(n.ul,{children:["\n",(0,o.jsxs)(n.li,{children:["Use inline code: ",(0,o.jsx)(n.code,{children:"Array