mirror of
https://github.com/facebook/docusaurus.git
synced 2025-12-26 01:33:02 +00:00
22 lines
34 KiB
JavaScript
22 lines
34 KiB
JavaScript
"use strict";(self.webpackChunkwebsite=self.webpackChunkwebsite||[]).push([["56401"],{15028:function(e,t,n){n.d(t,{A:()=>r});let r={copyButtonCopied:"copyButtonCopied_wDuR",copyButtonIcons:"copyButtonIcons_gMWc",copyButtonIcon:"copyButtonIcon_GXfb",copyButtonSuccessIcon:"copyButtonSuccessIcon_ktUX"}},143:function(e,t,n){n.d(t,{A:()=>r});let r={wordWrapButtonIcon:"wordWrapButtonIcon___5r",wordWrapButtonEnabled:"wordWrapButtonEnabled_nam_"}},75864:function(e,t,n){n.d(t,{A:()=>r});let r={buttonGroup:"buttonGroup_KXnS"}},37322:function(e,t,n){n.d(t,{A:()=>r});let r={codeBlockContainer:"codeBlockContainer_jDV4"}},81772:function(e,t,n){n.d(t,{A:()=>r});let r={codeBlock:"codeBlock_Gebt",codeBlockStandalone:"codeBlockStandalone_i_cY",codeBlockLines:"codeBlockLines_FJaf",codeBlockLinesWithNumbering:"codeBlockLinesWithNumbering_FU9Q"}},73215:function(e,t,n){n.d(t,{A:()=>r});let r={codeBlockContent:"codeBlockContent_cKMj",codeBlockTitle:"codeBlockTitle_U6Q0",codeBlock:"codeBlock_QST6"}},631:function(e,t,n){n.d(t,{A:()=>r});let r={codeLine:"codeLine_qRmp",codeLineNumber:"codeLineNumber_dS_J",codeLineContent:"codeLineContent_XF5l"}},41452:function(e,t,n){n.d(t,{A:()=>r});let r={tabItem:"tabItem_pnkT"}},18416:function(e,t,n){n.d(t,{A:()=>r});let r={tabList:"tabList_Qoir",tabItem:"tabItem_AQgk"}},85120:function(e,t,n){n.d(t,{A:()=>r});let r={playgroundContainer:"playgroundContainer_TDLX"}},19304:function(e,t,n){n.d(t,{A:()=>r});let r={playgroundEditor:"playgroundEditor_uqZ4"}},79820:function(e,t,n){n.d(t,{A:()=>r});let r={playgroundHeader:"playgroundHeader_h_Hu"}},60477:function(e,t,n){n.d(t,{A:()=>r});let r={playgroundPreview:"playgroundPreview_u2xE"}},11344:function(e,t,n){n.d(t,{A:()=>r});let r={apiTable:"apiTable_e8hp"}},52953:function(e,t,n){n.r(t),n.d(t,{assets:()=>h,contentTitle:()=>u,default:()=>f,frontMatter:()=>d,metadata:()=>r,toc:()=>p});var r=n(2477),s=n(74848),i=n(56151),a=n(14729),l=n(13899),o=n(6125),c=n(63402);let d={sidebar_position:10,slug:"/api/plugins/@docusaurus/plugin-sitemap"},u="\u{1F4E6} plugin-sitemap",h={},p=[{value:"Installation",id:"installation",level:2},{value:"Configuration",id:"configuration",level:2},{value:"Types",id:"types",level:3},{value:"<code>CreateSitemapItemsFn</code>",id:"CreateSitemapItemsFn",level:4},{value:"Example configuration",id:"ex-config",level:3}];function m(e){let t={a:"a",admonition:"admonition",code:"code",h1:"h1",h2:"h2",h3:"h3",h4:"h4",header:"header",li:"li",mdxAdmonitionTitle:"mdxAdmonitionTitle",p:"p",pre:"pre",strong:"strong",table:"table",tbody:"tbody",td:"td",th:"th",thead:"thead",tr:"tr",ul:"ul",...(0,i.R)(),...e.components};return(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(t.header,{children:(0,s.jsx)(t.h1,{id:"-plugin-sitemap",children:"\u{1F4E6} plugin-sitemap"})}),"\n","\n",(0,s.jsx)(t.p,{children:"This plugin creates sitemaps for your site so that search engine crawlers can crawl your site more accurately."}),"\n",(0,s.jsx)(t.admonition,{title:"production only",type:"warning",children:(0,s.jsxs)(t.p,{children:["This plugin is always inactive in development and ",(0,s.jsx)(t.strong,{children:"only active in production"})," because it works on the build output."]})}),"\n",(0,s.jsx)(t.h2,{id:"installation",children:"Installation"}),"\n",(0,s.jsxs)(a.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-sitemap\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-sitemap\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-sitemap\n"})})}),(0,s.jsx)(l.A,{value:"bun",label:"Bun",children:(0,s.jsx)(t.pre,{children:(0,s.jsx)(t.code,{className:"language-bash",children:"bun add @docusaurus/plugin-sitemap\n"})})})]}),"\n",(0,s.jsxs)(t.admonition,{type:"tip",children:[(0,s.jsxs)(t.p,{children:["If you use the preset ",(0,s.jsx)(t.code,{children:"@docusaurus/preset-classic"}),", you don't need to install this plugin as a dependency."]}),(0,s.jsxs)(t.p,{children:["You can configure this plugin through the ",(0,s.jsx)(t.a,{href:"/docs/using-plugins#docusauruspreset-classic",children:"preset options"}),"."]})]}),"\n",(0,s.jsx)(t.h2,{id:"configuration",children:"Configuration"}),"\n",(0,s.jsx)(t.p,{children:"Accepted fields:"}),"\n",(0,s.jsx)(o.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:"lastmod"})}),(0,s.jsx)(t.td,{children:(0,s.jsx)(t.code,{children:"'date' | 'datetime' | null"})}),(0,s.jsx)(t.td,{children:(0,s.jsx)(t.code,{children:"null"})}),(0,s.jsxs)(t.td,{children:[(0,s.jsx)(t.code,{children:"date"})," is YYYY-MM-DD. ",(0,s.jsx)(t.code,{children:"datetime"})," is a ISO 8601 datetime. ",(0,s.jsx)(t.code,{children:"null"})," is disabled. See ",(0,s.jsx)(t.a,{href:"https://www.sitemaps.org/protocol.html#xmlTagDefinitions",children:"sitemap docs"}),"."]})]}),(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.td,{children:(0,s.jsx)(t.code,{children:"changefreq"})}),(0,s.jsx)(t.td,{children:(0,s.jsx)(t.code,{children:"string | null"})}),(0,s.jsx)(t.td,{children:(0,s.jsx)(t.code,{children:"'weekly'"})}),(0,s.jsxs)(t.td,{children:["See ",(0,s.jsx)(t.a,{href:"https://www.sitemaps.org/protocol.html#xmlTagDefinitions",children:"sitemap docs"})]})]}),(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.td,{children:(0,s.jsx)(t.code,{children:"priority"})}),(0,s.jsx)(t.td,{children:(0,s.jsx)(t.code,{children:"number | null"})}),(0,s.jsx)(t.td,{children:(0,s.jsx)(t.code,{children:"0.5"})}),(0,s.jsxs)(t.td,{children:["See ",(0,s.jsx)(t.a,{href:"https://www.sitemaps.org/protocol.html#xmlTagDefinitions",children:"sitemap docs"})]})]}),(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.td,{children:(0,s.jsx)(t.code,{children:"ignorePatterns"})}),(0,s.jsx)(t.td,{children:(0,s.jsx)(t.code,{children:"string[]"})}),(0,s.jsx)(t.td,{children:(0,s.jsx)(t.code,{children:"[]"})}),(0,s.jsx)(t.td,{children:"A list of glob patterns; matching route paths will be filtered from the sitemap. Note that you may need to include the base URL in here."})]}),(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.td,{children:(0,s.jsx)(t.code,{children:"filename"})}),(0,s.jsx)(t.td,{children:(0,s.jsx)(t.code,{children:"string"})}),(0,s.jsx)(t.td,{children:(0,s.jsx)(t.code,{children:"sitemap.xml"})}),(0,s.jsx)(t.td,{children:"The path to the created sitemap file, relative to the output directory. Useful if you have two plugin instances outputting two files."})]}),(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.td,{children:(0,s.jsx)(t.code,{children:"createSitemapItems"})}),(0,s.jsx)(t.td,{children:(0,s.jsxs)("code",{children:[(0,s.jsx)(t.a,{href:"#CreateSitemapItemsFn",children:"CreateSitemapItemsFn"})," | undefined"]})}),(0,s.jsx)(t.td,{children:(0,s.jsx)(t.code,{children:"undefined"})}),(0,s.jsx)(t.td,{children:"An optional function which can be used to transform and / or filter the items in the sitemap."})]})]})]})}),"\n",(0,s.jsx)(t.h3,{id:"types",children:"Types"}),"\n",(0,s.jsx)(t.h4,{id:"CreateSitemapItemsFn",children:(0,s.jsx)(t.code,{children:"CreateSitemapItemsFn"})}),"\n",(0,s.jsx)(t.pre,{children:(0,s.jsx)(t.code,{className:"language-ts",children:"type CreateSitemapItemsFn = (params: {\n siteConfig: DocusaurusConfig;\n routes: RouteConfig[];\n defaultCreateSitemapItems: CreateSitemapItemsFn;\n}) => Promise<SitemapItem[]>;\n"})}),"\n",(0,s.jsxs)(t.admonition,{type:"info",children:[(0,s.jsx)(t.p,{children:"This plugin also respects some site config:"}),(0,s.jsxs)(t.ul,{children:["\n",(0,s.jsxs)(t.li,{children:[(0,s.jsx)(t.a,{href:"/docs/api/docusaurus-config#noIndex",children:(0,s.jsx)(t.code,{children:"noIndex"})}),": results in no sitemap generated"]}),"\n",(0,s.jsxs)(t.li,{children:[(0,s.jsx)(t.a,{href:"/docs/api/docusaurus-config#trailingSlash",children:(0,s.jsx)(t.code,{children:"trailingSlash"})}),": determines if the URLs in the sitemap have trailing slashes"]}),"\n"]})]}),"\n",(0,s.jsxs)(t.admonition,{type:"note",children:[(0,s.jsxs)(t.mdxAdmonitionTitle,{children:["About ",(0,s.jsx)(t.code,{children:"lastmod"})]}),(0,s.jsxs)(t.p,{children:["The ",(0,s.jsx)(t.code,{children:"lastmod"})," option will only output a sitemap ",(0,s.jsx)(t.code,{children:"<lastmod>"})," tag if plugins provide ",(0,s.jsx)(t.a,{href:"/docs/api/plugin-methods/lifecycle-apis#addRoute",children:"route metadata"})," attributes ",(0,s.jsx)(t.code,{children:"sourceFilePath"})," and/or ",(0,s.jsx)(t.code,{children:"lastUpdatedAt"}),"."]}),(0,s.jsxs)(t.p,{children:["All the official content plugins provide the metadata for routes backed by a content file (Markdown, MDX or React page components), but it is possible third-party plugin authors do not provide this information, and the plugin will not be able to output a ",(0,s.jsx)(t.code,{children:"<lastmod>"})," tag for their routes."]})]}),"\n",(0,s.jsx)(t.h3,{id:"ex-config",children:"Example configuration"}),"\n",(0,s.jsx)(t.p,{children:"You can configure this plugin through preset options or plugin options."}),"\n",(0,s.jsx)(t.admonition,{type:"tip",children:(0,s.jsx)(t.p,{children:"Most Docusaurus users configure this plugin through the preset options."})}),"\n","\n",(0,s.jsx)(c.A,{pluginName:"@docusaurus/plugin-sitemap",presetOptionName:"sitemap",code:"{\n lastmod: 'date',\n changefreq: 'weekly',\n priority: 0.5,\n ignorePatterns: ['/tags/**'],\n filename: 'sitemap.xml',\n createSitemapItems: async (params) => {\n const {defaultCreateSitemapItems, ...rest} = params;\n const items = await defaultCreateSitemapItems(rest);\n return items.filter((item) => !item.url.includes('/page/'));\n },\n}"}),"\n",(0,s.jsxs)(t.p,{children:["You can find your sitemap at ",(0,s.jsx)(t.code,{children:"/sitemap.xml"}),"."]})]})}function f(e={}){let{wrapper:t}={...(0,i.R)(),...e.components};return t?(0,s.jsx)(t,{...e,children:(0,s.jsx)(m,{...e})}):m(e)}},14992:function(e,t,n){n.d(t,{A:()=>i});var r=n(74848);n(96540);var s=n(11118);function i({className:e,...t}){return(0,r.jsx)("button",{type:"button",...t,className:(0,s.A)("clean-btn",e)})}},46221:function(e,t,n){n.d(t,{A:()=>h});var r=n(74848),s=n(96540),i=n(11118),a=n(33977),l=n(47466),o=n(14992),c=n(11912),d=n(32732),u=n(15028);function h({className:e}){let{copyCode:t,isCopied:n}=function(){let{metadata:{code:e}}=(0,l.Ph)(),[t,n]=(0,s.useState)(!1),r=(0,s.useRef)(void 0),i=(0,s.useCallback)(()=>{navigator.clipboard.writeText(e).then(()=>{n(!0),r.current=window.setTimeout(()=>{n(!1)},1e3)})},[e]);return(0,s.useEffect)(()=>()=>window.clearTimeout(r.current),[]),{copyCode:i,isCopied:t}}();return(0,r.jsx)(o.A,{"aria-label":n?(0,a.T)({id:"theme.CodeBlock.copied",message:"Copied",description:"The copied button label on code blocks"}):(0,a.T)({id:"theme.CodeBlock.copyButtonAriaLabel",message:"Copy code to clipboard",description:"The ARIA label for copy code blocks button"}),title:(0,a.T)({id:"theme.CodeBlock.copy",message:"Copy",description:"The copy button label on code blocks"}),className:(0,i.A)(e,u.A.copyButton,n&&u.A.copyButtonCopied),onClick:t,children:(0,r.jsxs)("span",{className:u.A.copyButtonIcons,"aria-hidden":"true",children:[(0,r.jsx)(c.A,{className:u.A.copyButtonIcon}),(0,r.jsx)(d.A,{className:u.A.copyButtonSuccessIcon})]})})}},90644:function(e,t,n){n.d(t,{A:()=>d});var r=n(74848);n(96540);var s=n(11118),i=n(33977),a=n(47466),l=n(14992),o=n(22993),c=n(143);function d({className:e}){let{wordWrap:t}=(0,a.Ph)();if(!(t.isEnabled||t.isCodeScrollable))return!1;let n=(0,i.T)({id:"theme.CodeBlock.wordWrapToggle",message:"Toggle word wrap",description:"The title attribute for toggle word wrapping button of code block lines"});return(0,r.jsx)(l.A,{onClick:()=>t.toggle(),className:(0,s.A)(e,t.isEnabled&&c.A.wordWrapButtonEnabled),"aria-label":n,title:n,children:(0,r.jsx)(o.A,{className:c.A.wordWrapButtonIcon,"aria-hidden":"true"})})}},22207:function(e,t,n){n.d(t,{A:()=>c});var r=n(74848);n(96540);var s=n(11118),i=n(74253),a=n(46221),l=n(90644),o=n(75864);function c({className:e}){return(0,r.jsx)(i.A,{children:()=>(0,r.jsxs)("div",{className:(0,s.A)(e,o.A.buttonGroup),children:[(0,r.jsx)(l.A,{}),(0,r.jsx)(a.A,{})]})})}},78209:function(e,t,n){n.d(t,{A:()=>c});var r=n(74848);n(96540);var s=n(11118),i=n(2933),a=n(85208),l=n(47466),o=n(37322);function c({as:e,...t}){let n=(0,i.A)(),c=(0,l.M$)(n);return(0,r.jsx)(e,{...t,style:c,className:(0,s.A)(t.className,o.A.codeBlockContainer,a.G.common.codeBlock)})}},52779:function(e,t,n){n.d(t,{A:()=>l});var r=n(74848);n(96540);var s=n(11118),i=n(78209),a=n(81772);function l({children:e,className:t}){return(0,r.jsx)(i.A,{as:"pre",tabIndex:0,className:(0,s.A)(a.A.codeBlockStandalone,"thin-scrollbar",t),children:(0,r.jsx)("code",{className:a.A.codeBlockLines,children:e})})}},15318:function(e,t,n){n.d(t,{A:()=>o});var r=n(74848);n(96540);var s=n(60191),i=n(47466),a=n(38542),l=n(57940);function o(e){let t=function(e){let{prism:t}=(0,s.p)();return(0,i.mU)({code:e.children,className:e.className,metastring:e.metastring,magicComments:t.magicComments,defaultLanguage:t.defaultLanguage,language:e.language,title:e.title,showLineNumbers:e.showLineNumbers})}(e),n=(0,a.f)();return(0,r.jsx)(i.l8,{metadata:t,wordWrap:n,children:(0,r.jsx)(l.A,{})})}},31415:function(e,t,n){n.d(t,{A:()=>p});var r=n(74848),s=n(96540),i=n(11118),a=n(47466),l=n(2933),o=n(57767),c=n(4520),d=n(81772);let u=s.forwardRef((e,t)=>(0,r.jsx)("pre",{ref:t,tabIndex:0,...e,className:(0,i.A)(e.className,d.A.codeBlock,"thin-scrollbar")}));function h(e){let{metadata:t}=(0,a.Ph)();return(0,r.jsx)("code",{...e,className:(0,i.A)(e.className,d.A.codeBlockLines,void 0!==t.lineNumbersStart&&d.A.codeBlockLinesWithNumbering),style:{...e.style,counterReset:void 0===t.lineNumbersStart?void 0:`line-count ${t.lineNumbersStart-1}`}})}function p({className:e}){let{metadata:t,wordWrap:n}=(0,a.Ph)(),s=(0,l.A)(),{code:d,language:p,lineNumbersStart:m,lineClassNames:f}=t;return(0,r.jsx)(o.f4,{theme:s,code:d,language:p,children:({className:t,style:s,tokens:a,getLineProps:l,getTokenProps:o})=>(0,r.jsx)(u,{ref:n.codeBlockRef,className:(0,i.A)(e,t),style:s,children:(0,r.jsx)(h,{children:a.map((e,t)=>(0,r.jsx)(c.A,{line:e,getLineProps:l,getTokenProps:o,classNames:f[t],showLineNumbers:void 0!==m},t))})})})}},57940:function(e,t,n){n.d(t,{A:()=>u});var r=n(74848);n(96540);var s=n(11118),i=n(47466),a=n(78209),l=n(11684),o=n(31415),c=n(22207),d=n(73215);function u({className:e}){let{metadata:t}=(0,i.Ph)();return(0,r.jsxs)(a.A,{as:"div",className:(0,s.A)(e,t.className),children:[t.title&&(0,r.jsx)("div",{className:d.A.codeBlockTitle,children:(0,r.jsx)(l.A,{children:t.title})}),(0,r.jsxs)("div",{className:d.A.codeBlockContent,children:[(0,r.jsx)(o.A,{}),(0,r.jsx)(c.A,{})]})]})}},80510:function(e,t,n){n.d(t,{A:()=>s});var r=n(74848);function s({line:e,token:t,...n}){return(0,r.jsx)("span",{...n})}n(96540)},4520:function(e,t,n){n.d(t,{A:()=>o});var r=n(74848);n(96540);var s=n(11118),i=n(80510),a=n(631);function l(){return(0,r.jsx)("br",{})}function o({line:e,classNames:t,showLineNumbers:n,getLineProps:o,getTokenProps:c}){let d,u=(d=1===e.length&&"\n"===e[0].content?e[0]:void 0)?[{...d,content:""}]:e,h=o({line:u,className:(0,s.A)(t,n&&a.A.codeLine)}),p=u.map((e,t)=>{let n=c({token:e});return(0,r.jsx)(i.A,{...n,line:u,token:e,children:n.children},t)});return(0,r.jsxs)("div",{...h,children:[n?(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)("span",{className:a.A.codeLineNumber}),(0,r.jsx)("span",{className:a.A.codeLineContent,children:p})]}):p,(0,r.jsx)(l,{})]})}},11684:function(e,t,n){n.d(t,{A:()=>r});function r({children:e}){return e}},26473:function(e,t,n){n.d(t,{A:()=>o});var r=n(74848),s=n(96540),i=n(30926),a=n(52779),l=n(15318);function o({children:e,...t}){let n=(0,i.A)(),o=s.Children.toArray(e).some(e=>(0,s.isValidElement)(e))?e:Array.isArray(e)?e.join(""):e,c="string"==typeof o?l.A:a.A;return(0,r.jsx)(c,{...t,children:o},String(n))}},11912:function(e,t,n){n.d(t,{A:()=>s});var r=n(74848);function s(e){return(0,r.jsx)("svg",{viewBox:"0 0 24 24",...e,children:(0,r.jsx)("path",{fill:"currentColor",d:"M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"})})}n(96540)},32732:function(e,t,n){n.d(t,{A:()=>s});var r=n(74848);function s(e){return(0,r.jsx)("svg",{viewBox:"0 0 24 24",...e,children:(0,r.jsx)("path",{fill:"currentColor",d:"M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"})})}n(96540)},22993:function(e,t,n){n.d(t,{A:()=>s});var r=n(74848);function s(e){return(0,r.jsx)("svg",{viewBox:"0 0 24 24",...e,children:(0,r.jsx)("path",{fill:"currentColor",d:"M4 19h6v-2H4v2zM20 5H4v2h16V5zm-3 6H4v2h13.25c1.1 0 2 .9 2 2s-.9 2-2 2H15v-2l-3 3l3 3v-2h2c2.21 0 4-1.79 4-4s-1.79-4-4-4z"})})}n(96540)},13899:function(e,t,n){n.d(t,{A:()=>a});var r=n(74848);n(96540);var s=n(11118),i=n(41452);function a({children:e,hidden:t,className:n}){return(0,r.jsx)("div",{role:"tabpanel",className:(0,s.A)(i.A.tabItem,n),hidden:t,children:e})}},14729:function(e,t,n){n.d(t,{A:()=>m});var r=n(74848),s=n(96540),i=n(11118),a=n(85208),l=n(31191),o=n(17060),c=n(30926),d=n(18416);function u({className:e,block:t,selectedValue:n,selectValue:s,tabValues:a}){let o=[],{blockElementScrollPositionUntilNextRender:c}=(0,l.a_)(),u=e=>{let t=e.currentTarget,r=a[o.indexOf(t)].value;r!==n&&(c(t),s(r))},h=e=>{let t=null;switch(e.key){case"Enter":u(e);break;case"ArrowRight":{let n=o.indexOf(e.currentTarget)+1;t=o[n]??o[0];break}case"ArrowLeft":{let n=o.indexOf(e.currentTarget)-1;t=o[n]??o[o.length-1]}}t?.focus()};return(0,r.jsx)("ul",{role:"tablist","aria-orientation":"horizontal",className:(0,i.A)("tabs",{"tabs--block":t},e),children:a.map(({value:e,label:t,attributes:s})=>(0,r.jsx)("li",{role:"tab",tabIndex:n===e?0:-1,"aria-selected":n===e,ref:e=>{o.push(e)},onKeyDown:h,onClick:u,...s,className:(0,i.A)("tabs__item",d.A.tabItem,s?.className,{"tabs__item--active":n===e}),children:t??e},e))})}function h({lazy:e,children:t,selectedValue:n}){let a=(Array.isArray(t)?t:[t]).filter(Boolean);if(e){let e=a.find(e=>e.props.value===n);return e?(0,s.cloneElement)(e,{className:(0,i.A)("margin-top--md",e.props.className)}):null}return(0,r.jsx)("div",{className:"margin-top--md",children:a.map((e,t)=>(0,s.cloneElement)(e,{key:t,hidden:e.props.value!==n}))})}function p(e){let t=(0,o.u)(e);return(0,r.jsxs)("div",{className:(0,i.A)(a.G.tabs.container,"tabs-container",d.A.tabList),children:[(0,r.jsx)(u,{...t,...e}),(0,r.jsx)(h,{...t,...e})]})}function m(e){let t=(0,c.A)();return(0,r.jsx)(p,{...e,children:(0,o.v)(e.children)},String(t))}},38542:function(e,t,n){n.d(t,{f:()=>i});var r=n(96540),s=n(93802);function i(){let[e,t]=(0,r.useState)(!1),[n,i]=(0,r.useState)(!1),a=(0,r.useRef)(null),l=(0,r.useCallback)(()=>{let n=a.current.querySelector("code");e?n.removeAttribute("style"):(n.style.whiteSpace="pre-wrap",n.style.overflowWrap="anywhere"),t(e=>!e)},[a,e]),o=(0,r.useCallback)(()=>{let{scrollWidth:e,clientWidth:t}=a.current;i(e>t||a.current.querySelector("code").hasAttribute("style"))},[a]);return!function(e,t){let[n,i]=(0,r.useState)(),a=(0,r.useCallback)(()=>{i(e.current?.closest("[role=tabpanel][hidden]"))},[e,i]);(0,r.useEffect)(()=>{a()},[a]),(0,s.P)(n,e=>{e.forEach(e=>{"attributes"===e.type&&"hidden"===e.attributeName&&(t(),a())})},{attributes:!0,characterData:!1,childList:!1,subtree:!1})}(a,o),(0,r.useEffect)(()=>{o()},[e,o]),(0,r.useEffect)(()=>(window.addEventListener("resize",o,{passive:!0}),()=>{window.removeEventListener("resize",o)}),[o]),{codeBlockRef:a,isEnabled:e,isCodeScrollable:n,toggle:l}}},93802:function(e,t,n){n.d(t,{P:()=>a});var r=n(96540),s=n(28413);let i={attributes:!0,characterData:!0,childList:!0,subtree:!0};function a(e,t,n=i){let l=(0,s._q)(t),o=(0,s.Be)(n);(0,r.useEffect)(()=>{let t=new MutationObserver(l);return e&&t.observe(e,o),()=>t.disconnect()},[e,l,o])}},2933:function(e,t,n){n.d(t,{A:()=>i});var r=n(51696),s=n(60191);function i(){let{prism:e}=(0,s.p)(),{colorMode:t}=(0,r.G)(),n=e.theme,i=e.darkTheme||n;return"dark"===t?i:n}},47466:function(e,t,n){n.d(t,{M$:()=>g,Ph:()=>b,l8:()=>j,mU:()=>f});var r=n(74848),s=n(96540),i=n(11118),a=n(19934),l=n.n(a),o=n(28413);let c=/title=(?<quote>["'])(?<title>.*?)\1/,d=/\{(?<range>[\d,-]+)\}/,u={js:{start:"\\/\\/",end:""},jsBlock:{start:"\\/\\*",end:"\\*\\/"},jsx:{start:"\\{\\s*\\/\\*",end:"\\*\\/\\s*\\}"},bash:{start:"#",end:""},html:{start:"\x3c!--",end:"--\x3e"}},h={...u,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:""}},p=Object.keys(u);function m(e,t){let n=e.map(e=>{let{start:n,end:r}=h[e];return`(?:${n}\\s*(${t.flatMap(e=>[e.line,e.block?.start,e.block?.end].filter(Boolean)).join("|")})\\s*${r})`}).join("|");return RegExp(`^\\s*(?:${n})\\s*$`)}function f(e){var t,n,r,s,a;let o,u=(n=(t={language:e.language,defaultLanguage:e.defaultLanguage,className:e.className}).language??function(e){if(!e)return;let t=e.split(" ").find(e=>e.startsWith("language-"));return t?.replace(/language-/,"")}(t.className)??t.defaultLanguage,n?.toLowerCase()??"text"),{lineClassNames:h,code:f}=(r=e.code,s={metastring:e.metastring,magicComments:e.magicComments,language:u},function(e,{metastring:t,magicComments:n}){if(t&&d.test(t)){let r=t.match(d).groups.range;if(0===n.length)throw Error(`A highlight range has been given in code block's metastring (\`\`\` ${t}), but no magic comment config is available. Docusaurus applies the first magic comment entry's className for metastring ranges.`);let s=n[0].className;return{lineClassNames:Object.fromEntries(l()(r).filter(e=>e>0).map(e=>[e-1,[s]])),code:e}}return null}(o=r.replace(/\r?\n$/,""),{...s})??function(e,t){let{language:n,magicComments:r}=t;if(void 0===n)return{lineClassNames:{},code:e};let s=function(e,t){switch(e){case"js":case"javascript":case"ts":case"typescript":return m(["js","jsBlock"],t);case"jsx":case"tsx":return m(["js","jsBlock","jsx"],t);case"html":return m(["js","jsBlock","html"],t);case"python":case"py":case"bash":return m(["bash"],t);case"markdown":case"md":return m(["html","jsx","bash"],t);case"tex":case"latex":case"matlab":return m(["tex"],t);case"lua":case"haskell":return m(["lua"],t);case"sql":return m(["lua","jsBlock"],t);case"wasm":return m(["wasm"],t);case"vb":case"vba":case"visual-basic":return m(["vb","rem"],t);case"vbnet":return m(["vbnet","rem"],t);case"batch":return m(["rem"],t);case"basic":return m(["rem","f90"],t);case"fsharp":return m(["js","ml"],t);case"ocaml":case"sml":return m(["ml"],t);case"fortran":return m(["f90"],t);case"cobol":return m(["cobol"],t);default:return m(p,t)}}(n,r),i=e.split(/\r?\n/),a=Object.fromEntries(r.map(e=>[e.className,{start:0,range:""}])),o=Object.fromEntries(r.filter(e=>e.line).map(({className:e,line:t})=>[t,e])),c=Object.fromEntries(r.filter(e=>e.block).map(({className:e,block:t})=>[t.start,e])),d=Object.fromEntries(r.filter(e=>e.block).map(({className:e,block:t})=>[t.end,e]));for(let e=0;e<i.length;){let t=i[e].match(s);if(!t){e+=1;continue}let n=t.slice(1).find(e=>void 0!==e);o[n]?a[o[n]].range+=`${e},`:c[n]?a[c[n]].start=e:d[n]&&(a[d[n]].range+=`${a[d[n]].start}-${e-1},`),i.splice(e,1)}let u={};return Object.entries(a).forEach(([e,{range:t}])=>{l()(t).forEach(t=>{u[t]??=[],u[t].push(e)})}),{code:i.join("\n"),lineClassNames:u}}(o,{...s})),g=function({className:e,language:t}){return(0,i.A)(e,t&&!e?.includes(`language-${t}`)&&`language-${t}`)}({className:e.className,language:u}),x=(a=e.metastring,(a?.match(c)?.groups.title??"")||e.title),j=function({showLineNumbers:e,metastring:t}){if("boolean"==typeof e)return e?1:void 0;if("number"==typeof e)return e;let n=t?.split(" ").find(e=>e.startsWith("showLineNumbers"));if(n)return n.startsWith("showLineNumbers=")?parseInt(n.replace("showLineNumbers=",""),10):1}({showLineNumbers:e.showLineNumbers,metastring:e.metastring});return{codeInput:e.code,code:f,className:g,language:u,title:x,lineNumbersStart:j,lineClassNames:h}}function g(e){let t={color:"--prism-color",backgroundColor:"--prism-background-color"},n={};return Object.entries(e.plain).forEach(([e,r])=>{let s=t[e];s&&"string"==typeof r&&(n[s]=r)}),n}let x=(0,s.createContext)(null);function j({metadata:e,wordWrap:t,children:n}){let i=(0,s.useMemo)(()=>({metadata:e,wordWrap:t}),[e,t]);return(0,r.jsx)(x.Provider,{value:i,children:n})}function b(){let e=(0,s.useContext)(x);if(null===e)throw new o.dV("CodeBlockContextProvider");return e}},17060:function(e,t,n){n.d(t,{u:()=>u,v:()=>c});var r=n(96540),s=n(49519),i=n(57190),a=n(11864),l=n(84329),o=n(34123);function c(e){return r.Children.toArray(e).filter(e=>"\n"!==e).map(e=>{if(!e||(0,r.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.`)})?.filter(Boolean)??[]}function d({value:e,tabValues:t}){return t.some(t=>t.value===e)}function u(e){let t,{defaultValue:n,queryString:u=!1,groupId:h}=e,p=function(e){let{values:t,children:n}=e;return(0,r.useMemo)(()=>{let e=t??c(n).map(({props:{value:e,label:t,attributes:n,default:r}})=>({value:e,label:t,attributes:n,default:r})),r=(0,l.XI)(e,(e,t)=>e.value===t.value);if(r.length>0)throw Error(`Docusaurus error: Duplicate values "${r.map(e=>e.value).join(", ")}" found in <Tabs>. Every value needs to be unique.`);return e},[t,n])}(e),[m,f]=(0,r.useState)(()=>(function({defaultValue:e,tabValues:t}){if(0===t.length)throw Error("Docusaurus error: the <Tabs> component requires at least one <TabItem> children component");if(e){if(!d({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=t.find(e=>e.default)??t[0];if(!n)throw Error("Unexpected error: 0 tabValues");return n.value})({defaultValue:n,tabValues:p})),[g,x]=function({queryString:e=!1,groupId:t}){let n=(0,s.W6)(),i=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 t??null}({queryString:e,groupId:t});return[(0,a.aZ)(i),(0,r.useCallback)(e=>{if(!i)return;let t=new URLSearchParams(n.location.search);t.set(i,e),n.replace({...n.location,search:t.toString()})},[i,n])]}({queryString:u,groupId:h}),[j,b]=function({groupId:e}){let t=e?`docusaurus.tab.${e}`:null,[n,s]=(0,o.Dv)(t);return[n,(0,r.useCallback)(e=>{t&&s.set(e)},[t,s])]}({groupId:h}),v=d({value:t=g??j,tabValues:p})?t:null;return(0,i.A)(()=>{v&&f(v)},[v]),{selectedValue:m,selectValue:(0,r.useCallback)(e=>{if(!d({value:e,tabValues:p}))throw Error(`Can't select invalid tab value=${e}`);f(e),x(e),b(e)},[x,b,p]),tabValues:p}}},78020:function(e,t,n){n.d(t,{A:()=>a});var r=n(74848);n(96540);var s=n(26473),i=n(18738);function a(e){return e.live?(0,r.jsx)(i.A,{...e}):(0,r.jsx)(s.A,{...e})}},18738:function(e,t,n){n.d(t,{A:()=>a});var r=n(74848);n(96540);var s=n(8607),i=n(92883);function a(e){return(0,r.jsx)(s.A,{scope:i.A,...e})}},151:function(e,t,n){n.d(t,{A:()=>i});var r=n(74848);n(96540);var s=n(85120);function i({children:e}){return(0,r.jsx)("div",{className:s.A.playgroundContainer,children:e})}},50045:function(e,t,n){n.d(t,{A:()=>c});var r=n(74848);n(96540);var s=n(370),i=n(30926),a=n(33977),l=n(98673),o=n(19304);function c(){let e=(0,i.A)();return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(l.A,{children:(0,r.jsx)(a.A,{id:"theme.Playground.liveEditor",description:"The live editor label of the live codeblocks",children:"Live Editor"})}),(0,r.jsx)(s.w,{className:o.A.playgroundEditor},String(e))]})}},98673:function(e,t,n){n.d(t,{A:()=>a});var r=n(74848);n(96540);var s=n(11118),i=n(79820);function a({children:e}){return(0,r.jsx)("div",{className:(0,s.A)(i.A.playgroundHeader),children:e})}},89142:function(e,t,n){n.d(t,{A:()=>l});var r=n(74848);n(96540);var s=n(60191),i=n(89344),a=n(50045);function l(){let{playgroundPosition:e}=(0,s.p)().liveCodeBlock;return(0,r.jsx)(r.Fragment,{children:"top"===e?(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(i.A,{}),(0,r.jsx)(a.A,{})]}):(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(a.A,{}),(0,r.jsx)(i.A,{})]})})}},89344:function(e,t,n){n.d(t,{A:()=>p});var r=n(74848);n(96540);var s=n(370),i=n(74253),a=n(65840),l=n(78339),o=n(33977),c=n(98673),d=n(60477);function u(){return(0,r.jsx)("div",{children:"Loading..."})}function h(){return(0,r.jsx)(i.A,{fallback:(0,r.jsx)(u,{}),children:()=>(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(l.A,{fallback:e=>(0,r.jsx)(a.MN,{...e}),children:(0,r.jsx)(s.pA,{})}),(0,r.jsx)(s.p1,{})]})})}function p(){return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(c.A,{children:(0,r.jsx)(o.A,{id:"theme.Playground.result",description:"The result label of the live codeblocks",children:"Result"})}),(0,r.jsx)("div",{className:d.A.playgroundPreview,children:(0,r.jsx)(h,{})})]})}},65593:function(e,t,n){n.d(t,{A:()=>l});var r=n(74848);n(96540);var s=n(370),i=n(2933);let a=e=>`${e};`;function l({code:e,children:t,...n}){let l=(0,i.A)(),o=n.metastring?.includes("noInline")??!1;return(0,r.jsx)(s.Q,{noInline:o,theme:l,...n,code:e?.replace(/\n$/,""),transformCode:n.transformCode??a,children:t})}},8607:function(e,t,n){n.d(t,{A:()=>l});var r=n(74848);n(96540);var s=n(65593),i=n(151),a=n(89142);function l({children:e,transformCode:t,...n}){return(0,r.jsx)(i.A,{children:(0,r.jsx)(s.A,{code:e,...n,children:(0,r.jsx)(a.A,{})})})}},74253:function(e,t,n){n.d(t,{A:()=>i});var r=n(74848);n(96540);var s=n(30926);function i({children:e,fallback:t}){return(0,s.A)()?(0,r.jsx)(r.Fragment,{children:e?.()}):t??null}},6125:function(e,t,n){n.d(t,{A:()=>c});var r=n(74848),s=n(96540),i=n(79024),a=n(49519),l=n(11344);let o=s.forwardRef(function({name:e,children:t},n){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),o=e?`${e}-${l}`:l,c=`#${o}`,d=(0,a.W6)();return(0,i.A)().collectAnchor(o),(0,r.jsx)("tr",{id:o,tabIndex:0,ref:d.location.hash===c?n:void 0,onClick:e=>{let t="TD"===e.target.tagName.toUpperCase(),n=!!window.getSelection()?.toString();t&&!n&&d.push(c)},onKeyDown:e=>{"Enter"===e.key&&d.push(c)},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[n,i]=s.Children.toArray(e.props.children),a=(0,s.useRef)(null);(0,s.useEffect)(()=>{a.current?.focus()},[a]);let c=s.Children.map(i.props.children,e=>(0,r.jsx)(o,{name:t,ref:a,children:e}));return(0,r.jsxs)("table",{className:l.A.apiTable,children:[n,(0,r.jsx)("tbody",{children:c})]})}},63402:function(e,t,n){let r;n.d(t,{A:()=>u});var s=n(74848);n(96540);var i=n(55831),a=n(86151),l=n(33977),o=n(14729),c=n(13899),d=n(70590);function u({code:e,pluginName:t,presetOptionName:n}){let u=(0,a.ir)(r).path;return(0,s.jsxs)(o.A,{groupId:"api-config-ex",children:[(0,s.jsxs)(c.A,{value:"preset",label:(0,l.T)({message:"Preset options"}),children:[(0,s.jsx)("p",{children:(0,s.jsx)(l.A,{id:"apiDocs.configTabs.presetOptions.description",values:{presetLink:(0,s.jsx)(i.A,{to:`${u}/using-plugins#docusauruspreset-classic`,children:(0,s.jsx)(l.A,{children:"preset options"})})},children:"If you use a preset, configure this plugin through the {presetLink}:"})}),(0,s.jsx)(d.A,{language:"js",title:"docusaurus.config.js",children:`module.exports = {
|
|
presets: [
|
|
[
|
|
'@docusaurus/preset-classic',
|
|
{
|
|
// highlight-start
|
|
${n}: ${e.replace(/\n/g,"\n ")},
|
|
// highlight-end
|
|
},
|
|
],
|
|
],
|
|
};`})]}),(0,s.jsxs)(c.A,{value:"plugin",label:(0,l.T)({message:"Plugin options"}),children:[(0,s.jsx)("p",{children:(0,s.jsx)(l.A,{children:"If you are using a standalone plugin, provide options directly to the plugin:"})}),(0,s.jsx)(d.A,{language:"js",title:"docusaurus.config.js",children:`module.exports = {
|
|
plugins: [
|
|
[
|
|
'${t}',
|
|
// highlight-start
|
|
${e.replace(/\n/g,"\n ")},
|
|
// highlight-end
|
|
],
|
|
],
|
|
};`})]})]})}},70590:function(e,t,n){n.d(t,{A:()=>i});var r=n(74848);n(96540);var s=n(78020);function i(e){return(0,r.jsx)(s.A,{...e})}},93721:function(e,t,n){n.r(t),n.d(t,{ButtonExample:()=>s});var r=n(74848);function s(e){return(0,r.jsx)("button",{type:"button",...e,style:{backgroundColor:"white",color:"black",border:"solid red",borderRadius:20,padding:10,cursor:"pointer",...e.style}})}n(96540)},92883:function(e,t,n){n.d(t,{A:()=>i});var r=n(96540),s=n(93721);let i={React:r,...r,...s}},2477:function(e){e.exports=JSON.parse('{"id":"api/plugins/plugin-sitemap","title":"\u{1F4E6} plugin-sitemap","description":"This plugin creates sitemaps for your site so that search engine crawlers can crawl your site more accurately.","source":"@site/docs/api/plugins/plugin-sitemap.mdx","sourceDirName":"api/plugins","slug":"/api/plugins/@docusaurus/plugin-sitemap","permalink":"/docs/api/plugins/@docusaurus/plugin-sitemap","draft":false,"unlisted":false,"editUrl":"https://github.com/facebook/docusaurus/edit/main/website/docs/api/plugins/plugin-sitemap.mdx","tags":[],"version":"current","lastUpdatedBy":"dependabot[bot]","lastUpdatedAt":1764857819000,"sidebarPosition":10,"frontMatter":{"sidebar_position":10,"slug":"/api/plugins/@docusaurus/plugin-sitemap"},"sidebar":"api","previous":{"title":"\u{1F4E6} plugin-pwa","permalink":"/docs/api/plugins/@docusaurus/plugin-pwa"},"next":{"title":"\u{1F4E6} plugin-vercel-analytics","permalink":"/docs/api/plugins/@docusaurus/plugin-vercel-analytics"}}')}}]); |