mirror of
https://github.com/facebook/docusaurus.git
synced 2025-05-02 11:47:23 +02:00
4 lines
No EOL
88 KiB
JavaScript
4 lines
No EOL
88 KiB
JavaScript
"use strict";(self.webpackChunkwebsite=self.webpackChunkwebsite||[]).push([[86515],{65108:(e,t,r)=>{r.d(t,{A:()=>o});var n=r(62540);function o(e){var t,r;return(0,n.jsx)("svg",(t=function(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter(function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable}))),n.forEach(function(t){var n;n=r[t],t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n})}return e}({viewBox:"0 0 14 16"},e),r=r={children:(0,n.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"})},Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):(function(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);r.push.apply(r,n)}return r})(Object(r)).forEach(function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}),t))}r(63696)},55640:(e,t,r)=>{r.d(t,{A:()=>E});var n,o,s=r(62540),c=r(63696),i=r(11750),l=r(81912),a=r(12653);let d={admonition:"admonition_o5H7",admonitionHeading:"admonitionHeading_FzoX",admonitionIcon:"admonitionIcon_rXq6",admonitionContent:"admonitionContent_Knsx"};function u({type:e,className:t,children:r}){return(0,s.jsx)("div",{className:(0,i.A)(a.G.common.admonition,a.G.common.admonitionType(e),d.admonition,t),children:r})}function p({icon:e,title:t}){return(0,s.jsxs)("div",{className:d.admonitionHeading,children:[(0,s.jsx)("span",{className:d.admonitionIcon,children:e}),t]})}function h({children:e}){return e?(0,s.jsx)("div",{className:d.admonitionContent,children:e}):null}function b(e){let{type:t,icon:r,title:n,children:o,className:c}=e;return(0,s.jsxs)(u,{type:t,className:c,children:[n||r?(0,s.jsx)(p,{title:n,icon:r}):null,(0,s.jsx)(h,{children:o})]})}let j={icon:(0,s.jsx)(function(e){var t,r;return(0,s.jsx)("svg",(t=function(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter(function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable}))),n.forEach(function(t){var n;n=r[t],t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n})}return e}({viewBox:"0 0 14 16"},e),r=r={children:(0,s.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"})},Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):(function(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);r.push.apply(r,n)}return r})(Object(r)).forEach(function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}),t))},{}),title:(0,s.jsx)(l.A,{id:"theme.admonition.note",description:"The default label used for the Note admonition (:::note)",children:"note"})};function f(e){var t,r;return(0,s.jsx)(b,(t=function(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter(function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable}))),n.forEach(function(t){var n;n=r[t],t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n})}return e}({},j,e),r=r={className:(0,i.A)("alert alert--secondary",e.className),children:e.children},Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):(function(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);r.push.apply(r,n)}return r})(Object(r)).forEach(function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}),t))}let g={icon:(0,s.jsx)(function(e){var t,r;return(0,s.jsx)("svg",(t=function(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter(function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable}))),n.forEach(function(t){var n;n=r[t],t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n})}return e}({viewBox:"0 0 12 16"},e),r=r={children:(0,s.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"})},Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):(function(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);r.push.apply(r,n)}return r})(Object(r)).forEach(function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}),t))},{}),title:(0,s.jsx)(l.A,{id:"theme.admonition.tip",description:"The default label used for the Tip admonition (:::tip)",children:"tip"})};function m(e){var t,r;return(0,s.jsx)(b,(t=function(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter(function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable}))),n.forEach(function(t){var n;n=r[t],t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n})}return e}({},g,e),r=r={className:(0,i.A)("alert alert--success",e.className),children:e.children},Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):(function(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);r.push.apply(r,n)}return r})(Object(r)).forEach(function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}),t))}var y=r(65108);let x={icon:(0,s.jsx)(y.A,{}),title:(0,s.jsx)(l.A,{id:"theme.admonition.info",description:"The default label used for the Info admonition (:::info)",children:"info"})};function O(e){var t,r;return(0,s.jsx)(b,(t=function(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter(function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable}))),n.forEach(function(t){var n;n=r[t],t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n})}return e}({},x,e),r=r={className:(0,i.A)("alert alert--info",e.className),children:e.children},Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):(function(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);r.push.apply(r,n)}return r})(Object(r)).forEach(function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}),t))}function v(e){var t,r;return(0,s.jsx)("svg",(t=function(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter(function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable}))),n.forEach(function(t){var n;n=r[t],t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n})}return e}({viewBox:"0 0 16 16"},e),r=r={children:(0,s.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"})},Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):(function(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);r.push.apply(r,n)}return r})(Object(r)).forEach(function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}),t))}let w={icon:(0,s.jsx)(v,{}),title:(0,s.jsx)(l.A,{id:"theme.admonition.warning",description:"The default label used for the Warning admonition (:::warning)",children:"warning"})},P={icon:(0,s.jsx)(function(e){var t,r;return(0,s.jsx)("svg",(t=function(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter(function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable}))),n.forEach(function(t){var n;n=r[t],t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n})}return e}({viewBox:"0 0 12 16"},e),r=r={children:(0,s.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"})},Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):(function(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);r.push.apply(r,n)}return r})(Object(r)).forEach(function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}),t))},{}),title:(0,s.jsx)(l.A,{id:"theme.admonition.danger",description:"The default label used for the Danger admonition (:::danger)",children:"danger"})},k={icon:(0,s.jsx)(v,{}),title:(0,s.jsx)(l.A,{id:"theme.admonition.caution",description:"The default label used for the Caution admonition (:::caution)",children:"caution"})};function S(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter(function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable}))),n.forEach(function(t){var n;n=r[t],t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n})}return e}let D=S({},{note:f,tip:m,info:O,warning:function(e){var t,r;return(0,s.jsx)(b,(t=function(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter(function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable}))),n.forEach(function(t){var n;n=r[t],t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n})}return e}({},w,e),r=r={className:(0,i.A)("alert alert--warning",e.className),children:e.children},Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):(function(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);r.push.apply(r,n)}return r})(Object(r)).forEach(function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}),t))},danger:function(e){var t,r;return(0,s.jsx)(b,(t=function(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter(function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable}))),n.forEach(function(t){var n;n=r[t],t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n})}return e}({},P,e),r=r={className:(0,i.A)("alert alert--danger",e.className),children:e.children},Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):(function(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);r.push.apply(r,n)}return r})(Object(r)).forEach(function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}),t))}},{secondary:e=>(0,s.jsx)(f,S({title:"secondary"},e)),important:e=>(0,s.jsx)(O,S({title:"important"},e)),success:e=>(0,s.jsx)(m,S({title:"success"},e)),caution:function(e){var t,r;return(0,s.jsx)(b,(t=function(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter(function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable}))),n.forEach(function(t){var n;n=r[t],t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n})}return e}({},k,e),r=r={className:(0,i.A)("alert alert--warning",e.className),children:e.children},Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):(function(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);r.push.apply(r,n)}return r})(Object(r)).forEach(function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}),t))}});var A=r(37425);let N=(n=function(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter(function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable}))),n.forEach(function(t){var n;n=r[t],t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n})}return e}({},D),o=o={"my-custom-admonition":function(e){return(0,s.jsxs)("div",{style:{border:"solid red",padding:10},children:[(0,s.jsx)(A.A,{as:"h5",style:{color:"blue",fontSize:30},children:e.title}),(0,s.jsx)("div",{children:e.children})]})}},Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(o)):(function(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);r.push.apply(r,n)}return r})(Object(o)).forEach(function(e){Object.defineProperty(n,e,Object.getOwnPropertyDescriptor(o,e))}),n);function E(e){var t;let r=function(e){var t,r,n;let{mdxAdmonitionTitle:o,rest:i}=function(e){let t=c.Children.toArray(e),r=t.find(e=>c.isValidElement(e)&&"mdxAdmonitionTitle"===e.type),n=t.filter(e=>e!==r);return{mdxAdmonitionTitle:null==r?void 0:r.props.children,rest:n.length>0?(0,s.jsx)(s.Fragment,{children:n}):null}}(e.children),l=null!==(t=e.title)&&void 0!==t?t:o;return r=function(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter(function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable}))),n.forEach(function(t){var n;n=r[t],t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n})}return e}({},e,l&&{title:l}),n=n={children:i},Object.getOwnPropertyDescriptors?Object.defineProperties(r,Object.getOwnPropertyDescriptors(n)):(function(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);r.push.apply(r,n)}return r})(Object(n)).forEach(function(e){Object.defineProperty(r,e,Object.getOwnPropertyDescriptor(n,e))}),r}(e),n=N[t=r.type]||(console.warn(`No admonition component found for admonition type "${t}". Using Info as fallback.`),N.info);return(0,s.jsx)(n,function(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter(function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable}))),n.forEach(function(t){var n;n=r[t],t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n})}return e}({},r))}},15995:(e,t,r)=>{r.d(t,{A:()=>s});var n=r(62540);r(63696);var o=r(11750);function s({children:e,hidden:t,className:r}){return(0,n.jsx)("div",{role:"tabpanel",className:(0,o.A)("tabItem_pnkT",r),hidden:t,children:e})}},27446:(e,t,r)=>{r.d(t,{A:()=>x});var n=r(62540),o=r(63696),s=r(11750),c=r(7846),i=r(49519),l=r(96439),a=r(19739),d=r(66904),u=r(79244);function p(e){var t,r;return null!==(r=null===(t=o.Children.toArray(e).filter(e=>"\n"!==e).map(e=>{if(!e||(0,o.isValidElement)(e)&&function(e){let{props:t}=e;return!!t&&"object"==typeof t&&"value"in t}(e))return e;throw Error(`Docusaurus error: Bad <Tabs> child <${"string"==typeof e.type?e.type:e.type.name}>: all children of the <Tabs> component should be <TabItem>, and every <TabItem> should have a unique "value" prop.`)}))||void 0===t?void 0:t.filter(Boolean))&&void 0!==r?r:[]}function h({value:e,tabValues:t}){return t.some(t=>t.value===e)}var b=r(10709);function j(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter(function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable}))),n.forEach(function(t){var n;n=r[t],t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n})}return e}function f(e,t){return t=null!=t?t:{},Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):(function(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);r.push.apply(r,n)}return r})(Object(t)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(t,r))}),e}function g({className:e,block:t,selectedValue:r,selectValue:o,tabValues:i}){let l=[],{blockElementScrollPositionUntilNextRender:a}=(0,c.a_)(),d=e=>{let t=e.currentTarget,n=i[l.indexOf(t)].value;n!==r&&(a(t),o(n))},u=e=>{var t,r;let n=null;switch(e.key){case"Enter":d(e);break;case"ArrowRight":{let r=l.indexOf(e.currentTarget)+1;n=null!==(t=l[r])&&void 0!==t?t:l[0];break}case"ArrowLeft":{let t=l.indexOf(e.currentTarget)-1;n=null!==(r=l[t])&&void 0!==r?r:l[l.length-1]}}null==n||n.focus()};return(0,n.jsx)("ul",{role:"tablist","aria-orientation":"horizontal",className:(0,s.A)("tabs",{"tabs--block":t},e),children:i.map(({value:e,label:t,attributes:o})=>(0,n.jsx)("li",f(j({role:"tab",tabIndex:r===e?0:-1,"aria-selected":r===e,ref:e=>l.push(e),onKeyDown:u,onClick:d},o),{className:(0,s.A)("tabs__item","tabItem_AQgk",null==o?void 0:o.className,{"tabs__item--active":r===e}),children:null!=t?t:e}),e))})}function m({lazy:e,children:t,selectedValue:r}){let c=(Array.isArray(t)?t:[t]).filter(Boolean);if(e){let e=c.find(e=>e.props.value===r);return e?(0,o.cloneElement)(e,{className:(0,s.A)("margin-top--md",e.props.className)}):null}return(0,n.jsx)("div",{className:"margin-top--md",children:c.map((e,t)=>(0,o.cloneElement)(e,{key:t,hidden:e.props.value!==r}))})}function y(e){let t=function(e){let{defaultValue:t,queryString:r=!1,groupId:n}=e,s=function(e){let{values:t,children:r}=e;return(0,o.useMemo)(()=>{let e=null!=t?t:p(r).map(({props:{value:e,label:t,attributes:r,default:n}})=>({value:e,label:t,attributes:r,default:n}));return!function(e){let t=(0,d.XI)(e,(e,t)=>e.value===t.value);if(t.length>0)throw Error(`Docusaurus error: Duplicate values "${t.map(e=>e.value).join(", ")}" found in <Tabs>. Every value needs to be unique.`)}(e),e},[t,r])}(e),[c,b]=(0,o.useState)(()=>(function({defaultValue:e,tabValues:t}){var r;if(0===t.length)throw Error("Docusaurus error: the <Tabs> component requires at least one <TabItem> children component");if(e){if(!h({value:e,tabValues:t}))throw Error(`Docusaurus error: The <Tabs> has a defaultValue "${e}" 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 e}let n=null!==(r=t.find(e=>e.default))&&void 0!==r?r:t[0];if(!n)throw Error("Unexpected error: 0 tabValues");return n.value})({defaultValue:t,tabValues:s})),[j,f]=function({queryString:e=!1,groupId:t}){let r=(0,i.W6)(),n=function({queryString:e=!1,groupId:t}){if("string"==typeof e)return e;if(!1===e)return null;if(!0===e&&!t)throw Error('Docusaurus error: The <Tabs> 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 null!=t?t:null}({queryString:e,groupId:t});return[(0,a.aZ)(n),(0,o.useCallback)(e=>{var t,o;if(!n)return;let s=new URLSearchParams(r.location.search);s.set(n,e),r.replace((t=function(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter(function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable}))),n.forEach(function(t){var n;n=r[t],t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n})}return e}({},r.location),o=o={search:s.toString()},Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(o)):(function(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);r.push.apply(r,n)}return r})(Object(o)).forEach(function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(o,e))}),t))},[n,r])]}({queryString:r,groupId:n}),[g,m]=function({groupId:e}){let t=e?`docusaurus.tab.${e}`:null,[r,n]=(0,u.Dv)(t);return[r,(0,o.useCallback)(e=>{t&&n.set(e)},[t,n])]}({groupId:n}),y=(()=>{let e=null!=j?j:g;return h({value:e,tabValues:s})?e:null})();return(0,l.A)(()=>{y&&b(y)},[y]),{selectedValue:c,selectValue:(0,o.useCallback)(e=>{if(!h({value:e,tabValues:s}))throw Error(`Can't select invalid tab value=${e}`);b(e),f(e),m(e)},[f,m,s]),tabValues:s}}(e);return(0,n.jsxs)("div",{className:(0,s.A)("tabs-container","tabList_Qoir"),children:[(0,n.jsx)(g,j({},t,e)),(0,n.jsx)(m,j({},t,e))]})}function x(e){let t=(0,b.A)();return(0,n.jsx)(y,f(j({},e),{children:p(e.children)}),String(t))}},40576:(e,t,r)=>{r.d(t,{A:()=>s});var n=r(62540);r(63696);var o=r(10709);function s({children:e,fallback:t}){return(0,o.A)()?(0,n.jsx)(n.Fragment,{children:null==e?void 0:e()}):null!=t?t:null}},92857:(e,t,r)=>{r.d(t,{A:()=>g});var n=r(62540),o=r(63696),s=r(11750),c=r(44308),i=r.n(c),l=r(36372),a=r(81912),d=r(66659),u=r(55887),p=r(55640),h=r(92112);let b={color:"color_mVUL",input:"input_HUC3",colorInput:"colorInput_C1YB",colorTable:"colorTable_Js7s"};function j(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter(function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable}))),n.forEach(function(t){var n;n=r[t],t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n})}return e}function f(e,t){return t=null!=t?t:{},Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):(function(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);r.push.apply(r,n)}return r})(Object(t)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(t,r))}),e}function g(){let{colorMode:e,setColorMode:t}=(0,d.G)(),r="dark"===e,c=r?h.Yn:h.Iw,g=r?h.a9:h.yE,[m,y]=(0,o.useState)(c),[x,O]=(0,o.useState)(c),[v,w]=(0,o.useState)(g),[P,k]=(0,o.useState)(h.TM),[S,D]=(0,o.useState)(r?h.Wl:h.io);function A(e){let t=e.target.value.replace(/^(?=[^#])/,"#");y(t);try{O(i()(t).hex())}catch(e){}}return(0,o.useEffect)(()=>{D(r?h.Wl:h.io)},[r]),(0,o.useEffect)(()=>{var e,t,r,n,o;let s=JSON.parse(null!==(e=S.get())&&void 0!==e?e:"{}");y(null!==(t=s.baseColor)&&void 0!==t?t:c),O(null!==(r=s.baseColor)&&void 0!==r?r:c),w(null!==(n=s.background)&&void 0!==n?n:g),k(null!==(o=s.shades)&&void 0!==o?o:h.TM)},[S,g,c]),(0,o.useEffect)(()=>{(0,h.oP)({baseColor:x,background:v,shades:P},r),S.set(JSON.stringify({baseColor:x,background:v,shades:P}))},[x,v,P,S,r]),(0,n.jsxs)("div",{children:[(0,n.jsx)(p.A,{type:"tip",children:(0,n.jsx)("p",{children:(0,n.jsx)(a.A,{id:"colorGenerator.tip.body",values:{wcagLink:(0,n.jsx)(l.A,{href:"https://www.w3.org/TR/WCAG20/#visual-audio-contrast-contrast",children:(0,n.jsx)(a.A,{id:"colorGenerator.tip.body.wcagLink.label",children:"WCAG-AA contrast ratio"})})},children:"Aim for at least {wcagLink} for the primary color to ensure readability. Use the Docusaurus website itself to preview how your color palette would look like. You can use alternative palettes in dark mode because one color doesn't usually work in both light and dark mode."})})}),(0,n.jsxs)("p",{children:[(0,n.jsx)("label",{htmlFor:"primary_color",children:(0,n.jsx)("strong",{className:"margin-right--sm",children:(0,n.jsx)(a.A,{id:"colorGenerator.inputs.primary.label",children:"Primary Color:"})})})," ",(0,n.jsx)("input",{id:"primary_color",type:"text",className:(0,s.A)(b.input,"margin-right--sm"),value:m,onChange:A}),(0,n.jsx)("input",{type:"color",className:b.colorInput,value:x,onChange:A}),(0,n.jsx)("button",{type:"button",className:"clean-btn button button--primary margin-left--md",onClick:()=>t(r?"light":"dark"),children:(0,n.jsx)(a.A,{id:"colorGenerator.inputs.modeToggle.label",values:{colorMode:r?(0,n.jsx)(a.A,{id:"colorGenerator.inputs.modeToggle.label.colorMode.light",children:"light"}):(0,n.jsx)(a.A,{id:"colorGenerator.inputs.modeToggle.label.colorMode.dark",children:"dark"})},children:"Edit {colorMode} mode"})}),(0,n.jsx)("button",{type:"button",className:"clean-btn button button--secondary margin-left--md",onClick:()=>{y(c),O(c),w(g),k(h.TM)},children:(0,n.jsx)(a.A,{id:"colorGenerator.inputs.resetButton.label",children:"Reset"})})]}),(0,n.jsxs)("p",{children:[(0,n.jsx)("label",{htmlFor:"background_color",children:(0,n.jsx)("strong",{className:"margin-right--sm",children:(0,n.jsx)(a.A,{id:"colorGenerator.inputs.background.label",children:"Background:"})})}),(0,n.jsx)("input",{id:"background_color",type:"color",className:(0,s.A)(b.colorInput,"margin-right--sm"),value:v,onChange:e=>{w(e.target.value)}})]}),(0,n.jsx)("div",{children:(0,n.jsxs)("table",{className:b.colorTable,children:[(0,n.jsx)("thead",{children:(0,n.jsxs)("tr",{children:[(0,n.jsx)("th",{children:(0,n.jsx)(a.A,{id:"colorGenerator.table.heading1",children:"CSS Variable Name"})}),(0,n.jsx)("th",{children:(0,n.jsx)(a.A,{id:"colorGenerator.table.heading2",description:"This column is the color's representation in hex",children:"Hex"})}),(0,n.jsx)("th",{children:(0,n.jsx)(a.A,{id:"colorGenerator.table.heading3",description:"This column is the adjusted shades' adjustment values relative to the primary color",children:"Adjustment"})}),(0,n.jsx)("th",{children:(0,n.jsx)(a.A,{id:"colorGenerator.table.heading4",description:"This column is WCAG contrast rating: AAA, AA, Fail",children:"Contrast Rating"})})]})}),(0,n.jsx)("tbody",{children:(0,h.jv)(P,x).sort((e,t)=>e.displayOrder-t.displayOrder).map(e=>{let{variableName:t,adjustment:r,adjustmentInput:o,hex:s}=e;return(0,n.jsxs)("tr",{children:[(0,n.jsx)("td",{children:(0,n.jsx)("code",{children:t})}),(0,n.jsxs)("td",{children:[(0,n.jsx)("span",{className:b.color,style:{backgroundColor:s}}),(0,n.jsx)("code",{className:"margin-left--sm",children:s.toLowerCase()})]}),(0,n.jsx)("td",{children:"--ifm-color-primary"===t?0:(0,n.jsx)("input",{"aria-label":`${t} CSS variable name`,className:b.input,type:"number",value:o,onChange:e=>{let n=parseFloat(e.target.value);k(f(j({},P),{[t]:f(j({},P[t]),{adjustmentInput:e.target.value,adjustment:Number.isNaN(n)?r:n/100})}))}})}),(0,n.jsx)("td",{style:{fontSize:"medium",backgroundColor:v,color:s},children:(0,n.jsx)("b",{children:function(e,t){let r=i()(e).contrast(i()(t));return r>7?"AAA \u{1F3C5}":r>4.5?"AA \u{1F44D}":"Fail \u{1F534}"}(s,v)})})]},t)})})]})}),(0,n.jsx)("p",{children:(0,n.jsx)(a.A,{id:"colorGenerator.text",values:{cssPath:(0,n.jsx)("code",{children:"src/css/custom.css"})},children:"Replace the variables in {cssPath} with these new variables."})}),(0,n.jsx)(u.A,{className:"language-css",title:"/src/css/custom.css",children:`${r?"[data-theme='dark']":":root"} {
|
|
${(0,h.jv)(P,x).sort((e,t)=>e.codeOrder-t.codeOrder).map(e=>` ${e.variableName}: ${e.hex.toLowerCase()};`).join("\n")}${v!==g?`
|
|
--ifm-background-color: ${v};`:""}
|
|
}`})]})}},55887:(e,t,r)=>{r.d(t,{A:()=>ei});var n,o,s,c={};r.r(c),r.d(c,{ButtonExample:()=>E});var i=r(62540),l=r(63696),a=r(11750),d=r(10709),u=r(55152),p=r(81912),h=r(99468),b=r(40576),j=r(1495),f=r(66659),g=r(25436);function m(){let{prism:e}=(0,g.p)(),{colorMode:t}=(0,f.G)(),r=e.theme,n=e.darkTheme||r;return"dark"===t?n:r}var y=r(43758);function x(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter(function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable}))),n.forEach(function(t){var n;n=r[t],t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n})}return e}function O({children:e}){return(0,i.jsx)("div",{className:(0,a.A)("playgroundHeader_Tvsk"),children:e})}function v(){return(0,i.jsx)("div",{children:"Loading..."})}function w(){return(0,i.jsx)(b.A,{fallback:(0,i.jsx)(v,{}),children:()=>(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(y.A,{fallback:e=>(0,i.jsx)(j.MN,x({},e)),children:(0,i.jsx)(u.pA,{})}),(0,i.jsx)(u.p1,{})]})})}function P(){return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(O,{children:(0,i.jsx)(p.A,{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)(w,{})})]})}function k(){let e=(0,d.A)();return(0,i.jsx)(u.w,{className:"playgroundEditor_TySg"},String(e))}function S(){return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(O,{children:(0,i.jsx)(p.A,{id:"theme.Playground.liveEditor",description:"The live editor label of the live codeblocks",children:"Live Editor"})}),(0,i.jsx)(k,{})]})}let D=e=>`${e};`;function A(e){var t,r,n,o,{children:s,transformCode:c}=e,l=function(e,t){if(null==e)return{};var r,n,o=function(e,t){if(null==e)return{};var r,n,o={},s=Object.keys(e);for(n=0;n<s.length;n++)r=s[n],t.indexOf(r)>=0||(o[r]=e[r]);return o}(e,t);if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(e);for(n=0;n<s.length;n++)r=s[n],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(o[r]=e[r])}return o}(e,["children","transformCode"]);let{siteConfig:{themeConfig:a}}=(0,h.A)(),{liveCodeBlock:{playgroundPosition:d}}=a,p=m(),b=null!==(o=null===(n=l.metastring)||void 0===n?void 0:n.includes("noInline"))&&void 0!==o&&o;return(0,i.jsx)("div",{className:"playgroundContainer_6Ior",children:(0,i.jsx)(u.Q,(t=x({code:null==s?void 0:s.replace(/\n$/,""),noInline:b,transformCode:null!=c?c:D,theme:p},l),r=r={children:"top"===d?(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(P,{}),(0,i.jsx)(S,{})]}):(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(S,{}),(0,i.jsx)(P,{})]})},Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):(function(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);r.push.apply(r,n)}return r})(Object(r)).forEach(function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}),t))})}function N(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter(function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable}))),n.forEach(function(t){var n;n=r[t],t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n})}return e}function E(e){var t,r;return(0,i.jsx)("button",(t=N({type:"button"},e),r=r={style:N({backgroundColor:"white",color:"black",border:"solid red",borderRadius:20,padding:10,cursor:"pointer"},e.style)},Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):(function(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);r.push.apply(r,n)}return r})(Object(r)).forEach(function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}),t))}let C=function(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter(function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable}))),n.forEach(function(t){var n;n=r[t],t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n})}return e}({React:l},l,c);var T=r(12653),I=r(19934),B=r.n(I);let L=RegExp("title=(?<quote>[\"'])(?<title>.*?)\\1"),_=RegExp("\\{(?<range>[\\d,-]+)\\}"),M={js:{start:"\\/\\/",end:""},jsBlock:{start:"\\/\\*",end:"\\*\\/"},jsx:{start:"\\{\\s*\\/\\*",end:"\\*\\/\\s*\\}"},bash:{start:"#",end:""},html:{start:"<!--",end:"-->"}},R=(n=function(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter(function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable}))),n.forEach(function(t){var n;n=r[t],t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n})}return e}({},M),o=o={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.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(o)):(function(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);r.push.apply(r,n)}return r})(Object(o)).forEach(function(e){Object.defineProperty(n,e,Object.getOwnPropertyDescriptor(o,e))}),n),z=Object.keys(M);function U(e,t){let r=e.map(e=>{let{start:r,end:n}=R[e];return`(?:${r}\\s*(${t.flatMap(e=>{var t,r;return[e.line,null===(t=e.block)||void 0===t?void 0:t.start,null===(r=e.block)||void 0===r?void 0:r.end].filter(Boolean)}).join("|")})\\s*${n})`}).join("|");return RegExp(`^\\s*(?:${r})\\s*$`)}function H(e){var t,r,{as:n}=e,o=function(e,t){if(null==e)return{};var r,n,o=function(e,t){if(null==e)return{};var r,n,o={},s=Object.keys(e);for(n=0;n<s.length;n++)r=s[n],t.indexOf(r)>=0||(o[r]=e[r]);return o}(e,t);if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(e);for(n=0;n<s.length;n++)r=s[n],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(o[r]=e[r])}return o}(e,["as"]);let s=function(e){let t={color:"--prism-color",backgroundColor:"--prism-background-color"},r={};return Object.entries(e.plain).forEach(([e,n])=>{let o=t[e];o&&"string"==typeof n&&(r[o]=n)}),r}(m());return(0,i.jsx)(n,(t=function(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter(function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable}))),n.forEach(function(t){var n;n=r[t],t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n})}return e}({},o),r=r={style:s,className:(0,a.A)(o.className,"codeBlockContainer_jDV4",T.G.common.codeBlock)},Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):(function(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);r.push.apply(r,n)}return r})(Object(r)).forEach(function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}),t))}let F={codeBlockContent:"codeBlockContent_vx7S",codeBlockTitle:"codeBlockTitle_bdru",codeBlock:"codeBlock_Gebt",codeBlockStandalone:"codeBlockStandalone_i_cY",codeBlockLines:"codeBlockLines_FJaf",codeBlockLinesWithNumbering:"codeBlockLinesWithNumbering_FU9Q",buttonGroup:"buttonGroup_cUGO"};function G({children:e,className:t}){return(0,i.jsx)(H,{as:"pre",tabIndex:0,className:(0,a.A)(F.codeBlockStandalone,"thin-scrollbar",t),children:(0,i.jsx)("code",{className:F.codeBlockLines,children:e})})}var $=r(2550);let W={attributes:!0,characterData:!0,childList:!0,subtree:!0};var V=r(27663);let q={codeLine:"codeLine_qRmp",codeLineNumber:"codeLineNumber_dS_J",codeLineContent:"codeLineContent_XF5l"};function Y(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter(function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable}))),n.forEach(function(t){var n;n=r[t],t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n})}return e}function X({line:e,classNames:t,showLineNumbers:r,getLineProps:n,getTokenProps:o}){var s,c;1===e.length&&"\n"===e[0].content&&(e[0].content="");let l=n({line:e,className:(0,a.A)(t,r&&q.codeLine)}),d=e.map((e,t)=>(0,i.jsx)("span",Y({},o({token:e})),t));return(0,i.jsxs)("span",(s=Y({},l),c=c={children:[r?(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",{})]},Object.getOwnPropertyDescriptors?Object.defineProperties(s,Object.getOwnPropertyDescriptors(c)):(function(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);r.push.apply(r,n)}return r})(Object(c)).forEach(function(e){Object.defineProperty(s,e,Object.getOwnPropertyDescriptor(c,e))}),s))}var J=r(936);function Q(e){var t,r;return(0,i.jsx)("svg",(t=function(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter(function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable}))),n.forEach(function(t){var n;n=r[t],t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n})}return e}({viewBox:"0 0 24 24"},e),r=r={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"})},Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):(function(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);r.push.apply(r,n)}return r})(Object(r)).forEach(function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}),t))}function K(e){var t,r;return(0,i.jsx)("svg",(t=function(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter(function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable}))),n.forEach(function(t){var n;n=r[t],t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n})}return e}({viewBox:"0 0 24 24"},e),r=r={children:(0,i.jsx)("path",{fill:"currentColor",d:"M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"})},Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):(function(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);r.push.apply(r,n)}return r})(Object(r)).forEach(function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}),t))}let Z={copyButtonCopied:"copyButtonCopied_OkN_",copyButtonIcons:"copyButtonIcons_OqsO",copyButtonIcon:"copyButtonIcon_PgCn",copyButtonSuccessIcon:"copyButtonSuccessIcon_bsQG"};function ee({code:e,className:t}){let[r,n]=(0,l.useState)(!1),o=(0,l.useRef)(void 0),s=(0,l.useCallback)(()=>{(0,J.A)(e),n(!0),o.current=window.setTimeout(()=>{n(!1)},1e3)},[e]);return(0,l.useEffect)(()=>()=>window.clearTimeout(o.current),[]),(0,i.jsx)("button",{type:"button","aria-label":r?(0,p.T)({id:"theme.CodeBlock.copied",message:"Copied",description:"The copied button label on code blocks"}):(0,p.T)({id:"theme.CodeBlock.copyButtonAriaLabel",message:"Copy code to clipboard",description:"The ARIA label for copy code blocks button"}),title:(0,p.T)({id:"theme.CodeBlock.copy",message:"Copy",description:"The copy button label on code blocks"}),className:(0,a.A)("clean-btn",t,Z.copyButton,r&&Z.copyButtonCopied),onClick:s,children:(0,i.jsxs)("span",{className:Z.copyButtonIcons,"aria-hidden":"true",children:[(0,i.jsx)(Q,{className:Z.copyButtonIcon}),(0,i.jsx)(K,{className:Z.copyButtonSuccessIcon})]})})}function et(e){var t,r;return(0,i.jsx)("svg",(t=function(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter(function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable}))),n.forEach(function(t){var n;n=r[t],t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n})}return e}({viewBox:"0 0 24 24"},e),r=r={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"})},Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):(function(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);r.push.apply(r,n)}return r})(Object(r)).forEach(function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}),t))}let er={wordWrapButtonIcon:"wordWrapButtonIcon_MQXS",wordWrapButtonEnabled:"wordWrapButtonEnabled_TBIH"};function en({className:e,onClick:t,isEnabled:r}){let n=(0,p.T)({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)("button",{type:"button",onClick:t,className:(0,a.A)("clean-btn",e,r&&er.wordWrapButtonEnabled),"aria-label":n,title:n,children:(0,i.jsx)(et,{className:er.wordWrapButtonIcon,"aria-hidden":"true"})})}function eo({children:e,className:t="",metastring:r,title:n,showLineNumbers:o,language:s}){var c,d,u,p;let{prism:{defaultLanguage:h,magicComments:b}}=(0,g.p)(),j=null==(d=null!==(c=null!=s?s:function(e){let t=e.split(" ").find(e=>e.startsWith("language-"));return null==t?void 0:t.replace(/language-/,"")}(t))&&void 0!==c?c:h)?void 0:d.toLowerCase(),f=m(),y=function(){let[e,t]=(0,l.useState)(!1),[r,n]=(0,l.useState)(!1),o=(0,l.useRef)(null),s=(0,l.useCallback)(()=>{let r=o.current.querySelector("code");e?r.removeAttribute("style"):(r.style.whiteSpace="pre-wrap",r.style.overflowWrap="anywhere"),t(e=>!e)},[o,e]),c=(0,l.useCallback)(()=>{let{scrollWidth:e,clientWidth:t}=o.current;n(e>t||o.current.querySelector("code").hasAttribute("style"))},[o]);return!function(e,t){let[r,n]=(0,l.useState)(),o=(0,l.useCallback)(()=>{var t;n(null===(t=e.current)||void 0===t?void 0:t.closest("[role=tabpanel][hidden]"))},[e,n]);(0,l.useEffect)(()=>{o()},[o]),function(e,t,r=W){let n=(0,$._q)(t),o=(0,$.Be)(r);(0,l.useEffect)(()=>{let t=new MutationObserver(n);return e&&t.observe(e,o),()=>t.disconnect()},[e,n,o])}(r,e=>{e.forEach(e=>{"attributes"===e.type&&"hidden"===e.attributeName&&(t(),o())})},{attributes:!0,characterData:!1,childList:!1,subtree:!1})}(o,c),(0,l.useEffect)(()=>{c()},[e,c]),(0,l.useEffect)(()=>(window.addEventListener("resize",c,{passive:!0}),()=>{window.removeEventListener("resize",c)}),[c]),{codeBlockRef:o,isEnabled:e,isCodeScrollable:r,toggle:s}}(),x=(null!==(p=null==r?void 0:null===(u=r.match(L))||void 0===u?void 0:u.groups.title)&&void 0!==p?p:"")||n,{lineClassNames:O,code:v}=function(e,t){let r=e.replace(/\n$/,""),{language:n,magicComments:o,metastring:s}=t;if(s&&_.test(s)){let e=s.match(_).groups.range;if(0===o.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 t=o[0].className;return{lineClassNames:Object.fromEntries(B()(e).filter(e=>e>0).map(e=>[e-1,[t]])),code:r}}if(void 0===n)return{lineClassNames:{},code:r};let c=function(e,t){switch(e){case"js":case"javascript":case"ts":case"typescript":return U(["js","jsBlock"],t);case"jsx":case"tsx":return U(["js","jsBlock","jsx"],t);case"html":return U(["js","jsBlock","html"],t);case"python":case"py":case"bash":return U(["bash"],t);case"markdown":case"md":return U(["html","jsx","bash"],t);case"tex":case"latex":case"matlab":return U(["tex"],t);case"lua":case"haskell":case"sql":return U(["lua"],t);case"wasm":return U(["wasm"],t);case"vb":case"vba":case"visual-basic":return U(["vb","rem"],t);case"vbnet":return U(["vbnet","rem"],t);case"batch":return U(["rem"],t);case"basic":return U(["rem","f90"],t);case"fsharp":return U(["js","ml"],t);case"ocaml":case"sml":return U(["ml"],t);case"fortran":return U(["f90"],t);case"cobol":return U(["cobol"],t);default:return U(z,t)}}(n,o),i=r.split("\n"),l=Object.fromEntries(o.map(e=>[e.className,{start:0,range:""}])),a=Object.fromEntries(o.filter(e=>e.line).map(({className:e,line:t})=>[t,e])),d=Object.fromEntries(o.filter(e=>e.block).map(({className:e,block:t})=>[t.start,e])),u=Object.fromEntries(o.filter(e=>e.block).map(({className:e,block:t})=>[t.end,e]));for(let e=0;e<i.length;){let t=i[e].match(c);if(!t){e+=1;continue}let r=t.slice(1).find(e=>void 0!==e);a[r]?l[a[r]].range+=`${e},`:d[r]?l[d[r]].start=e:u[r]&&(l[u[r]].range+=`${l[u[r]].start}-${e-1},`),i.splice(e,1)}r=i.join("\n");let p={};return Object.entries(l).forEach(([e,{range:t}])=>{B()(t).forEach(t=>{var r;null!==(r=p[t])&&void 0!==r||(p[t]=[]),p[t].push(e)})}),{lineClassNames:p,code:r}}(e,{metastring:r,language:j,magicComments:b}),w=null!=o?o:!!(null==r?void 0:r.includes("showLineNumbers"));return(0,i.jsxs)(H,{as:"div",className:(0,a.A)(t,j&&!t.includes(`language-${j}`)&&`language-${j}`),children:[x&&(0,i.jsx)("div",{className:F.codeBlockTitle,children:x}),(0,i.jsxs)("div",{className:F.codeBlockContent,children:[(0,i.jsx)(V.f4,{theme:f,code:v,language:null!=j?j:"text",children:({className:e,style:t,tokens:r,getLineProps:n,getTokenProps:o})=>(0,i.jsx)("pre",{tabIndex:0,ref:y.codeBlockRef,className:(0,a.A)(e,F.codeBlock,"thin-scrollbar"),style:t,children:(0,i.jsx)("code",{className:(0,a.A)(F.codeBlockLines,w&&F.codeBlockLinesWithNumbering),children:r.map((e,t)=>(0,i.jsx)(X,{line:e,getLineProps:n,getTokenProps:o,classNames:O[t],showLineNumbers:w},t))})})}),(0,i.jsxs)("div",{className:F.buttonGroup,children:[(y.isEnabled||y.isCodeScrollable)&&(0,i.jsx)(en,{className:F.codeButton,onClick:()=>y.toggle(),isEnabled:y.isEnabled}),(0,i.jsx)(ee,{className:F.codeButton,code:v})]})]})]})}function es(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter(function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable}))),n.forEach(function(t){var n;n=r[t],t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n})}return e}let ec=(s=function(e){var t,r,{children:n}=e,o=function(e,t){if(null==e)return{};var r,n,o=function(e,t){if(null==e)return{};var r,n,o={},s=Object.keys(e);for(n=0;n<s.length;n++)r=s[n],t.indexOf(r)>=0||(o[r]=e[r]);return o}(e,t);if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(e);for(n=0;n<s.length;n++)r=s[n],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(o[r]=e[r])}return o}(e,["children"]);let s=(0,d.A)(),c=l.Children.toArray(n).some(e=>(0,l.isValidElement)(e))?n:Array.isArray(n)?n.join(""):n,a="string"==typeof c?eo:G;return(0,i.jsx)(a,(t=function(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter(function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable}))),n.forEach(function(t){var n;n=r[t],t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n})}return e}({},o),r=r={children:c},Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):(function(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);r.push.apply(r,n)}return r})(Object(r)).forEach(function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}),t),String(s))},function(e){return e.live?(0,i.jsx)(A,es({scope:C},e)):(0,i.jsx)(s,es({},e))});function ei(e){return(0,i.jsx)(ec,function(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter(function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable}))),n.forEach(function(t){var n;n=r[t],t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n})}return e}({},e))}},98316:(e,t,r)=>{r.r(t),r.d(t,{assets:()=>u,contentTitle:()=>d,default:()=>b,frontMatter:()=>a,metadata:()=>n,toc:()=>p});let n=JSON.parse('{"id":"migration/v2/migration-manual","title":"Manual migration","description":"This manual migration process should be run after the automated migration process, to complete the missing parts, or debug issues in the migration CLI output.","source":"@site/docs/migration/v2/migration-manual.mdx","sourceDirName":"migration/v2","slug":"/migration/v2/manual","permalink":"/docs/migration/v2/manual","draft":false,"unlisted":false,"editUrl":"https://github.com/facebook/docusaurus/edit/main/website/docs/migration/v2/migration-manual.mdx","tags":[],"version":"current","lastUpdatedBy":"dependabot[bot]","lastUpdatedAt":1726738176000,"frontMatter":{"slug":"/migration/v2/manual","toc_max_heading_level":4},"sidebar":"docs","previous":{"title":"Automated migration","permalink":"/docs/migration/v2/automated"},"next":{"title":"Versioned sites","permalink":"/docs/migration/v2/versioned-sites"}}');var o=r(62540),s=r(43023),c=r(27446),i=r(15995),l=r(92857);let a={slug:"/migration/v2/manual",toc_max_heading_level:4},d="Manual migration",u={},p=[{value:"Project setup",id:"project-setup",level:2},{value:"<code>package.json</code>",id:"packagejson",level:3},{value:"Scoped package names",id:"scoped-package-names",level:4},{value:"CLI commands",id:"cli-commands",level:4},{value:"Update references to the <code>build</code> directory",id:"update-references-to-the-build-directory",level:3},{value:"<code>.gitignore</code>",id:"gitignore",level:3},{value:"<code>README</code>",id:"readme",level:3},{value:"Site configurations",id:"site-configurations",level:2},{value:"<code>docusaurus.config.js</code>",id:"docusaurusconfigjs",level:3},{value:"Updated fields",id:"updated-fields",level:3},{value:"<code>baseUrl</code>, <code>tagline</code>, <code>title</code>, <code>url</code>, <code>favicon</code>, <code>organizationName</code>, <code>projectName</code>, <code>githubHost</code>, <code>scripts</code>, <code>stylesheets</code>",id:"baseurl-tagline-title-url-favicon-organizationname-projectname-githubhost-scripts-stylesheets",level:4},{value:"<code>colors</code>",id:"colors",level:4},{value:"<code>footerIcon</code>, <code>copyright</code>, <code>ogImage</code>, <code>twitterImage</code>, <code>docsSideNavCollapsible</code>",id:"footericon-copyright-ogimage-twitterimage-docssidenavcollapsible",level:4},{value:"<code>headerIcon</code>, <code>headerLinks</code>",id:"headericon-headerlinks",level:4},{value:"<code>algolia</code>",id:"algolia",level:4},{value:"<code>blogSidebarCount</code>",id:"blogsidebarcount",level:4},{value:"<code>cname</code>",id:"cname",level:4},{value:"<code>customDocsPath</code>, <code>docsUrl</code>, <code>editUrl</code>, <code>enableUpdateBy</code>, <code>enableUpdateTime</code>",id:"customdocspath-docsurl-editurl-enableupdateby-enableupdatetime",level:4},{value:"<code>gaTrackingId</code>",id:"gatrackingid",level:4},{value:"<code>gaGtag</code>",id:"gagtag",level:4},{value:"Removed fields",id:"removed-fields",level:3},{value:"Urls",id:"urls",level:2},{value:"Components",id:"components",level:2},{value:"Sidebar",id:"sidebar",level:3},{value:"Footer",id:"footer",level:3},{value:"Pages",id:"pages",level:3},{value:"Content",id:"content",level:2},{value:"Replace AUTOGENERATED_TABLE_OF_CONTENTS",id:"replace-autogenerated_table_of_contents",level:3},{value:"Update Markdown syntax to be MDX-compatible",id:"update-markdown-syntax-to-be-mdx-compatible",level:3},{value:"Language-specific code tabs",id:"language-specific-code-tabs",level:3},{value:"Front matter",id:"front-matter",level:3},{value:"Deployment",id:"deployment",level:2},{value:"Test your site",id:"test-your-site",level:2}];function h(e){let t={a:"a",admonition:"admonition",code:"code",h1:"h1",h2:"h2",h3:"h3",h4:"h4",header:"header",li:"li",p:"p",pre:"pre",strong:"strong",ul:"ul",...(0,s.R)(),...e.components};return(0,o.jsxs)(o.Fragment,{children:[(0,o.jsx)(t.header,{children:(0,o.jsx)(t.h1,{id:"manual-migration",children:"Manual migration"})}),"\n",(0,o.jsxs)(t.p,{children:["This manual migration process should be run after the ",(0,o.jsx)(t.a,{href:"/docs/migration/v2/automated",children:"automated migration process"}),", to complete the missing parts, or debug issues in the migration CLI output."]}),"\n",(0,o.jsx)(t.h2,{id:"project-setup",children:"Project setup"}),"\n",(0,o.jsx)(t.h3,{id:"packagejson",children:(0,o.jsx)(t.code,{children:"package.json"})}),"\n",(0,o.jsx)(t.h4,{id:"scoped-package-names",children:"Scoped package names"}),"\n",(0,o.jsx)(t.p,{children:"In Docusaurus 2, we use scoped package names:"}),"\n",(0,o.jsxs)(t.ul,{children:["\n",(0,o.jsxs)(t.li,{children:[(0,o.jsx)(t.code,{children:"docusaurus"})," \u2192 ",(0,o.jsx)(t.code,{children:"@docusaurus/core"})]}),"\n"]}),"\n",(0,o.jsxs)(t.p,{children:["This provides a clear distinction between Docusaurus' official packages and community maintained packages. In another words, all Docusaurus' official packages are namespaced under ",(0,o.jsx)(t.code,{children:"@docusaurus/"}),"."]}),"\n",(0,o.jsxs)(t.p,{children:["Meanwhile, the default doc site functionalities provided by Docusaurus 1 are now provided by ",(0,o.jsx)(t.code,{children:"@docusaurus/preset-classic"}),". Therefore, we need to add this dependency as well:"]}),"\n",(0,o.jsx)(t.pre,{children:(0,o.jsx)(t.code,{className:"language-diff",metastring:'title="package.json"',children:'{\n dependencies: {\n- "docusaurus": "^1.x.x",\n+ "@docusaurus/core": "^2.0.0-beta.0",\n+ "@docusaurus/preset-classic": "^2.0.0-beta.0",\n }\n}\n'})}),"\n",(0,o.jsx)(t.admonition,{type:"tip",children:(0,o.jsxs)(t.p,{children:["Please use the most recent Docusaurus 2 version, which you can check out ",(0,o.jsx)(t.a,{href:"https://www.npmjs.com/package/@docusaurus/core",children:"here"})," (using the ",(0,o.jsx)(t.code,{children:"latest"})," tag)."]})}),"\n",(0,o.jsx)(t.h4,{id:"cli-commands",children:"CLI commands"}),"\n",(0,o.jsxs)(t.p,{children:["Meanwhile, CLI commands are renamed to ",(0,o.jsx)(t.code,{children:"docusaurus <command>"})," (instead of ",(0,o.jsx)(t.code,{children:"docusaurus-command"}),")."]}),"\n",(0,o.jsxs)(t.p,{children:["The ",(0,o.jsx)(t.code,{children:'"scripts"'})," section of your ",(0,o.jsx)(t.code,{children:"package.json"})," should be updated as follows:"]}),"\n",(0,o.jsx)(t.pre,{children:(0,o.jsx)(t.code,{className:"language-json",metastring:'{3-6} title="package.json"',children:'{\n "scripts": {\n "start": "docusaurus start",\n "build": "docusaurus build",\n "swizzle": "docusaurus swizzle",\n "deploy": "docusaurus deploy"\n // ...\n }\n}\n'})}),"\n",(0,o.jsxs)(t.p,{children:["A typical Docusaurus 2 ",(0,o.jsx)(t.code,{children:"package.json"})," may look like this:"]}),"\n",(0,o.jsx)(t.pre,{children:(0,o.jsx)(t.code,{className:"language-json",metastring:'title="package.json"',children:'{\n "scripts": {\n "docusaurus": "docusaurus",\n "start": "docusaurus start",\n "build": "docusaurus build",\n "swizzle": "docusaurus swizzle",\n "deploy": "docusaurus deploy",\n "serve": "docusaurus serve",\n "clear": "docusaurus clear"\n },\n "dependencies": {\n "@docusaurus/core": "^2.0.0-beta.0",\n "@docusaurus/preset-classic": "^2.0.0-beta.0",\n "clsx": "^1.1.1",\n "react": "^17.0.2",\n "react-dom": "^17.0.2"\n },\n "browserslist": {\n "production": [">0.5%", "not dead", "not op_mini all"],\n "development": [\n "last 1 chrome version",\n "last 1 firefox version",\n "last 1 safari version"\n ]\n }\n}\n'})}),"\n",(0,o.jsxs)(t.h3,{id:"update-references-to-the-build-directory",children:["Update references to the ",(0,o.jsx)(t.code,{children:"build"})," directory"]}),"\n",(0,o.jsxs)(t.p,{children:["In Docusaurus 1, all the build artifacts are located within ",(0,o.jsx)(t.code,{children:"website/build/<PROJECT_NAME>"}),"."]}),"\n",(0,o.jsxs)(t.p,{children:["In Docusaurus 2, it is now moved to just ",(0,o.jsx)(t.code,{children:"website/build"}),". Make sure that you update your deployment configuration to read the generated files from the correct ",(0,o.jsx)(t.code,{children:"build"})," directory."]}),"\n",(0,o.jsxs)(t.p,{children:["If you are deploying to GitHub pages, make sure to run ",(0,o.jsx)(t.code,{children:"yarn deploy"})," instead of ",(0,o.jsx)(t.code,{children:"yarn publish-gh-pages"})," script."]}),"\n",(0,o.jsx)(t.h3,{id:"gitignore",children:(0,o.jsx)(t.code,{children:".gitignore"})}),"\n",(0,o.jsxs)(t.p,{children:["The ",(0,o.jsx)(t.code,{children:".gitignore"})," in your ",(0,o.jsx)(t.code,{children:"website"})," should contain:"]}),"\n",(0,o.jsx)(t.pre,{children:(0,o.jsx)(t.code,{className:"language-bash",metastring:'title=".gitignore"',children:"# dependencies\n/node_modules\n\n# production\n/build\n\n# generated files\n.docusaurus\n.cache-loader\n\n# misc\n.DS_Store\n.env.local\n.env.development.local\n.env.test.local\n.env.production.local\n\nnpm-debug.log*\nyarn-debug.log*\nyarn-error.log*\n"})}),"\n",(0,o.jsx)(t.h3,{id:"readme",children:(0,o.jsx)(t.code,{children:"README"})}),"\n",(0,o.jsxs)(t.p,{children:["The D1 website may have an existing README file. You can modify it to reflect the D2 changes, or copy the default ",(0,o.jsx)(t.a,{href:"https://github.com/facebook/docusaurus/blob/main/packages/create-docusaurus/templates/shared/README.md",children:"Docusaurus v2 README"}),"."]}),"\n",(0,o.jsx)(t.h2,{id:"site-configurations",children:"Site configurations"}),"\n",(0,o.jsx)(t.h3,{id:"docusaurusconfigjs",children:(0,o.jsx)(t.code,{children:"docusaurus.config.js"})}),"\n",(0,o.jsxs)(t.p,{children:["Rename ",(0,o.jsx)(t.code,{children:"siteConfig.js"})," to ",(0,o.jsx)(t.code,{children:"docusaurus.config.js"}),"."]}),"\n",(0,o.jsxs)(t.p,{children:["In Docusaurus 2, we split each functionality (blog, docs, pages) into plugins for modularity. Presets are bundles of plugins and for backward compatibility we built a ",(0,o.jsx)(t.code,{children:"@docusaurus/preset-classic"})," preset which bundles most of the essential plugins present in Docusaurus 1."]}),"\n",(0,o.jsxs)(t.p,{children:["Add the following preset configuration to your ",(0,o.jsx)(t.code,{children:"docusaurus.config.js"}),"."]}),"\n",(0,o.jsx)(t.pre,{children:(0,o.jsx)(t.code,{className:"language-js",metastring:'title="docusaurus.config.js"',children:"module.exports = {\n // ...\n presets: [\n [\n '@docusaurus/preset-classic',\n {\n docs: {\n // Docs folder path relative to website dir.\n path: '../docs',\n // Sidebars file relative to website dir.\n sidebarPath: require.resolve('./sidebars.json'),\n },\n // ...\n },\n ],\n ],\n};\n"})}),"\n",(0,o.jsxs)(t.p,{children:["We recommend moving the ",(0,o.jsx)(t.code,{children:"docs"})," folder into the ",(0,o.jsx)(t.code,{children:"website"})," folder and that is also the default directory structure in v2. ",(0,o.jsx)(t.a,{href:"https://vercel.com",children:"Vercel"})," supports ",(0,o.jsx)(t.a,{href:"https://github.com/vercel/vercel/tree/main/examples/docusaurus",children:"Docusaurus project deployments out-of-the-box"})," if the ",(0,o.jsx)(t.code,{children:"docs"})," directory is within the ",(0,o.jsx)(t.code,{children:"website"}),". It is also generally better for the docs to be within the website so that the docs and the rest of the website code are co-located within one ",(0,o.jsx)(t.code,{children:"website"})," directory."]}),"\n",(0,o.jsxs)(t.p,{children:["If you are migrating your Docusaurus v1 website, and there are pending documentation pull requests, you can temporarily keep the ",(0,o.jsx)(t.code,{children:"/docs"})," folder to its original place, to avoid producing conflicts."]}),"\n",(0,o.jsxs)(t.p,{children:["Refer to migration guide below for each field in ",(0,o.jsx)(t.code,{children:"siteConfig.js"}),"."]}),"\n",(0,o.jsx)(t.h3,{id:"updated-fields",children:"Updated fields"}),"\n",(0,o.jsxs)(t.h4,{id:"baseurl-tagline-title-url-favicon-organizationname-projectname-githubhost-scripts-stylesheets",children:[(0,o.jsx)(t.code,{children:"baseUrl"}),", ",(0,o.jsx)(t.code,{children:"tagline"}),", ",(0,o.jsx)(t.code,{children:"title"}),", ",(0,o.jsx)(t.code,{children:"url"}),", ",(0,o.jsx)(t.code,{children:"favicon"}),", ",(0,o.jsx)(t.code,{children:"organizationName"}),", ",(0,o.jsx)(t.code,{children:"projectName"}),", ",(0,o.jsx)(t.code,{children:"githubHost"}),", ",(0,o.jsx)(t.code,{children:"scripts"}),", ",(0,o.jsx)(t.code,{children:"stylesheets"})]}),"\n",(0,o.jsx)(t.p,{children:"No actions needed, these configuration fields were not modified."}),"\n",(0,o.jsx)(t.h4,{id:"colors",children:(0,o.jsx)(t.code,{children:"colors"})}),"\n",(0,o.jsxs)(t.p,{children:["Deprecated. We wrote a custom CSS framework for Docusaurus 2 called ",(0,o.jsx)(t.a,{href:"https://infima.dev/",children:"Infima"})," which uses CSS variables for theming. The docs are not quite ready yet and we will update here when it is. To overwrite Infima's CSS variables, create your own CSS file (e.g. ",(0,o.jsx)(t.code,{children:"./src/css/custom.css"}),") and import it globally by passing it as an option to ",(0,o.jsx)(t.code,{children:"@docusaurus/preset-classic"}),":"]}),"\n",(0,o.jsx)(t.pre,{children:(0,o.jsx)(t.code,{className:"language-js",metastring:'{7-9} title="docusaurus.config.js"',children:"module.exports = {\n // ...\n presets: [\n [\n '@docusaurus/preset-classic',\n {\n theme: {\n customCss: [require.resolve('./src/css/custom.css')],\n },\n },\n ],\n ],\n};\n"})}),"\n",(0,o.jsx)(t.p,{children:"Infima uses 7 shades of each color."}),"\n",(0,o.jsx)(t.pre,{children:(0,o.jsx)(t.code,{className:"language-css",metastring:'title="/src/css/custom.css"',children:"/**\n * You can override the default Infima variables here.\n * Note: this is not a complete list of --ifm- variables.\n */\n:root {\n --ifm-color-primary: #25c2a0;\n --ifm-color-primary-dark: rgb(33, 175, 144);\n --ifm-color-primary-darker: rgb(31, 165, 136);\n --ifm-color-primary-darkest: rgb(26, 136, 112);\n --ifm-color-primary-light: rgb(70, 203, 174);\n --ifm-color-primary-lighter: rgb(102, 212, 189);\n --ifm-color-primary-lightest: rgb(146, 224, 208);\n}\n"})}),"\n",(0,o.jsxs)(t.p,{children:["We recommend using ",(0,o.jsx)(t.a,{href:"https://www.colorbox.io/",children:"ColorBox"})," to find the different shades of colors for your chosen primary color."]}),"\n",(0,o.jsxs)(t.p,{children:["Alternatively, use the following tool to generate the different shades for your website and copy the variables into ",(0,o.jsx)(t.code,{children:"src/css/custom.css"}),"."]}),"\n","\n",(0,o.jsx)(l.A,{}),"\n",(0,o.jsxs)(t.h4,{id:"footericon-copyright-ogimage-twitterimage-docssidenavcollapsible",children:[(0,o.jsx)(t.code,{children:"footerIcon"}),", ",(0,o.jsx)(t.code,{children:"copyright"}),", ",(0,o.jsx)(t.code,{children:"ogImage"}),", ",(0,o.jsx)(t.code,{children:"twitterImage"}),", ",(0,o.jsx)(t.code,{children:"docsSideNavCollapsible"})]}),"\n",(0,o.jsxs)(t.p,{children:["Site meta info such as assets, SEO, copyright info are now handled by themes. To customize them, use the ",(0,o.jsx)(t.code,{children:"themeConfig"})," field in your ",(0,o.jsx)(t.code,{children:"docusaurus.config.js"}),":"]}),"\n",(0,o.jsx)(t.pre,{children:(0,o.jsx)(t.code,{className:"language-js",metastring:'title="docusaurus.config.js"',children:"module.exports = {\n // ...\n themeConfig: {\n footer: {\n logo: {\n alt: 'Meta Open Source Logo',\n src: '/img/meta_oss_logo.png',\n href: 'https://opensource.facebook.com/',\n },\n copyright: `Copyright \xa9 ${new Date().getFullYear()} Facebook, Inc.`, // You can also put own HTML here.\n },\n image: 'img/docusaurus.png',\n // ...\n },\n};\n"})}),"\n",(0,o.jsxs)(t.h4,{id:"headericon-headerlinks",children:[(0,o.jsx)(t.code,{children:"headerIcon"}),", ",(0,o.jsx)(t.code,{children:"headerLinks"})]}),"\n",(0,o.jsxs)(t.p,{children:["In Docusaurus 1, header icon and header links were root fields in ",(0,o.jsx)(t.code,{children:"siteConfig"}),":"]}),"\n",(0,o.jsx)(t.pre,{children:(0,o.jsx)(t.code,{className:"language-js",metastring:'title="siteConfig.js"',children:'headerIcon: \'img/docusaurus.svg\',\nheaderLinks: [\n { doc: "doc1", label: "Getting Started" },\n { page: "help", label: "Help" },\n { href: "https://github.com/", label: "GitHub" },\n { blog: true, label: "Blog" },\n],\n'})}),"\n",(0,o.jsx)(t.p,{children:"Now, these two fields are both handled by the theme:"}),"\n",(0,o.jsx)(t.pre,{children:(0,o.jsx)(t.code,{className:"language-js",metastring:'{6-19} title="docusaurus.config.js"',children:"module.exports = {\n // ...\n themeConfig: {\n navbar: {\n title: 'Docusaurus',\n logo: {\n alt: 'Docusaurus Logo',\n src: 'img/docusaurus.svg',\n },\n items: [\n {to: 'docs/doc1', label: 'Getting Started', position: 'left'},\n {to: 'help', label: 'Help', position: 'left'},\n {\n href: 'https://github.com/',\n label: 'GitHub',\n position: 'right',\n },\n {to: 'blog', label: 'Blog', position: 'left'},\n ],\n },\n // ...\n },\n};\n"})}),"\n",(0,o.jsx)(t.h4,{id:"algolia",children:(0,o.jsx)(t.code,{children:"algolia"})}),"\n",(0,o.jsx)(t.pre,{children:(0,o.jsx)(t.code,{className:"language-js",metastring:'{4-8} title="docusaurus.config.js"',children:"module.exports = {\n // ...\n themeConfig: {\n algolia: {\n apiKey: '47ecd3b21be71c5822571b9f59e52544',\n indexName: 'docusaurus-2',\n algoliaOptions: { //... },\n },\n // ...\n },\n};\n"})}),"\n",(0,o.jsxs)(t.admonition,{type:"warning",children:[(0,o.jsxs)(t.p,{children:["Your Algolia DocSearch v1 config (found ",(0,o.jsx)(t.a,{href:"https://github.com/algolia/docsearch-configs/blob/master/configs",children:"here"}),") should be updated for Docusaurus v2 (",(0,o.jsx)(t.a,{href:"https://github.com/algolia/docsearch-configs/tree/master/configs/docusaurus-2.json",children:"example"}),")."]}),(0,o.jsx)(t.p,{children:"You can contact the DocSearch team (@shortcuts, @s-pace) for support. They can update it for you and trigger a recrawl of your site to restore the search (otherwise you will have to wait up to 24h for the next scheduled crawl)"})]}),"\n",(0,o.jsx)(t.h4,{id:"blogsidebarcount",children:(0,o.jsx)(t.code,{children:"blogSidebarCount"})}),"\n",(0,o.jsxs)(t.p,{children:["Deprecated. Pass it as a blog option to ",(0,o.jsx)(t.code,{children:"@docusaurus/preset-classic"})," instead:"]}),"\n",(0,o.jsx)(t.pre,{children:(0,o.jsx)(t.code,{className:"language-js",metastring:'{8} title="docusaurus.config.js"',children:"module.exports = {\n // ...\n presets: [\n [\n '@docusaurus/preset-classic',\n {\n blog: {\n postsPerPage: 10,\n },\n // ...\n },\n ],\n ],\n};\n"})}),"\n",(0,o.jsx)(t.h4,{id:"cname",children:(0,o.jsx)(t.code,{children:"cname"})}),"\n",(0,o.jsxs)(t.p,{children:["Deprecated. Create a ",(0,o.jsx)(t.code,{children:"CNAME"})," file in your ",(0,o.jsx)(t.code,{children:"static"})," folder instead with your custom domain. Files in the ",(0,o.jsx)(t.code,{children:"static"})," folder will be copied into the root of the ",(0,o.jsx)(t.code,{children:"build"})," folder during execution of the build command."]}),"\n",(0,o.jsxs)(t.h4,{id:"customdocspath-docsurl-editurl-enableupdateby-enableupdatetime",children:[(0,o.jsx)(t.code,{children:"customDocsPath"}),", ",(0,o.jsx)(t.code,{children:"docsUrl"}),", ",(0,o.jsx)(t.code,{children:"editUrl"}),", ",(0,o.jsx)(t.code,{children:"enableUpdateBy"}),", ",(0,o.jsx)(t.code,{children:"enableUpdateTime"})]}),"\n",(0,o.jsxs)(t.p,{children:[(0,o.jsx)(t.strong,{children:"BREAKING"}),": ",(0,o.jsx)(t.code,{children:"editUrl"})," should point to (website) Docusaurus project instead of ",(0,o.jsx)(t.code,{children:"docs"})," directory."]}),"\n",(0,o.jsxs)(t.p,{children:["Deprecated. Pass it as an option to ",(0,o.jsx)(t.code,{children:"@docusaurus/preset-classic"})," docs instead:"]}),"\n",(0,o.jsx)(t.pre,{children:(0,o.jsx)(t.code,{className:"language-js",metastring:'{8-20} title="docusaurus.config.js"',children:"module.exports = {\n // ...\n presets: [\n [\n '@docusaurus/preset-classic',\n {\n docs: {\n // Equivalent to `customDocsPath`.\n path: 'docs',\n // Equivalent to `editUrl` but should point to `website` dir instead of `website/docs`.\n editUrl: 'https://github.com/facebook/docusaurus/edit/main/website',\n // Equivalent to `docsUrl`.\n routeBasePath: 'docs',\n // Remark and Rehype plugins passed to MDX. Replaces `markdownOptions` and `markdownPlugins`.\n remarkPlugins: [],\n rehypePlugins: [],\n // Equivalent to `enableUpdateBy`.\n showLastUpdateAuthor: true,\n // Equivalent to `enableUpdateTime`.\n showLastUpdateTime: true,\n },\n // ...\n },\n ],\n ],\n};\n"})}),"\n",(0,o.jsx)(t.h4,{id:"gatrackingid",children:(0,o.jsx)(t.code,{children:"gaTrackingId"})}),"\n",(0,o.jsx)(t.pre,{children:(0,o.jsx)(t.code,{className:"language-js",metastring:'title="docusaurus.config.js"',children:"module.exports = {\n // ...\n presets: [\n [\n '@docusaurus/preset-classic',\n {\n // ...\n // highlight-start\n googleAnalytics: {\n trackingID: 'UA-141789564-1',\n },\n // highlight-end\n },\n ],\n ],\n};\n"})}),"\n",(0,o.jsx)(t.h4,{id:"gagtag",children:(0,o.jsx)(t.code,{children:"gaGtag"})}),"\n",(0,o.jsx)(t.pre,{children:(0,o.jsx)(t.code,{className:"language-js",metastring:'title="docusaurus.config.js"',children:"module.exports = {\n // ...\n presets: [\n [\n '@docusaurus/preset-classic',\n {\n // ...\n // highlight-start\n gtag: {\n trackingID: 'UA-141789564-1',\n },\n // highlight-end\n },\n ],\n ],\n};\n"})}),"\n",(0,o.jsx)(t.h3,{id:"removed-fields",children:"Removed fields"}),"\n",(0,o.jsx)(t.p,{children:"The following fields are all deprecated, you may remove from your configuration file."}),"\n",(0,o.jsxs)(t.ul,{children:["\n",(0,o.jsx)(t.li,{children:(0,o.jsx)(t.code,{children:"blogSidebarTitle"})}),"\n",(0,o.jsxs)(t.li,{children:[(0,o.jsx)(t.code,{children:"cleanUrl"})," - Clean URL is used by default now."]}),"\n",(0,o.jsxs)(t.li,{children:[(0,o.jsx)(t.code,{children:"defaultVersionShown"})," - Versioning is not ported yet. You'd be unable to migration to Docusaurus 2 if you are using versioning. Stay tuned."]}),"\n",(0,o.jsx)(t.li,{children:(0,o.jsx)(t.code,{children:"disableHeaderTitle"})}),"\n",(0,o.jsx)(t.li,{children:(0,o.jsx)(t.code,{children:"disableTitleTagline"})}),"\n",(0,o.jsxs)(t.li,{children:[(0,o.jsx)(t.code,{children:"docsSideNavCollapsible"})," is available at ",(0,o.jsx)(t.code,{children:"docsPluginOptions.sidebarCollapsible"}),", and this is turned on by default now."]}),"\n",(0,o.jsx)(t.li,{children:(0,o.jsx)(t.code,{children:"facebookAppId"})}),"\n",(0,o.jsx)(t.li,{children:(0,o.jsx)(t.code,{children:"facebookComments"})}),"\n",(0,o.jsx)(t.li,{children:(0,o.jsx)(t.code,{children:"facebookPixelId"})}),"\n",(0,o.jsx)(t.li,{children:(0,o.jsx)(t.code,{children:"fonts"})}),"\n",(0,o.jsxs)(t.li,{children:[(0,o.jsx)(t.code,{children:"highlight"})," - We now use ",(0,o.jsx)(t.a,{href:"https://prismjs.com/",children:"Prism"})," instead of ",(0,o.jsx)(t.a,{href:"https://highlightjs.org/",children:"highlight.js"}),"."]}),"\n",(0,o.jsxs)(t.li,{children:[(0,o.jsx)(t.code,{children:"markdownOptions"})," - We use MDX in v2 instead of Remarkable. Your Markdown options have to be converted to Remark/Rehype plugins."]}),"\n",(0,o.jsxs)(t.li,{children:[(0,o.jsx)(t.code,{children:"markdownPlugins"})," - We use MDX in v2 instead of Remarkable. Your Markdown plugins have to be converted to Remark/Rehype plugins."]}),"\n",(0,o.jsx)(t.li,{children:(0,o.jsx)(t.code,{children:"manifest"})}),"\n",(0,o.jsxs)(t.li,{children:[(0,o.jsx)(t.code,{children:"onPageNav"})," - This is turned on by default now."]}),"\n",(0,o.jsxs)(t.li,{children:[(0,o.jsx)(t.code,{children:"separateCss"})," - It can imported in the same manner as ",(0,o.jsx)(t.code,{children:"custom.css"})," mentioned above."]}),"\n",(0,o.jsx)(t.li,{children:(0,o.jsx)(t.code,{children:"scrollToTop"})}),"\n",(0,o.jsx)(t.li,{children:(0,o.jsx)(t.code,{children:"scrollToTopOptions"})}),"\n",(0,o.jsx)(t.li,{children:(0,o.jsx)(t.code,{children:"translationRecruitingLink"})}),"\n",(0,o.jsx)(t.li,{children:(0,o.jsx)(t.code,{children:"twitter"})}),"\n",(0,o.jsx)(t.li,{children:(0,o.jsx)(t.code,{children:"twitterUsername"})}),"\n",(0,o.jsx)(t.li,{children:(0,o.jsx)(t.code,{children:"useEnglishUrl"})}),"\n",(0,o.jsx)(t.li,{children:(0,o.jsx)(t.code,{children:"users"})}),"\n",(0,o.jsxs)(t.li,{children:[(0,o.jsx)(t.code,{children:"usePrism"})," - We now use ",(0,o.jsx)(t.a,{href:"https://prismjs.com/",children:"Prism"})," instead of ",(0,o.jsx)(t.a,{href:"https://highlightjs.org/",children:"highlight.js"})]}),"\n",(0,o.jsx)(t.li,{children:(0,o.jsx)(t.code,{children:"wrapPagesHTML"})}),"\n"]}),"\n",(0,o.jsx)(t.p,{children:"We intend to implement many of the deprecated config fields as plugins in future. Help will be appreciated!"}),"\n",(0,o.jsx)(t.h2,{id:"urls",children:"Urls"}),"\n",(0,o.jsxs)(t.p,{children:["In v1, all pages were available with or without the ",(0,o.jsx)(t.code,{children:".html"})," extension."]}),"\n",(0,o.jsx)(t.p,{children:"For example, these 2 pages exist:"}),"\n",(0,o.jsxs)(t.ul,{children:["\n",(0,o.jsx)(t.li,{children:(0,o.jsx)(t.a,{href:"https://v1.docusaurus.io/docs/en/installation",children:(0,o.jsx)(t.code,{children:"https://v1.docusaurus.io/docs/en/installation"})})}),"\n",(0,o.jsx)(t.li,{children:(0,o.jsx)(t.a,{href:"https://v1.docusaurus.io/docs/en/installation.html",children:(0,o.jsx)(t.code,{children:"https://v1.docusaurus.io/docs/en/installation.html"})})}),"\n"]}),"\n",(0,o.jsxs)(t.p,{children:["If ",(0,o.jsx)(t.a,{href:"https://v1.docusaurus.io/docs/en/site-config#cleanurl-boolean",children:(0,o.jsx)(t.code,{children:"cleanUrl"})})," was:"]}),"\n",(0,o.jsxs)(t.ul,{children:["\n",(0,o.jsxs)(t.li,{children:[(0,o.jsx)(t.code,{children:"true"}),": links would target ",(0,o.jsx)(t.code,{children:"/installation"})]}),"\n",(0,o.jsxs)(t.li,{children:[(0,o.jsx)(t.code,{children:"false"}),": links would target ",(0,o.jsx)(t.code,{children:"/installation.html"})]}),"\n"]}),"\n",(0,o.jsxs)(t.p,{children:["In v2, by default, the canonical page is ",(0,o.jsx)(t.code,{children:"/installation"}),", and not ",(0,o.jsx)(t.code,{children:"/installation.html"}),"."]}),"\n",(0,o.jsxs)(t.p,{children:["If you had ",(0,o.jsx)(t.code,{children:"cleanUrl: false"})," in v1, it's possible that people published links to ",(0,o.jsx)(t.code,{children:"/installation.html"}),"."]}),"\n",(0,o.jsx)(t.p,{children:"For SEO reasons, and avoiding breaking links, you should configure server-side redirect rules on your hosting provider."}),"\n",(0,o.jsxs)(t.p,{children:["As an escape hatch, you could use ",(0,o.jsx)(t.a,{href:"/docs/api/plugins/@docusaurus/plugin-client-redirects",children:"@docusaurus/plugin-client-redirects"})," to create client-side redirects from ",(0,o.jsx)(t.code,{children:"/installation.html"})," to ",(0,o.jsx)(t.code,{children:"/installation"}),"."]}),"\n",(0,o.jsx)(t.pre,{children:(0,o.jsx)(t.code,{className:"language-js",children:"module.exports = {\n plugins: [\n [\n '@docusaurus/plugin-client-redirects',\n {\n fromExtensions: ['html'],\n },\n ],\n ],\n};\n"})}),"\n",(0,o.jsxs)(t.p,{children:["If you want to keep the ",(0,o.jsx)(t.code,{children:".html"})," extension as the canonical URL of a page, docs can declare a ",(0,o.jsx)(t.code,{children:"slug: installation.html"})," front matter."]}),"\n",(0,o.jsx)(t.h2,{id:"components",children:"Components"}),"\n",(0,o.jsx)(t.h3,{id:"sidebar",children:"Sidebar"}),"\n",(0,o.jsxs)(t.p,{children:["In previous version, nested sidebar category is not allowed and sidebar category can only contain doc ID. However, v2 allows infinite nested sidebar and we have many types of ",(0,o.jsx)(t.a,{href:"/docs/sidebar/items",children:"Sidebar Item"})," other than document."]}),"\n",(0,o.jsxs)(t.p,{children:["You'll have to migrate your sidebar if it contains category type. Rename ",(0,o.jsx)(t.code,{children:"subcategory"})," to ",(0,o.jsx)(t.code,{children:"category"})," and ",(0,o.jsx)(t.code,{children:"ids"})," to ",(0,o.jsx)(t.code,{children:"items"}),"."]}),"\n",(0,o.jsx)(t.pre,{children:(0,o.jsx)(t.code,{className:"language-diff",metastring:'title="sidebars.json"',children:"{\n- type: 'subcategory',\n+ type: 'category',\n label: 'My Example Subcategory',\n+ items: ['doc1'],\n- ids: ['doc1']\n},\n"})}),"\n",(0,o.jsx)(t.h3,{id:"footer",children:"Footer"}),"\n",(0,o.jsxs)(t.p,{children:[(0,o.jsx)(t.code,{children:"website/core/Footer.js"})," is no longer needed. If you want to modify the default footer provided by Docusaurus, ",(0,o.jsx)(t.a,{href:"/docs/swizzling",children:"swizzle"})," it:"]}),"\n",(0,o.jsxs)(c.A,{groupId:"npm2yarn",children:[(0,o.jsx)(i.A,{value:"npm",children:(0,o.jsx)(t.pre,{children:(0,o.jsx)(t.code,{className:"language-bash",children:"npm run swizzle @docusaurus/theme-classic Footer\n"})})}),(0,o.jsx)(i.A,{value:"yarn",label:"Yarn",children:(0,o.jsx)(t.pre,{children:(0,o.jsx)(t.code,{className:"language-bash",children:"yarn swizzle @docusaurus/theme-classic Footer\n"})})}),(0,o.jsx)(i.A,{value:"pnpm",label:"pnpm",children:(0,o.jsx)(t.pre,{children:(0,o.jsx)(t.code,{className:"language-bash",children:"pnpm run swizzle @docusaurus/theme-classic Footer\n"})})})]}),"\n",(0,o.jsxs)(t.p,{children:["This will copy the current ",(0,o.jsx)(t.code,{children:"<Footer />"})," component used by the theme to a ",(0,o.jsx)(t.code,{children:"src/theme/Footer"})," directory under the root of your site, you may then edit this component for customization."]}),"\n",(0,o.jsxs)(t.p,{children:["Do not swizzle the Footer just to add the logo on the left. The logo is intentionally removed in v2 and moved to the bottom. Just configure the footer in ",(0,o.jsx)(t.code,{children:"docusaurus.config.js"})," with ",(0,o.jsx)(t.code,{children:"themeConfig.footer"}),":"]}),"\n",(0,o.jsx)(t.pre,{children:(0,o.jsx)(t.code,{className:"language-js",children:"module.exports = {\n themeConfig: {\n footer: {\n logo: {\n alt: 'Meta Open Source Logo',\n src: '/img/meta_oss_logo.png',\n href: 'https://opensource.facebook.com',\n },\n },\n },\n};\n"})}),"\n",(0,o.jsx)(t.h3,{id:"pages",children:"Pages"}),"\n",(0,o.jsxs)(t.p,{children:["Please refer to ",(0,o.jsx)(t.a,{href:"/docs/creating-pages",children:"creating pages"})," to learn how Docusaurus 2 pages work. After reading that, notice that you have to move ",(0,o.jsx)(t.code,{children:"pages/en"})," files in v1 to ",(0,o.jsx)(t.code,{children:"src/pages"})," instead."]}),"\n",(0,o.jsxs)(t.p,{children:["In Docusaurus v1, pages received the ",(0,o.jsx)(t.code,{children:"siteConfig"})," object as props."]}),"\n",(0,o.jsxs)(t.p,{children:["In Docusaurus v2, get the ",(0,o.jsx)(t.code,{children:"siteConfig"})," object from ",(0,o.jsx)(t.code,{children:"useDocusaurusContext"})," instead."]}),"\n",(0,o.jsx)(t.p,{children:"In v2, you have to apply the theme layout around each page. The Layout component takes metadata props."}),"\n",(0,o.jsxs)(t.p,{children:[(0,o.jsx)(t.code,{children:"CompLibrary"})," is deprecated in v2, so you have to write your own React component or use Infima styles (Docs will be available soon, sorry about that! In the meanwhile, inspect the V2 website or view ",(0,o.jsx)(t.a,{href:"https://infima.dev/",children:"https://infima.dev/"})," to see what styles are available)."]}),"\n",(0,o.jsx)(t.p,{children:"You can migrate CommonJS to ES6 imports/exports."}),"\n",(0,o.jsx)(t.p,{children:"Here's a typical Docusaurus v2 page:"}),"\n",(0,o.jsx)(t.pre,{children:(0,o.jsx)(t.code,{className:"language-jsx",children:'import React from \'react\';\nimport Link from \'@docusaurus/Link\';\nimport useDocusaurusContext from \'@docusaurus/useDocusaurusContext\';\nimport Layout from \'@theme/Layout\';\n\nconst MyPage = () => {\n const {siteConfig} = useDocusaurusContext();\n return (\n <Layout title={siteConfig.title} description={siteConfig.tagline}>\n <div className="hero text--center">\n <div className="container ">\n <div className="padding-vert--md">\n <h1 className="hero__title">{siteConfig.title}</h1>\n <p className="hero__subtitle">{siteConfig.tagline}</p>\n </div>\n <div>\n <Link\n to="/docs/get-started"\n className="button button--lg button--outline button--primary">\n Get started\n </Link>\n </div>\n </div>\n </div>\n </Layout>\n );\n};\n\nexport default MyPage;\n'})}),"\n",(0,o.jsx)(t.p,{children:"The following code could be helpful for migration of various pages:"}),"\n",(0,o.jsxs)(t.ul,{children:["\n",(0,o.jsxs)(t.li,{children:["Index page - ",(0,o.jsx)(t.a,{href:"https://github.com/facebook/flux/blob/master/website/src/pages/index.js/",children:"Flux"})," (recommended), ",(0,o.jsx)(t.a,{href:"https://github.com/facebook/docusaurus/blob/main/website/src/pages/index.js/",children:"Docusaurus 2"}),", ",(0,o.jsx)(t.a,{href:"https://github.com/facebook/hermes/blob/main/website/src/pages/index.js/",children:"Hermes"})]}),"\n",(0,o.jsxs)(t.li,{children:["Help/Support page - ",(0,o.jsx)(t.a,{href:"https://github.com/facebook/docusaurus/blob/main/website/src/pages/help.js/",children:"Docusaurus 2"}),", ",(0,o.jsx)(t.a,{href:"http://facebook.github.io/flux/support",children:"Flux"})]}),"\n"]}),"\n",(0,o.jsx)(t.h2,{id:"content",children:"Content"}),"\n",(0,o.jsx)(t.h3,{id:"replace-autogenerated_table_of_contents",children:"Replace AUTOGENERATED_TABLE_OF_CONTENTS"}),"\n",(0,o.jsxs)(t.p,{children:["This feature is replaced by ",(0,o.jsx)(t.a,{href:"/docs/markdown-features/toc#inline-table-of-contents",children:"inline table of content"})]}),"\n",(0,o.jsx)(t.h3,{id:"update-markdown-syntax-to-be-mdx-compatible",children:"Update Markdown syntax to be MDX-compatible"}),"\n",(0,o.jsxs)(t.p,{children:["In Docusaurus 2, the Markdown syntax has been changed to ",(0,o.jsx)(t.a,{href:"https://mdxjs.com/",children:"MDX"}),". Hence there might be some broken syntax in the existing docs which you would have to update. A common example is self-closing tags like ",(0,o.jsx)(t.code,{children:"<img>"})," and ",(0,o.jsx)(t.code,{children:"<br>"})," which are valid in HTML would have to be explicitly closed now ( ",(0,o.jsx)(t.code,{children:"<img/>"})," and ",(0,o.jsx)(t.code,{children:"<br/>"}),"). All tags in MDX documents have to be valid JSX."]}),"\n",(0,o.jsxs)(t.p,{children:["Front matter is parsed by ",(0,o.jsx)(t.a,{href:"https://github.com/jonschlinkert/gray-matter",children:"gray-matter"}),". If your front matter use special characters like ",(0,o.jsx)(t.code,{children:":"}),", you now need to quote it: ",(0,o.jsx)(t.code,{children:"title: Part 1: my part1 title"})," \u2192 ",(0,o.jsx)(t.code,{children:'title: "Part 1: my part1 title"'}),"."]}),"\n",(0,o.jsxs)(t.p,{children:[(0,o.jsx)(t.strong,{children:"Tips"}),": You might want to use some online tools like ",(0,o.jsx)(t.a,{href:"https://transform.tools/html-to-jsx",children:"HTML to JSX"})," to make the migration easier."]}),"\n",(0,o.jsx)(t.h3,{id:"language-specific-code-tabs",children:"Language-specific code tabs"}),"\n",(0,o.jsxs)(t.p,{children:["Refer to the ",(0,o.jsx)(t.a,{href:"/docs/markdown-features/code-blocks#multi-language-support-code-blocks",children:"multi-language support code blocks"})," section."]}),"\n",(0,o.jsx)(t.h3,{id:"front-matter",children:"Front matter"}),"\n",(0,o.jsx)(t.p,{children:"The Docusaurus front matter fields for the blog have been changed from camelCase to snake_case to be consistent with the docs."}),"\n",(0,o.jsxs)(t.p,{children:["The fields ",(0,o.jsx)(t.code,{children:"authorFBID"})," and ",(0,o.jsx)(t.code,{children:"authorTwitter"})," have been deprecated. They are only used for generating the profile image of the author which can be done via the ",(0,o.jsx)(t.code,{children:"authors"})," field."]}),"\n",(0,o.jsx)(t.h2,{id:"deployment",children:"Deployment"}),"\n",(0,o.jsxs)(t.p,{children:["The ",(0,o.jsx)(t.code,{children:"CNAME"})," file used by GitHub Pages is not generated anymore, so be sure you have created it in ",(0,o.jsx)(t.code,{children:"/static/CNAME"})," if you use a custom domain."]}),"\n",(0,o.jsxs)(t.p,{children:["The blog RSS feed is now hosted at ",(0,o.jsx)(t.code,{children:"/blog/rss.xml"})," instead of ",(0,o.jsx)(t.code,{children:"/blog/feed.xml"}),". You may want to configure server-side redirects so that users' subscriptions keep working."]}),"\n",(0,o.jsx)(t.h2,{id:"test-your-site",children:"Test your site"}),"\n",(0,o.jsx)(t.p,{children:"After migration, your folder structure should look like this:"}),"\n",(0,o.jsx)(t.pre,{children:(0,o.jsx)(t.code,{className:"language-bash",children:"my-project\n\u251C\u2500\u2500 docs\n\u2514\u2500\u2500 website\n \u251C\u2500\u2500 blog\n \u251C\u2500\u2500 src\n \u2502 \u251C\u2500\u2500 css\n \u2502 \u2502 \u2514\u2500\u2500 custom.css\n \u2502 \u2514\u2500\u2500 pages\n \u2502 \u2514\u2500\u2500 index.js\n \u251C\u2500\u2500 package.json\n \u251C\u2500\u2500 sidebars.json\n \u251C\u2500\u2500 .gitignore\n \u251C\u2500\u2500 docusaurus.config.js\n \u2514\u2500\u2500 static\n"})}),"\n",(0,o.jsx)(t.p,{children:"Start the development server and fix any errors:"}),"\n",(0,o.jsxs)(c.A,{groupId:"npm2yarn",children:[(0,o.jsx)(i.A,{value:"npm",children:(0,o.jsx)(t.pre,{children:(0,o.jsx)(t.code,{className:"language-bash",children:"cd website\nnpm start\n"})})}),(0,o.jsx)(i.A,{value:"yarn",label:"Yarn",children:(0,o.jsx)(t.pre,{children:(0,o.jsx)(t.code,{className:"language-bash",children:"cd website\nyarn start\n"})})}),(0,o.jsx)(i.A,{value:"pnpm",label:"pnpm",children:(0,o.jsx)(t.pre,{children:(0,o.jsx)(t.code,{className:"language-bash",children:"cd website\npnpm start\n"})})})]}),"\n",(0,o.jsx)(t.p,{children:"You can also try to build the site for production:"}),"\n",(0,o.jsxs)(c.A,{groupId:"npm2yarn",children:[(0,o.jsx)(i.A,{value:"npm",children:(0,o.jsx)(t.pre,{children:(0,o.jsx)(t.code,{className:"language-bash",children:"npm run build\n"})})}),(0,o.jsx)(i.A,{value:"yarn",label:"Yarn",children:(0,o.jsx)(t.pre,{children:(0,o.jsx)(t.code,{className:"language-bash",children:"yarn build\n"})})}),(0,o.jsx)(i.A,{value:"pnpm",label:"pnpm",children:(0,o.jsx)(t.pre,{children:(0,o.jsx)(t.code,{className:"language-bash",children:"pnpm run build\n"})})})]})]})}function b(e={}){let{wrapper:t}={...(0,s.R)(),...e.components};return t?(0,o.jsx)(t,{...e,children:(0,o.jsx)(h,{...e})}):h(e)}}}]); |