mirror of
https://github.com/facebook/docusaurus.git
synced 2025-05-01 19:27:48 +02:00
22 lines
No EOL
46 KiB
JavaScript
22 lines
No EOL
46 KiB
JavaScript
"use strict";(self.webpackChunkwebsite=self.webpackChunkwebsite||[]).push([[93026],{15995:(e,t,r)=>{r.d(t,{A:()=>o});var n=r(62540);r(63696);var s=r(11750);function o({children:e,hidden:t,className:r}){return(0,n.jsx)("div",{role:"tabpanel",className:(0,s.A)("tabItem_pnkT",r),hidden:t,children:e})}},27446:(e,t,r)=>{r.d(t,{A:()=>m});var n=r(62540),s=r(63696),o=r(11750),i=r(7846),l=r(49519),c=r(96439),a=r(19739),d=r(66904),u=r(79244);function p(e){var t,r;return null!==(r=null===(t=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 <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 j=r(10709);function b(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:s,tabValues:l}){let c=[],{blockElementScrollPositionUntilNextRender:a}=(0,i.a_)(),d=e=>{let t=e.currentTarget,n=l[c.indexOf(t)].value;n!==r&&(a(t),s(n))},u=e=>{var t,r;let n=null;switch(e.key){case"Enter":d(e);break;case"ArrowRight":{let r=c.indexOf(e.currentTarget)+1;n=null!==(t=c[r])&&void 0!==t?t:c[0];break}case"ArrowLeft":{let t=c.indexOf(e.currentTarget)-1;n=null!==(r=c[t])&&void 0!==r?r:c[c.length-1]}}null==n||n.focus()};return(0,n.jsx)("ul",{role:"tablist","aria-orientation":"horizontal",className:(0,o.A)("tabs",{"tabs--block":t},e),children:l.map(({value:e,label:t,attributes:s})=>(0,n.jsx)("li",f(b({role:"tab",tabIndex:r===e?0:-1,"aria-selected":r===e,ref:e=>c.push(e),onKeyDown:u,onClick:d},s),{className:(0,o.A)("tabs__item","tabItem_AQgk",null==s?void 0:s.className,{"tabs__item--active":r===e}),children:null!=t?t:e}),e))})}function x({lazy:e,children:t,selectedValue:r}){let i=(Array.isArray(t)?t:[t]).filter(Boolean);if(e){let e=i.find(e=>e.props.value===r);return e?(0,s.cloneElement)(e,{className:(0,o.A)("margin-top--md",e.props.className)}):null}return(0,n.jsx)("div",{className:"margin-top--md",children:i.map((e,t)=>(0,s.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,o=function(e){let{values:t,children:r}=e;return(0,s.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),[i,j]=(0,s.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:o})),[b,f]=function({queryString:e=!1,groupId:t}){let r=(0,l.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,s.useCallback)(e=>{var t,s;if(!n)return;let o=new URLSearchParams(r.location.search);o.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),s=s={search:o.toString()},Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(s)):(function(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);r.push.apply(r,n)}return r})(Object(s)).forEach(function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(s,e))}),t))},[n,r])]}({queryString:r,groupId:n}),[g,x]=function({groupId:e}){let t=e?`docusaurus.tab.${e}`:null,[r,n]=(0,u.Dv)(t);return[r,(0,s.useCallback)(e=>{t&&n.set(e)},[t,n])]}({groupId:n}),y=(()=>{let e=null!=b?b:g;return h({value:e,tabValues:o})?e:null})();return(0,c.A)(()=>{y&&j(y)},[y]),{selectedValue:i,selectValue:(0,s.useCallback)(e=>{if(!h({value:e,tabValues:o}))throw Error(`Can't select invalid tab value=${e}`);j(e),f(e),x(e)},[f,x,o]),tabValues:o}}(e);return(0,n.jsxs)("div",{className:(0,o.A)("tabs-container","tabList_Qoir"),children:[(0,n.jsx)(g,b({},t,e)),(0,n.jsx)(x,b({},t,e))]})}function m(e){let t=(0,j.A)();return(0,n.jsx)(y,f(b({},e),{children:p(e.children)}),String(t))}},40576:(e,t,r)=>{r.d(t,{A:()=>o});var n=r(62540);r(63696);var s=r(10709);function o({children:e,fallback:t}){return(0,s.A)()?(0,n.jsx)(n.Fragment,{children:null==e?void 0:e()}):null!=t?t:null}},59273:(e,t,r)=>{r.d(t,{A:()=>c});var n=r(62540),s=r(63696),o=r(52711),i=r(49519);let l=s.forwardRef(function({name:e,children:t},r){let l=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}(t),c=e?`${e}-${l}`:l,a=`#${c}`,d=(0,i.W6)();return(0,o.A)().collectAnchor(c),(0,n.jsx)("tr",{id:c,tabIndex:0,ref:d.location.hash===a?r:void 0,onClick:e=>{"A"!==e.target.tagName.toUpperCase()&&d.push(a)},onKeyDown:e=>{"Enter"===e.key&&d.push(a)},children:t.props.children})});function c({children:e,name:t}){if("table"!==e.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[r,o]=s.Children.toArray(e.props.children),i=(0,s.useRef)(null);(0,s.useEffect)(()=>{var e;null===(e=i.current)||void 0===e||e.focus()},[i]);let c=s.Children.map(o.props.children,e=>(0,n.jsx)(l,{name:t,ref:i,children:e}));return(0,n.jsxs)("table",{className:"apiTable_e8hp",children:[r,(0,n.jsx)("tbody",{children:c})]})}},59433:(e,t,r)=>{r.d(t,{A:()=>u});var n=r(62540);r(63696);var s=r(36372),o=r(69615),i=r(81912),l=r(27446),c=r(15995),a=r(55887);let d=void 0;function u({code:e,pluginName:t,presetOptionName:r}){let u=(0,o.ir)(d).path;return(0,n.jsxs)(l.A,{groupId:"api-config-ex",children:[(0,n.jsxs)(c.A,{value:"preset",label:(0,i.T)({message:"Preset options"}),children:[(0,n.jsx)("p",{children:(0,n.jsx)(i.A,{id:"apiDocs.configTabs.presetOptions.description",values:{presetLink:(0,n.jsx)(s.A,{to:`${u}/using-plugins#docusauruspreset-classic`,children:(0,n.jsx)(i.A,{children:"preset options"})})},children:"If you use a preset, configure this plugin through the {presetLink}:"})}),(0,n.jsx)(a.A,{language:"js",title:"docusaurus.config.js",children:`module.exports = {
|
|
presets: [
|
|
[
|
|
'@docusaurus/preset-classic',
|
|
{
|
|
// highlight-start
|
|
${r}: ${e.replace(/\n/g,"\n ")},
|
|
// highlight-end
|
|
},
|
|
],
|
|
],
|
|
};`})]}),(0,n.jsxs)(c.A,{value:"plugin",label:(0,i.T)({message:"Plugin options"}),children:[(0,n.jsx)("p",{children:(0,n.jsx)(i.A,{children:"If you are using a standalone plugin, provide options directly to the plugin:"})}),(0,n.jsx)(a.A,{language:"js",title:"docusaurus.config.js",children:`module.exports = {
|
|
plugins: [
|
|
[
|
|
'${t}',
|
|
// highlight-start
|
|
${e.replace(/\n/g,"\n ")},
|
|
// highlight-end
|
|
],
|
|
],
|
|
};`})]})]})}},55887:(e,t,r)=>{r.d(t,{A:()=>el});var n,s,o,i={};r.r(i),r.d(i,{ButtonExample:()=>N});var l=r(62540),c=r(63696),a=r(11750),d=r(10709),u=r(55152),p=r(81912),h=r(99468),j=r(40576),b=r(1495),f=r(66659),g=r(25436);function x(){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 m(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,l.jsx)("div",{className:(0,a.A)("playgroundHeader_Tvsk"),children:e})}function v(){return(0,l.jsx)("div",{children:"Loading..."})}function w(){return(0,l.jsx)(j.A,{fallback:(0,l.jsx)(v,{}),children:()=>(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)(y.A,{fallback:e=>(0,l.jsx)(b.MN,m({},e)),children:(0,l.jsx)(u.pA,{})}),(0,l.jsx)(u.p1,{})]})})}function P(){return(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)(O,{children:(0,l.jsx)(p.A,{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)(w,{})})]})}function k(){let e=(0,d.A)();return(0,l.jsx)(u.w,{className:"playgroundEditor_TySg"},String(e))}function E(){return(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)(O,{children:(0,l.jsx)(p.A,{id:"theme.Playground.liveEditor",description:"The live editor label of the live codeblocks",children:"Live Editor"})}),(0,l.jsx)(k,{})]})}let S=e=>`${e};`;function D(e){var t,r,n,s,{children:o,transformCode:i}=e,c=function(e,t){if(null==e)return{};var r,n,s=function(e,t){if(null==e)return{};var r,n,s={},o=Object.keys(e);for(n=0;n<o.length;n++)r=o[n],t.indexOf(r)>=0||(s[r]=e[r]);return s}(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(n=0;n<o.length;n++)r=o[n],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(s[r]=e[r])}return s}(e,["children","transformCode"]);let{siteConfig:{themeConfig:a}}=(0,h.A)(),{liveCodeBlock:{playgroundPosition:d}}=a,p=x(),j=null!==(s=null===(n=c.metastring)||void 0===n?void 0:n.includes("noInline"))&&void 0!==s&&s;return(0,l.jsx)("div",{className:"playgroundContainer_6Ior",children:(0,l.jsx)(u.Q,(t=m({code:null==o?void 0:o.replace(/\n$/,""),noInline:j,transformCode:null!=i?i:S,theme:p},c),r=r={children:"top"===d?(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)(P,{}),(0,l.jsx)(E,{})]}):(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)(E,{}),(0,l.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 A(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 N(e){var t,r;return(0,l.jsx)("button",(t=A({type:"button"},e),r=r={style:A({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 B=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:c},c,i);var C=r(12653),T=r(19934),_=r.n(T);let L=RegExp("title=(?<quote>[\"'])(?<title>.*?)\\1"),I=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),s=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:""}},Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(s)):(function(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);r.push.apply(r,n)}return r})(Object(s)).forEach(function(e){Object.defineProperty(n,e,Object.getOwnPropertyDescriptor(s,e))}),n),$=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 F(e){var t,r,{as:n}=e,s=function(e,t){if(null==e)return{};var r,n,s=function(e,t){if(null==e)return{};var r,n,s={},o=Object.keys(e);for(n=0;n<o.length;n++)r=o[n],t.indexOf(r)>=0||(s[r]=e[r]);return s}(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(n=0;n<o.length;n++)r=o[n],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(s[r]=e[r])}return s}(e,["as"]);let o=function(e){let t={color:"--prism-color",backgroundColor:"--prism-background-color"},r={};return Object.entries(e.plain).forEach(([e,n])=>{let s=t[e];s&&"string"==typeof n&&(r[s]=n)}),r}(x());return(0,l.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}({},s),r=r={style:o,className:(0,a.A)(s.className,"codeBlockContainer_jDV4",C.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 W={codeBlockContent:"codeBlockContent_vx7S",codeBlockTitle:"codeBlockTitle_bdru",codeBlock:"codeBlock_Gebt",codeBlockStandalone:"codeBlockStandalone_i_cY",codeBlockLines:"codeBlockLines_FJaf",codeBlockLinesWithNumbering:"codeBlockLinesWithNumbering_FU9Q",buttonGroup:"buttonGroup_cUGO"};function q({children:e,className:t}){return(0,l.jsx)(F,{as:"pre",tabIndex:0,className:(0,a.A)(W.codeBlockStandalone,"thin-scrollbar",t),children:(0,l.jsx)("code",{className:W.codeBlockLines,children:e})})}var V=r(2550);let H={attributes:!0,characterData:!0,childList:!0,subtree:!0};var X=r(27663);let z={codeLine:"codeLine_qRmp",codeLineNumber:"codeLineNumber_dS_J",codeLineContent:"codeLineContent_XF5l"};function G(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 J({line:e,classNames:t,showLineNumbers:r,getLineProps:n,getTokenProps:s}){var o,i;1===e.length&&"\n"===e[0].content&&(e[0].content="");let c=n({line:e,className:(0,a.A)(t,r&&z.codeLine)}),d=e.map((e,t)=>(0,l.jsx)("span",G({},s({token:e})),t));return(0,l.jsxs)("span",(o=G({},c),i=i={children:[r?(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)("span",{className:z.codeLineNumber}),(0,l.jsx)("span",{className:z.codeLineContent,children:d})]}):d,(0,l.jsx)("br",{})]},Object.getOwnPropertyDescriptors?Object.defineProperties(o,Object.getOwnPropertyDescriptors(i)):(function(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);r.push.apply(r,n)}return r})(Object(i)).forEach(function(e){Object.defineProperty(o,e,Object.getOwnPropertyDescriptor(i,e))}),o))}var Q=r(936);function Y(e){var t,r;return(0,l.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,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"})},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,l.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,l.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,c.useState)(!1),s=(0,c.useRef)(void 0),o=(0,c.useCallback)(()=>{(0,Q.A)(e),n(!0),s.current=window.setTimeout(()=>{n(!1)},1e3)},[e]);return(0,c.useEffect)(()=>()=>window.clearTimeout(s.current),[]),(0,l.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:o,children:(0,l.jsxs)("span",{className:Z.copyButtonIcons,"aria-hidden":"true",children:[(0,l.jsx)(Y,{className:Z.copyButtonIcon}),(0,l.jsx)(K,{className:Z.copyButtonSuccessIcon})]})})}function et(e){var t,r;return(0,l.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,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"})},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,l.jsx)("button",{type:"button",onClick:t,className:(0,a.A)("clean-btn",e,r&&er.wordWrapButtonEnabled),"aria-label":n,title:n,children:(0,l.jsx)(et,{className:er.wordWrapButtonIcon,"aria-hidden":"true"})})}function es({children:e,className:t="",metastring:r,title:n,showLineNumbers:s,language:o}){var i,d,u,p;let{prism:{defaultLanguage:h,magicComments:j}}=(0,g.p)(),b=null==(d=null!==(i=null!=o?o:function(e){let t=e.split(" ").find(e=>e.startsWith("language-"));return null==t?void 0:t.replace(/language-/,"")}(t))&&void 0!==i?i:h)?void 0:d.toLowerCase(),f=x(),y=function(){let[e,t]=(0,c.useState)(!1),[r,n]=(0,c.useState)(!1),s=(0,c.useRef)(null),o=(0,c.useCallback)(()=>{let r=s.current.querySelector("code");e?r.removeAttribute("style"):(r.style.whiteSpace="pre-wrap",r.style.overflowWrap="anywhere"),t(e=>!e)},[s,e]),i=(0,c.useCallback)(()=>{let{scrollWidth:e,clientWidth:t}=s.current;n(e>t||s.current.querySelector("code").hasAttribute("style"))},[s]);return!function(e,t){let[r,n]=(0,c.useState)(),s=(0,c.useCallback)(()=>{var t;n(null===(t=e.current)||void 0===t?void 0:t.closest("[role=tabpanel][hidden]"))},[e,n]);(0,c.useEffect)(()=>{s()},[s]),function(e,t,r=H){let n=(0,V._q)(t),s=(0,V.Be)(r);(0,c.useEffect)(()=>{let t=new MutationObserver(n);return e&&t.observe(e,s),()=>t.disconnect()},[e,n,s])}(r,e=>{e.forEach(e=>{"attributes"===e.type&&"hidden"===e.attributeName&&(t(),s())})},{attributes:!0,characterData:!1,childList:!1,subtree:!1})}(s,i),(0,c.useEffect)(()=>{i()},[e,i]),(0,c.useEffect)(()=>(window.addEventListener("resize",i,{passive:!0}),()=>{window.removeEventListener("resize",i)}),[i]),{codeBlockRef:s,isEnabled:e,isCodeScrollable:r,toggle:o}}(),m=(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:s,metastring:o}=t;if(o&&I.test(o)){let e=o.match(I).groups.range;if(0===s.length)throw Error(`A highlight range has been given in code block's metastring (\`\`\` ${o}), but no magic comment config is available. Docusaurus applies the first magic comment entry's className for metastring ranges.`);let t=s[0].className;return{lineClassNames:Object.fromEntries(_()(e).filter(e=>e>0).map(e=>[e-1,[t]])),code:r}}if(void 0===n)return{lineClassNames:{},code:r};let i=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($,t)}}(n,s),l=r.split("\n"),c=Object.fromEntries(s.map(e=>[e.className,{start:0,range:""}])),a=Object.fromEntries(s.filter(e=>e.line).map(({className:e,line:t})=>[t,e])),d=Object.fromEntries(s.filter(e=>e.block).map(({className:e,block:t})=>[t.start,e])),u=Object.fromEntries(s.filter(e=>e.block).map(({className:e,block:t})=>[t.end,e]));for(let e=0;e<l.length;){let t=l[e].match(i);if(!t){e+=1;continue}let r=t.slice(1).find(e=>void 0!==e);a[r]?c[a[r]].range+=`${e},`:d[r]?c[d[r]].start=e:u[r]&&(c[u[r]].range+=`${c[u[r]].start}-${e-1},`),l.splice(e,1)}r=l.join("\n");let p={};return Object.entries(c).forEach(([e,{range:t}])=>{_()(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:b,magicComments:j}),w=null!=s?s:!!(null==r?void 0:r.includes("showLineNumbers"));return(0,l.jsxs)(F,{as:"div",className:(0,a.A)(t,b&&!t.includes(`language-${b}`)&&`language-${b}`),children:[m&&(0,l.jsx)("div",{className:W.codeBlockTitle,children:m}),(0,l.jsxs)("div",{className:W.codeBlockContent,children:[(0,l.jsx)(X.f4,{theme:f,code:v,language:null!=b?b:"text",children:({className:e,style:t,tokens:r,getLineProps:n,getTokenProps:s})=>(0,l.jsx)("pre",{tabIndex:0,ref:y.codeBlockRef,className:(0,a.A)(e,W.codeBlock,"thin-scrollbar"),style:t,children:(0,l.jsx)("code",{className:(0,a.A)(W.codeBlockLines,w&&W.codeBlockLinesWithNumbering),children:r.map((e,t)=>(0,l.jsx)(J,{line:e,getLineProps:n,getTokenProps:s,classNames:O[t],showLineNumbers:w},t))})})}),(0,l.jsxs)("div",{className:W.buttonGroup,children:[(y.isEnabled||y.isCodeScrollable)&&(0,l.jsx)(en,{className:W.codeButton,onClick:()=>y.toggle(),isEnabled:y.isEnabled}),(0,l.jsx)(ee,{className:W.codeButton,code:v})]})]})]})}function eo(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 ei=(o=function(e){var t,r,{children:n}=e,s=function(e,t){if(null==e)return{};var r,n,s=function(e,t){if(null==e)return{};var r,n,s={},o=Object.keys(e);for(n=0;n<o.length;n++)r=o[n],t.indexOf(r)>=0||(s[r]=e[r]);return s}(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(n=0;n<o.length;n++)r=o[n],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(s[r]=e[r])}return s}(e,["children"]);let o=(0,d.A)(),i=c.Children.toArray(n).some(e=>(0,c.isValidElement)(e))?n:Array.isArray(n)?n.join(""):n,a="string"==typeof i?es:q;return(0,l.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}({},s),r=r={children:i},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(o))},function(e){return e.live?(0,l.jsx)(D,eo({scope:B},e)):(0,l.jsx)(o,eo({},e))});function el(e){return(0,l.jsx)(ei,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))}},81239:(e,t,r)=>{r.r(t),r.d(t,{assets:()=>p,contentTitle:()=>u,default:()=>b,frontMatter:()=>d,metadata:()=>n,toc:()=>h});let n=JSON.parse('{"id":"api/plugins/plugin-content-pages","title":"\u{1F4E6} plugin-content-pages","description":"The default pages plugin for Docusaurus. The classic template ships with this plugin with default configurations. This plugin provides creating pages functionality.","source":"@site/docs/api/plugins/plugin-content-pages.mdx","sourceDirName":"api/plugins","slug":"/api/plugins/@docusaurus/plugin-content-pages","permalink":"/docs/api/plugins/@docusaurus/plugin-content-pages","draft":false,"unlisted":false,"editUrl":"https://github.com/facebook/docusaurus/edit/main/website/docs/api/plugins/plugin-content-pages.mdx","tags":[],"version":"current","lastUpdatedBy":"dependabot[bot]","lastUpdatedAt":1726738176000,"sidebarPosition":3,"frontMatter":{"sidebar_position":3,"slug":"/api/plugins/@docusaurus/plugin-content-pages"},"sidebar":"api","previous":{"title":"\u{1F4E6} plugin-content-blog","permalink":"/docs/api/plugins/@docusaurus/plugin-content-blog"},"next":{"title":"\u{1F4E6} plugin-client-redirects","permalink":"/docs/api/plugins/@docusaurus/plugin-client-redirects"}}');var s=r(62540),o=r(43023),i=r(27446),l=r(15995),c=r(59273),a=r(59433);let d={sidebar_position:3,slug:"/api/plugins/@docusaurus/plugin-content-pages"},u="\u{1F4E6} plugin-content-pages",p={},h=[{value:"Installation",id:"installation",level:2},{value:"Configuration",id:"configuration",level:2},{value:"Types",id:"types",level:3},{value:"<code>EditUrlFn</code>",id:"EditUrlFn",level:4},{value:"Example configuration",id:"ex-config",level:3},{value:"Markdown front matter",id:"markdown-front-matter",level:2},{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 j(e){let t={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,o.R)(),...e.components};return(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(t.header,{children:(0,s.jsx)(t.h1,{id:"-plugin-content-pages",children:"\u{1F4E6} plugin-content-pages"})}),"\n","\n",(0,s.jsxs)(t.p,{children:["The default pages plugin for Docusaurus. The classic template ships with this plugin with default configurations. This plugin provides ",(0,s.jsx)(t.a,{href:"/docs/creating-pages",children:"creating pages"})," functionality."]}),"\n",(0,s.jsx)(t.h2,{id:"installation",children:"Installation"}),"\n",(0,s.jsxs)(i.A,{groupId:"npm2yarn",children:[(0,s.jsx)(l.A,{value:"npm",children:(0,s.jsx)(t.pre,{children:(0,s.jsx)(t.code,{className:"language-bash",children:"npm install --save @docusaurus/plugin-content-pages\n"})})}),(0,s.jsx)(l.A,{value:"yarn",label:"Yarn",children:(0,s.jsx)(t.pre,{children:(0,s.jsx)(t.code,{className:"language-bash",children:"yarn add @docusaurus/plugin-content-pages\n"})})}),(0,s.jsx)(l.A,{value:"pnpm",label:"pnpm",children:(0,s.jsx)(t.pre,{children:(0,s.jsx)(t.code,{className:"language-bash",children:"pnpm add @docusaurus/plugin-content-pages\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)(c.A,{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:"path"})}),(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:"'src/pages'"})}),(0,s.jsx)(t.td,{children:"Path to data on filesystem relative to site dir. Components in this directory will be automatically converted to pages."})]}),(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.td,{children:(0,s.jsx)(t.code,{children:"editUrl"})}),(0,s.jsx)(t.td,{children:(0,s.jsxs)("code",{children:["string | ",(0,s.jsx)(t.a,{href:"#EditUrlFn",children:"EditUrlFn"})]})}),(0,s.jsx)(t.td,{children:(0,s.jsx)(t.code,{children:"undefined"})}),(0,s.jsxs)(t.td,{children:[(0,s.jsx)(t.strong,{children:"Only for Markdown pages"}),". Base URL to edit your site. The final URL is computed by ",(0,s.jsx)(t.code,{children:"editUrl + relativePostPath"}),". Using a function allows more nuanced control for each file. Omitting this variable entirely will disable edit links."]})]}),(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.td,{children:(0,s.jsx)(t.code,{children:"editLocalizedFiles"})}),(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.jsxs)(t.td,{children:[(0,s.jsx)(t.strong,{children:"Only for Markdown pages"}),". The edit URL will target the localized file, instead of the original unlocalized file. Ignored when ",(0,s.jsx)(t.code,{children:"editUrl"})," is a function."]})]}),(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.td,{children:(0,s.jsx)(t.code,{children:"routeBasePath"})}),(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.jsxs)(t.td,{children:["URL route for the pages section of your site. ",(0,s.jsx)(t.strong,{children:"DO NOT"})," include a trailing slash."]})]}),(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.td,{children:(0,s.jsx)(t.code,{children:"include"})}),(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:"['**/*.{js,jsx,ts,tsx,md,mdx}']"})}),(0,s.jsx)(t.td,{children:"Matching files will be included and processed."})]}),(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.td,{children:(0,s.jsx)(t.code,{children:"exclude"})}),(0,s.jsx)(t.td,{children:(0,s.jsx)(t.code,{children:"string[]"})}),(0,s.jsx)(t.td,{children:(0,s.jsx)(t.em,{children:"See example configuration"})}),(0,s.jsx)(t.td,{children:"No route will be created for matching files."})]}),(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.td,{children:(0,s.jsx)(t.code,{children:"mdxPageComponent"})}),(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:"'@theme/MDXPage'"})}),(0,s.jsx)(t.td,{children:"Component used by each MDX page."})]}),(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.td,{children:(0,s.jsx)(t.code,{children:"remarkPlugins"})}),(0,s.jsx)(t.td,{children:(0,s.jsx)(t.code,{children:"[]"})}),(0,s.jsx)(t.td,{children:(0,s.jsx)(t.code,{children:"any[]"})}),(0,s.jsx)(t.td,{children:"Remark plugins passed to MDX."})]}),(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.td,{children:(0,s.jsx)(t.code,{children:"rehypePlugins"})}),(0,s.jsx)(t.td,{children:(0,s.jsx)(t.code,{children:"[]"})}),(0,s.jsx)(t.td,{children:(0,s.jsx)(t.code,{children:"any[]"})}),(0,s.jsx)(t.td,{children:"Rehype plugins passed to MDX."})]}),(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.td,{children:(0,s.jsx)(t.code,{children:"rehypePlugins"})}),(0,s.jsx)(t.td,{children:(0,s.jsx)(t.code,{children:"any[]"})}),(0,s.jsx)(t.td,{children:(0,s.jsx)(t.code,{children:"[]"})}),(0,s.jsx)(t.td,{children:"Recma plugins passed to MDX."})]}),(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.td,{children:(0,s.jsx)(t.code,{children:"beforeDefaultRemarkPlugins"})}),(0,s.jsx)(t.td,{children:(0,s.jsx)(t.code,{children:"any[]"})}),(0,s.jsx)(t.td,{children:(0,s.jsx)(t.code,{children:"[]"})}),(0,s.jsx)(t.td,{children:"Custom Remark plugins passed to MDX before the default Docusaurus Remark plugins."})]}),(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.td,{children:(0,s.jsx)(t.code,{children:"beforeDefaultRehypePlugins"})}),(0,s.jsx)(t.td,{children:(0,s.jsx)(t.code,{children:"any[]"})}),(0,s.jsx)(t.td,{children:(0,s.jsx)(t.code,{children:"[]"})}),(0,s.jsx)(t.td,{children:"Custom Rehype plugins passed to MDX before the default Docusaurus Rehype plugins."})]}),(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.td,{children:(0,s.jsx)(t.code,{children:"showLastUpdateAuthor"})}),(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.jsxs)(t.td,{children:[(0,s.jsx)(t.strong,{children:"Only for Markdown pages"}),". Whether to display the author who last updated the page."]})]}),(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.td,{children:(0,s.jsx)(t.code,{children:"showLastUpdateTime"})}),(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.jsxs)(t.td,{children:[(0,s.jsx)(t.strong,{children:"Only for Markdown pages"}),". Whether to display the last date the page post 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,s.jsx)(t.code,{children:"actions/checkout"}),", use",(0,s.jsx)(t.code,{children:"fetch-depth: 0"}),"."]})]})]})]})}),"\n",(0,s.jsx)(t.h3,{id:"types",children:"Types"}),"\n",(0,s.jsx)(t.h4,{id:"EditUrlFn",children:(0,s.jsx)(t.code,{children:"EditUrlFn"})}),"\n",(0,s.jsx)(t.pre,{children:(0,s.jsx)(t.code,{className:"language-ts",children:"type EditUrlFunction = (params: {\n blogDirPath: string;\n blogPath: string;\n permalink: string;\n locale: string;\n}) => string | undefined;\n"})}),"\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)(a.A,{pluginName:"@docusaurus/plugin-content-pages",presetOptionName:"pages",code:"{\n path: 'src/pages',\n routeBasePath: '',\n include: ['**/*.{js,jsx,ts,tsx,md,mdx}'],\n exclude: [\n '**/_*.{js,jsx,ts,tsx,md,mdx}',\n '**/_*/**',\n '**/*.test.{js,jsx,ts,tsx}',\n '**/__tests__/**',\n ],\n mdxPageComponent: '@theme/MDXPage',\n remarkPlugins: [require('./my-remark-plugin')],\n rehypePlugins: [],\n beforeDefaultRemarkPlugins: [],\n beforeDefaultRehypePlugins: [],\n}"}),"\n",(0,s.jsx)(t.h2,{id:"markdown-front-matter",children:"Markdown front matter"}),"\n",(0,s.jsxs)(t.p,{children:["Markdown pages can use the following Markdown ",(0,s.jsx)(t.a,{href:"/docs/markdown-features#front-matter",children:"front matter"})," metadata fields, enclosed by a line ",(0,s.jsx)(t.code,{children:"---"})," on either side."]}),"\n",(0,s.jsx)(t.p,{children:"Accepted fields:"}),"\n",(0,s.jsx)(c.A,{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:"title"})}),(0,s.jsx)(t.td,{children:(0,s.jsx)(t.code,{children:"string"})}),(0,s.jsx)(t.td,{children:"Markdown title"}),(0,s.jsx)(t.td,{children:"The blog post title."})]}),(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.td,{children:(0,s.jsx)(t.code,{children:"description"})}),(0,s.jsx)(t.td,{children:(0,s.jsx)(t.code,{children:"string"})}),(0,s.jsx)(t.td,{children:"The first line of Markdown content"}),(0,s.jsxs)(t.td,{children:["The description of your page, which will become the ",(0,s.jsx)(t.code,{children:'<meta name="description" content="..."/>'})," and ",(0,s.jsx)(t.code,{children:'<meta property="og:description" content="..."/>'})," in ",(0,s.jsx)(t.code,{children:"<head>"}),", used by search engines."]})]}),(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.td,{children:(0,s.jsx)(t.code,{children:"keywords"})}),(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:"undefined"})}),(0,s.jsxs)(t.td,{children:["Keywords meta tag, which will become the ",(0,s.jsx)(t.code,{children:'<meta name="keywords" content="keyword1,keyword2,..."/>'})," in ",(0,s.jsx)(t.code,{children:"<head>"}),", used by search engines."]})]}),(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.td,{children:(0,s.jsx)(t.code,{children:"image"})}),(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:"undefined"})}),(0,s.jsxs)(t.td,{children:["Cover or thumbnail image that will be used as the ",(0,s.jsx)(t.code,{children:'<meta property="og:image" content="..."/>'})," in the ",(0,s.jsx)(t.code,{children:"<head>"}),", enhancing link previews on social media and messaging platforms."]})]}),(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.td,{children:(0,s.jsx)(t.code,{children:"wrapperClassName"})}),(0,s.jsx)(t.td,{children:(0,s.jsx)(t.code,{children:"string"})}),(0,s.jsx)(t.td,{}),(0,s.jsx)(t.td,{children:"Class name to be added to the wrapper element to allow targeting specific page content."})]}),(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.td,{children:(0,s.jsx)(t.code,{children:"hide_table_of_contents"})}),(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 to hide the table of contents to the right."})]}),(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.td,{children:(0,s.jsx)(t.code,{children:"draft"})}),(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:"Draft pages will only be available during development."})]}),(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.td,{children:(0,s.jsx)(t.code,{children:"unlisted"})}),(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:'Unlisted pages 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.'})]})]})]})}),"\n",(0,s.jsx)(t.p,{children:"Example:"}),"\n",(0,s.jsx)(t.pre,{children:(0,s.jsx)(t.code,{className:"language-md",children:"---\ntitle: Markdown Page\ndescription: Markdown page SEO description\nwrapperClassName: markdown-page\nhide_table_of_contents: false\ndraft: true\n---\n\nMarkdown page content\n"})}),"\n",(0,s.jsx)(t.h2,{id:"i18n",children:"i18n"}),"\n",(0,s.jsxs)(t.p,{children:["Read the ",(0,s.jsx)(t.a,{href:"/docs/i18n/introduction",children:"i18n introduction"})," first."]}),"\n",(0,s.jsx)(t.h3,{id:"translation-files-location",children:"Translation files location"}),"\n",(0,s.jsxs)(t.ul,{children:["\n",(0,s.jsxs)(t.li,{children:[(0,s.jsx)(t.strong,{children:"Base path"}),": ",(0,s.jsx)(t.code,{children:"website/i18n/[locale]/docusaurus-plugin-content-pages"})]}),"\n",(0,s.jsxs)(t.li,{children:[(0,s.jsx)(t.strong,{children:"Multi-instance path"}),": ",(0,s.jsx)(t.code,{children:"website/i18n/[locale]/docusaurus-plugin-content-pages-[pluginId]"})]}),"\n",(0,s.jsxs)(t.li,{children:[(0,s.jsx)(t.strong,{children:"JSON files"}),": extracted with ",(0,s.jsx)(t.a,{href:"/docs/cli#docusaurus-write-translations-sitedir",children:(0,s.jsx)(t.code,{children:"docusaurus write-translations"})})]}),"\n",(0,s.jsxs)(t.li,{children:[(0,s.jsx)(t.strong,{children:"Markdown files"}),": ",(0,s.jsx)(t.code,{children:"website/i18n/[locale]/docusaurus-plugin-content-pages"})]}),"\n"]}),"\n",(0,s.jsx)(t.h3,{id:"example-file-system-structure",children:"Example file-system structure"}),"\n",(0,s.jsx)(t.pre,{children:(0,s.jsx)(t.code,{className:"language-bash",children:"website/i18n/[locale]/docusaurus-plugin-content-pages\n\u2502\n\u2502 # translations for website/src/pages\n\u251C\u2500\u2500 first-markdown-page.md\n\u2514\u2500\u2500 second-markdown-page.md\n"})})]})}function b(e={}){let{wrapper:t}={...(0,o.R)(),...e.components};return t?(0,s.jsx)(t,{...e,children:(0,s.jsx)(j,{...e})}):j(e)}}}]); |