mirror of
https://github.com/facebook/docusaurus.git
synced 2025-04-29 10:17:55 +02:00
22 lines
No EOL
63 KiB
JavaScript
22 lines
No EOL
63 KiB
JavaScript
"use strict";(self.webpackChunkwebsite=self.webpackChunkwebsite||[]).push([["80849"],{84645:function(e,n,t){t.d(n,{ZP:()=>d,d$:()=>l});var s=t(85893),r=t(80980);let l=[{value:"Tags File",id:"tags-file",level:2},{value:"Types",id:"tags-file-types",level:3},{value:"Example",id:"tags-file-example",level:3}];function i(e){let n={a:"a",admonition:"admonition",code:"code",h2:"h2",h3:"h3",p:"p",pre:"pre",...(0,r.a)(),...e.components};return(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(n.h2,{id:"tags-file",children:"Tags File"}),"\n",(0,s.jsxs)(n.p,{children:["Use the ",(0,s.jsxs)(n.a,{href:"#tags",children:[(0,s.jsx)(n.code,{children:"tags"})," plugin option"]})," to configure the path of a YAML tags file."]}),"\n",(0,s.jsxs)(n.p,{children:["By convention, the plugin will look for a ",(0,s.jsx)(n.code,{children:"tags.yml"})," file at the root of your content folder(s)."]}),"\n",(0,s.jsxs)(n.p,{children:["This file can contain a list of predefined tags. You can reference these tags by their keys in Markdown files thanks to the ",(0,s.jsxs)(n.a,{href:"#markdown-front-matter",children:[(0,s.jsx)(n.code,{children:"tags"})," front matter"]}),"."]}),"\n",(0,s.jsx)(n.admonition,{title:"Keeping tags consistent",type:"tip",children:(0,s.jsxs)(n.p,{children:["Using a tags file, you can ensure that your tags usage is consistent across your plugin content set. Use the ",(0,s.jsx)(n.a,{href:"#onInlineTags",children:(0,s.jsx)(n.code,{children:"onInlineTags: 'throw'"})})," plugin option to enforce this consistency and prevent usage of inline tags declared on the fly."]})}),"\n",(0,s.jsx)(n.h3,{id:"tags-file-types",children:"Types"}),"\n",(0,s.jsx)(n.p,{children:"The YAML content of the provided tags file should respect the following shape:"}),"\n",(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-tsx",children:"type Tag = {\n label?: string; // Tag display label\n permalink?: string; // Tag URL pathname segment\n description?: string; // Tag description displayed in the tag page\n};\n\ntype TagsFileInput = Record<string, Partial<Tag> | null>;\n"})}),"\n",(0,s.jsx)(n.h3,{id:"tags-file-example",children:"Example"}),"\n",(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-yml",metastring:'title="tags.yml"',children:"releases:\n label: 'Product releases'\n permalink: '/product-releases'\n description: 'Content related to product releases.'\n\n# A partial tag definition is also valid\nannouncements:\n label: 'Announcements'\n\n# An empty tag definition is also valid\n# Other attributes will be inferred from the key\nemptyTag:\n"})}),"\n",(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-md",metastring:'title="content.md"',children:"---\ntags: [releases, announcements, emptyTag]\n---\n\n# Title\n\nContent\n"})})]})}function d(e={}){let{wrapper:n}={...(0,r.a)(),...e.components};return n?(0,s.jsx)(n,{...e,children:(0,s.jsx)(i,{...e})}):i(e)}},72984:function(e,n,t){t.r(n),t.d(n,{default:()=>p,frontMatter:()=>h,metadata:()=>s,assets:()=>x,toc:()=>j,contentTitle:()=>u});var s=JSON.parse('{"id":"api/plugins/plugin-content-blog","title":"\uD83D\uDCE6 plugin-content-blog","description":"Provides the Blog feature and is the default blog plugin for Docusaurus.","source":"@site/docs/api/plugins/plugin-content-blog.mdx","sourceDirName":"api/plugins","slug":"/api/plugins/@docusaurus/plugin-content-blog","permalink":"/docs/api/plugins/@docusaurus/plugin-content-blog","draft":false,"unlisted":false,"editUrl":"https://github.com/facebook/docusaurus/edit/main/website/docs/api/plugins/plugin-content-blog.mdx","tags":[],"version":"current","lastUpdatedBy":"S\xe9bastien Lorber","lastUpdatedAt":1738847626000,"sidebarPosition":2,"frontMatter":{"sidebar_position":2,"slug":"/api/plugins/@docusaurus/plugin-content-blog"},"sidebar":"api","previous":{"title":"\uD83D\uDCE6 plugin-content-docs","permalink":"/docs/api/plugins/@docusaurus/plugin-content-docs"},"next":{"title":"\uD83D\uDCE6 plugin-content-pages","permalink":"/docs/api/plugins/@docusaurus/plugin-content-pages"}}'),r=t(85893),l=t(80980),i=t(15398),d=t(58636),o=t(32240),c=t(66359),a=t(84645);let h={sidebar_position:2,slug:"/api/plugins/@docusaurus/plugin-content-blog"},u="\uD83D\uDCE6 plugin-content-blog",x={},j=[{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:"<code>ReadingTimeFn</code>",id:"ReadingTimeFn",level:4},{value:"<code>FeedType</code>",id:"FeedType",level:4},{value:"<code>FeedXSLTOptions</code>",id:"FeedXSLTOptions",level:4},{value:"<code>CreateFeedItemsFn</code>",id:"CreateFeedItemsFn",level:4},{value:"<code>ProcessBlogPostsFn</code>",id:"ProcessBlogPostsFn",level:4},{value:"Example configuration",id:"ex-config",level:3},{value:"Markdown front matter",id:"markdown-front-matter",level:2},...a.d$,{value:"Authors File",id:"authors-file",level:2},{value:"Types",id:"authors-file-types",level:3},{value:"Example",id:"authors-file-example",level:3},{value:"i18n",id:"i18n",level:2},{value:"Translation files location",id:"translation-files-location",level:3},{value:"Example file-system structure",id:"example-file-system-structure",level:3}];function g(e){let n={a:"a",admonition:"admonition",code:"code",em:"em",h1:"h1",h2:"h2",h3:"h3",h4:"h4",header:"header",li:"li",p:"p",pre:"pre",strong:"strong",table:"table",tbody:"tbody",td:"td",th:"th",thead:"thead",tr:"tr",ul:"ul",...(0,l.a)(),...e.components};return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(n.header,{children:(0,r.jsx)(n.h1,{id:"-plugin-content-blog",children:"\uD83D\uDCE6 plugin-content-blog"})}),"\n","\n",(0,r.jsxs)(n.p,{children:["Provides the ",(0,r.jsx)(n.a,{href:"/docs/blog",children:"Blog"})," feature and is the default blog plugin for Docusaurus."]}),"\n",(0,r.jsx)(n.admonition,{title:"some features production only",type:"warning",children:(0,r.jsxs)(n.p,{children:["The ",(0,r.jsx)(n.a,{href:"/docs/blog#feed",children:"feed feature"})," works by extracting the build output, and is ",(0,r.jsx)(n.strong,{children:"only active in production"}),"."]})}),"\n",(0,r.jsx)(n.h2,{id:"installation",children:"Installation"}),"\n",(0,r.jsxs)(i.Z,{groupId:"npm2yarn",children:[(0,r.jsx)(d.Z,{value:"npm",children:(0,r.jsx)(n.pre,{children:(0,r.jsx)(n.code,{className:"language-bash",children:"npm install --save @docusaurus/plugin-content-blog\n"})})}),(0,r.jsx)(d.Z,{value:"yarn",label:"Yarn",children:(0,r.jsx)(n.pre,{children:(0,r.jsx)(n.code,{className:"language-bash",children:"yarn add @docusaurus/plugin-content-blog\n"})})}),(0,r.jsx)(d.Z,{value:"pnpm",label:"pnpm",children:(0,r.jsx)(n.pre,{children:(0,r.jsx)(n.code,{className:"language-bash",children:"pnpm add @docusaurus/plugin-content-blog\n"})})})]}),"\n",(0,r.jsxs)(n.admonition,{type:"tip",children:[(0,r.jsxs)(n.p,{children:["If you use the preset ",(0,r.jsx)(n.code,{children:"@docusaurus/preset-classic"}),", you don't need to install this plugin as a dependency."]}),(0,r.jsxs)(n.p,{children:["You can configure this plugin through the ",(0,r.jsx)(n.a,{href:"/docs/using-plugins#docusauruspreset-classic",children:"preset options"}),"."]})]}),"\n",(0,r.jsx)(n.h2,{id:"configuration",children:"Configuration"}),"\n",(0,r.jsx)(n.p,{children:"Accepted fields:"}),"\n",(0,r.jsx)(o.Z,{children:(0,r.jsxs)(n.table,{children:[(0,r.jsx)(n.thead,{children:(0,r.jsxs)(n.tr,{children:[(0,r.jsx)(n.th,{children:"Name"}),(0,r.jsx)(n.th,{children:"Type"}),(0,r.jsx)(n.th,{children:"Default"}),(0,r.jsx)(n.th,{children:"Description"})]})}),(0,r.jsxs)(n.tbody,{children:[(0,r.jsxs)(n.tr,{children:[(0,r.jsx)(n.td,{children:(0,r.jsx)(n.code,{children:"path"})}),(0,r.jsx)(n.td,{children:(0,r.jsx)(n.code,{children:"string"})}),(0,r.jsx)(n.td,{children:(0,r.jsx)(n.code,{children:"'blog'"})}),(0,r.jsx)(n.td,{children:"Path to the blog content directory on the file system, relative to site dir."})]}),(0,r.jsxs)(n.tr,{children:[(0,r.jsx)(n.td,{children:(0,r.jsx)(n.code,{children:"editUrl"})}),(0,r.jsx)(n.td,{children:(0,r.jsxs)("code",{children:["string | ",(0,r.jsx)(n.a,{href:"#EditUrlFn",children:"EditUrlFn"})]})}),(0,r.jsx)(n.td,{children:(0,r.jsx)(n.code,{children:"undefined"})}),(0,r.jsxs)(n.td,{children:["Base URL to edit your site. The final URL is computed by ",(0,r.jsx)(n.code,{children:"editUrl + relativePostPath"}),". Using a function allows more nuanced control for each file. Omitting this variable entirely will disable edit links."]})]}),(0,r.jsxs)(n.tr,{children:[(0,r.jsx)(n.td,{children:(0,r.jsx)(n.code,{children:"editLocalizedFiles"})}),(0,r.jsx)(n.td,{children:(0,r.jsx)(n.code,{children:"boolean"})}),(0,r.jsx)(n.td,{children:(0,r.jsx)(n.code,{children:"false"})}),(0,r.jsxs)(n.td,{children:["The edit URL will target the localized file, instead of the original unlocalized file. Ignored when ",(0,r.jsx)(n.code,{children:"editUrl"})," is a function."]})]}),(0,r.jsxs)(n.tr,{children:[(0,r.jsx)(n.td,{children:(0,r.jsx)(n.code,{children:"blogTitle"})}),(0,r.jsx)(n.td,{children:(0,r.jsx)(n.code,{children:"string"})}),(0,r.jsx)(n.td,{children:(0,r.jsx)(n.code,{children:"'Blog'"})}),(0,r.jsx)(n.td,{children:"Blog page title for better SEO."})]}),(0,r.jsxs)(n.tr,{children:[(0,r.jsx)(n.td,{children:(0,r.jsx)(n.code,{children:"blogDescription"})}),(0,r.jsx)(n.td,{children:(0,r.jsx)(n.code,{children:"string"})}),(0,r.jsx)(n.td,{children:(0,r.jsx)(n.code,{children:"'Blog'"})}),(0,r.jsx)(n.td,{children:"Blog page meta description for better SEO."})]}),(0,r.jsxs)(n.tr,{children:[(0,r.jsx)(n.td,{children:(0,r.jsx)(n.code,{children:"blogSidebarCount"})}),(0,r.jsx)(n.td,{children:(0,r.jsx)("code",{children:"number | 'ALL'"})}),(0,r.jsx)(n.td,{children:(0,r.jsx)(n.code,{children:"5"})}),(0,r.jsxs)(n.td,{children:["Number of blog post elements to show in the blog sidebar. ",(0,r.jsx)(n.code,{children:"'ALL'"})," to show all blog posts; ",(0,r.jsx)(n.code,{children:"0"})," to disable."]})]}),(0,r.jsxs)(n.tr,{children:[(0,r.jsx)(n.td,{children:(0,r.jsx)(n.code,{children:"blogSidebarTitle"})}),(0,r.jsx)(n.td,{children:(0,r.jsx)(n.code,{children:"string"})}),(0,r.jsx)(n.td,{children:(0,r.jsx)(n.code,{children:"'Recent posts'"})}),(0,r.jsx)(n.td,{children:"Title of the blog sidebar."})]}),(0,r.jsxs)(n.tr,{children:[(0,r.jsx)(n.td,{children:(0,r.jsx)(n.code,{children:"routeBasePath"})}),(0,r.jsx)(n.td,{children:(0,r.jsx)(n.code,{children:"string"})}),(0,r.jsx)(n.td,{children:(0,r.jsx)(n.code,{children:"'blog'"})}),(0,r.jsxs)(n.td,{children:["URL route for the blog section of your site. ",(0,r.jsx)(n.strong,{children:"DO NOT"})," include a trailing slash. Use ",(0,r.jsx)(n.code,{children:"/"})," to put the blog at root path."]})]}),(0,r.jsxs)(n.tr,{children:[(0,r.jsx)(n.td,{children:(0,r.jsx)(n.code,{children:"tagsBasePath"})}),(0,r.jsx)(n.td,{children:(0,r.jsx)(n.code,{children:"string"})}),(0,r.jsx)(n.td,{children:(0,r.jsx)(n.code,{children:"'tags'"})}),(0,r.jsxs)(n.td,{children:["URL route for the tags section of your blog. Will be appended to ",(0,r.jsx)(n.code,{children:"routeBasePath"}),"."]})]}),(0,r.jsxs)(n.tr,{children:[(0,r.jsx)(n.td,{children:(0,r.jsx)(n.code,{children:"pageBasePath"})}),(0,r.jsx)(n.td,{children:(0,r.jsx)(n.code,{children:"string"})}),(0,r.jsx)(n.td,{children:(0,r.jsx)(n.code,{children:"'page'"})}),(0,r.jsxs)(n.td,{children:["URL route for the pages section of your blog. Will be appended to ",(0,r.jsx)(n.code,{children:"routeBasePath"}),"."]})]}),(0,r.jsxs)(n.tr,{children:[(0,r.jsx)(n.td,{children:(0,r.jsx)(n.code,{children:"archiveBasePath"})}),(0,r.jsx)(n.td,{children:(0,r.jsx)("code",{children:"string | null"})}),(0,r.jsx)(n.td,{children:(0,r.jsx)(n.code,{children:"'archive'"})}),(0,r.jsxs)(n.td,{children:["URL route for the archive section of your blog. Will be appended to ",(0,r.jsx)(n.code,{children:"routeBasePath"}),". ",(0,r.jsx)(n.strong,{children:"DO NOT"})," include a trailing slash. Use ",(0,r.jsx)(n.code,{children:"null"})," to disable generation of archive."]})]}),(0,r.jsxs)(n.tr,{children:[(0,r.jsx)(n.td,{children:(0,r.jsx)(n.code,{children:"authorsBasePath"})}),(0,r.jsx)(n.td,{children:(0,r.jsx)(n.code,{children:"string"})}),(0,r.jsx)(n.td,{children:(0,r.jsx)(n.code,{children:"'authors'"})}),(0,r.jsxs)(n.td,{children:["URL route for the authors pages of your blog. Will be appended to ",(0,r.jsx)(n.code,{children:"path"}),"."]})]}),(0,r.jsxs)(n.tr,{children:[(0,r.jsx)(n.td,{children:(0,r.jsx)(n.code,{children:"include"})}),(0,r.jsx)(n.td,{children:(0,r.jsx)(n.code,{children:"string[]"})}),(0,r.jsx)(n.td,{children:(0,r.jsx)(n.code,{children:"['**/*.{md,mdx}']"})}),(0,r.jsx)(n.td,{children:"Array of glob patterns matching Markdown files to be built, relative to the content path."})]}),(0,r.jsxs)(n.tr,{children:[(0,r.jsx)(n.td,{children:(0,r.jsx)(n.code,{children:"exclude"})}),(0,r.jsx)(n.td,{children:(0,r.jsx)(n.code,{children:"string[]"})}),(0,r.jsx)(n.td,{children:(0,r.jsx)(n.em,{children:"See example configuration"})}),(0,r.jsxs)(n.td,{children:["Array of glob patterns matching Markdown files to be excluded. Serves as refinement based on the ",(0,r.jsx)(n.code,{children:"include"})," option."]})]}),(0,r.jsxs)(n.tr,{children:[(0,r.jsx)(n.td,{children:(0,r.jsx)(n.code,{children:"postsPerPage"})}),(0,r.jsx)(n.td,{children:(0,r.jsx)("code",{children:"number | 'ALL'"})}),(0,r.jsx)(n.td,{children:(0,r.jsx)(n.code,{children:"10"})}),(0,r.jsxs)(n.td,{children:["Number of posts to show per page in the listing page. Use ",(0,r.jsx)(n.code,{children:"'ALL'"})," to display all posts on one listing page."]})]}),(0,r.jsxs)(n.tr,{children:[(0,r.jsx)(n.td,{children:(0,r.jsx)(n.code,{children:"blogListComponent"})}),(0,r.jsx)(n.td,{children:(0,r.jsx)(n.code,{children:"string"})}),(0,r.jsx)(n.td,{children:(0,r.jsx)(n.code,{children:"'@theme/BlogListPage'"})}),(0,r.jsx)(n.td,{children:"Root component of the blog listing page."})]}),(0,r.jsxs)(n.tr,{children:[(0,r.jsx)(n.td,{children:(0,r.jsx)(n.code,{children:"blogPostComponent"})}),(0,r.jsx)(n.td,{children:(0,r.jsx)(n.code,{children:"string"})}),(0,r.jsx)(n.td,{children:(0,r.jsx)(n.code,{children:"'@theme/BlogPostPage'"})}),(0,r.jsx)(n.td,{children:"Root component of each blog post page."})]}),(0,r.jsxs)(n.tr,{children:[(0,r.jsx)(n.td,{children:(0,r.jsx)(n.code,{children:"blogTagsListComponent"})}),(0,r.jsx)(n.td,{children:(0,r.jsx)(n.code,{children:"string"})}),(0,r.jsx)(n.td,{children:(0,r.jsx)(n.code,{children:"'@theme/BlogTagsListPage'"})}),(0,r.jsx)(n.td,{children:"Root component of the tags list page."})]}),(0,r.jsxs)(n.tr,{children:[(0,r.jsx)(n.td,{children:(0,r.jsx)(n.code,{children:"blogTagsPostsComponent"})}),(0,r.jsx)(n.td,{children:(0,r.jsx)(n.code,{children:"string"})}),(0,r.jsx)(n.td,{children:(0,r.jsx)(n.code,{children:"'@theme/BlogTagsPostsPage'"})}),(0,r.jsx)(n.td,{children:'Root component of the "posts containing tag" page.'})]}),(0,r.jsxs)(n.tr,{children:[(0,r.jsx)(n.td,{children:(0,r.jsx)(n.code,{children:"blogArchiveComponent"})}),(0,r.jsx)(n.td,{children:(0,r.jsx)(n.code,{children:"string"})}),(0,r.jsx)(n.td,{children:(0,r.jsx)(n.code,{children:"'@theme/BlogArchivePage'"})}),(0,r.jsx)(n.td,{children:"Root component of the blog archive page."})]}),(0,r.jsxs)(n.tr,{children:[(0,r.jsx)(n.td,{children:(0,r.jsx)(n.code,{children:"blogAuthorsPostsComponent"})}),(0,r.jsx)(n.td,{children:(0,r.jsx)(n.code,{children:"string"})}),(0,r.jsx)(n.td,{children:(0,r.jsx)(n.code,{children:"'@theme/Blog/Pages/BlogAuthorsPostsPage'"})}),(0,r.jsx)(n.td,{children:"Root component of the blog author page."})]}),(0,r.jsxs)(n.tr,{children:[(0,r.jsx)(n.td,{children:(0,r.jsx)(n.code,{children:"blogAuthorsListComponent"})}),(0,r.jsx)(n.td,{children:(0,r.jsx)(n.code,{children:"string"})}),(0,r.jsx)(n.td,{children:(0,r.jsx)(n.code,{children:"'@theme/Blog/Pages/BlogAuthorsListPage'"})}),(0,r.jsx)(n.td,{children:"Root component of the blog authors page index."})]}),(0,r.jsxs)(n.tr,{children:[(0,r.jsx)(n.td,{children:(0,r.jsx)(n.code,{children:"remarkPlugins"})}),(0,r.jsx)(n.td,{children:(0,r.jsx)(n.code,{children:"any[]"})}),(0,r.jsx)(n.td,{children:(0,r.jsx)(n.code,{children:"[]"})}),(0,r.jsx)(n.td,{children:"Remark plugins passed to MDX."})]}),(0,r.jsxs)(n.tr,{children:[(0,r.jsx)(n.td,{children:(0,r.jsx)(n.code,{children:"rehypePlugins"})}),(0,r.jsx)(n.td,{children:(0,r.jsx)(n.code,{children:"any[]"})}),(0,r.jsx)(n.td,{children:(0,r.jsx)(n.code,{children:"[]"})}),(0,r.jsx)(n.td,{children:"Rehype plugins passed to MDX."})]}),(0,r.jsxs)(n.tr,{children:[(0,r.jsx)(n.td,{children:(0,r.jsx)(n.code,{children:"rehypePlugins"})}),(0,r.jsx)(n.td,{children:(0,r.jsx)(n.code,{children:"any[]"})}),(0,r.jsx)(n.td,{children:(0,r.jsx)(n.code,{children:"[]"})}),(0,r.jsx)(n.td,{children:"Recma plugins passed to MDX."})]}),(0,r.jsxs)(n.tr,{children:[(0,r.jsx)(n.td,{children:(0,r.jsx)(n.code,{children:"beforeDefaultRemarkPlugins"})}),(0,r.jsx)(n.td,{children:(0,r.jsx)(n.code,{children:"any[]"})}),(0,r.jsx)(n.td,{children:(0,r.jsx)(n.code,{children:"[]"})}),(0,r.jsx)(n.td,{children:"Custom Remark plugins passed to MDX before the default Docusaurus Remark plugins."})]}),(0,r.jsxs)(n.tr,{children:[(0,r.jsx)(n.td,{children:(0,r.jsx)(n.code,{children:"beforeDefaultRehypePlugins"})}),(0,r.jsx)(n.td,{children:(0,r.jsx)(n.code,{children:"any[]"})}),(0,r.jsx)(n.td,{children:(0,r.jsx)(n.code,{children:"[]"})}),(0,r.jsx)(n.td,{children:"Custom Rehype plugins passed to MDX before the default Docusaurus Rehype plugins."})]}),(0,r.jsxs)(n.tr,{children:[(0,r.jsx)(n.td,{children:(0,r.jsx)(n.code,{children:"truncateMarker"})}),(0,r.jsx)(n.td,{children:(0,r.jsx)(n.code,{children:"RegExp"})}),(0,r.jsxs)(n.td,{children:[(0,r.jsx)(n.code,{children:"/\x3c!--\\s*truncate\\s*--\x3e/"})," | ",(0,r.jsx)(n.code,{children:"\\{\\/\\*\\s*truncate\\s*\\*\\/\\}/"})]}),(0,r.jsx)(n.td,{children:"Truncate marker marking where the summary ends."})]}),(0,r.jsxs)(n.tr,{children:[(0,r.jsx)(n.td,{children:(0,r.jsx)(n.code,{children:"showReadingTime"})}),(0,r.jsx)(n.td,{children:(0,r.jsx)(n.code,{children:"boolean"})}),(0,r.jsx)(n.td,{children:(0,r.jsx)(n.code,{children:"true"})}),(0,r.jsx)(n.td,{children:"Show estimated reading time for the blog post."})]}),(0,r.jsxs)(n.tr,{children:[(0,r.jsx)(n.td,{children:(0,r.jsx)(n.code,{children:"readingTime"})}),(0,r.jsx)(n.td,{children:(0,r.jsx)(n.code,{children:"ReadingTimeFn"})}),(0,r.jsx)(n.td,{children:"The default reading time"}),(0,r.jsx)(n.td,{children:"A callback to customize the reading time number displayed."})]}),(0,r.jsxs)(n.tr,{children:[(0,r.jsx)(n.td,{children:(0,r.jsx)(n.code,{children:"authorsMapPath"})}),(0,r.jsx)(n.td,{children:(0,r.jsx)(n.code,{children:"string"})}),(0,r.jsx)(n.td,{children:(0,r.jsx)(n.code,{children:"'authors.yml'"})}),(0,r.jsx)(n.td,{children:"Path to the authors map file, relative to the blog content directory."})]}),(0,r.jsxs)(n.tr,{children:[(0,r.jsx)(n.td,{children:(0,r.jsx)(n.code,{children:"feedOptions"})}),(0,r.jsx)(n.td,{children:(0,r.jsx)(n.em,{children:"See below"})}),(0,r.jsx)(n.td,{children:(0,r.jsx)(n.code,{children:"{type: ['rss', 'atom']}"})}),(0,r.jsx)(n.td,{children:"Blog feed."})]}),(0,r.jsxs)(n.tr,{children:[(0,r.jsx)(n.td,{children:(0,r.jsx)(n.code,{children:"feedOptions.type"})}),(0,r.jsx)(n.td,{children:(0,r.jsxs)("code",{children:[(0,r.jsx)(n.a,{href:"#FeedType",children:"FeedType"})," | ",(0,r.jsx)(n.a,{href:"#FeedType",children:"FeedType"}),"[] | 'all' | null"]})}),(0,r.jsx)(n.td,{children:(0,r.jsx)(n.strong,{children:"Required"})}),(0,r.jsxs)(n.td,{children:["Type of feed to be generated. Use ",(0,r.jsx)(n.code,{children:"null"})," to disable generation."]})]}),(0,r.jsxs)(n.tr,{children:[(0,r.jsx)(n.td,{children:(0,r.jsx)(n.code,{children:"feedOptions.createFeedItems"})}),(0,r.jsx)(n.td,{children:(0,r.jsxs)("code",{children:[(0,r.jsx)(n.a,{href:"#CreateFeedItemsFn",children:"CreateFeedItemsFn"})," | undefined"]})}),(0,r.jsx)(n.td,{children:(0,r.jsx)(n.code,{children:"undefined"})}),(0,r.jsx)(n.td,{children:"An optional function which can be used to transform and / or filter the items in the feed."})]}),(0,r.jsxs)(n.tr,{children:[(0,r.jsx)(n.td,{children:(0,r.jsx)(n.code,{children:"feedOptions.limit"})}),(0,r.jsx)(n.td,{children:(0,r.jsx)(n.code,{children:"number | null | false"})}),(0,r.jsx)(n.td,{children:(0,r.jsx)(n.code,{children:"20"})}),(0,r.jsxs)(n.td,{children:["Limits the feed to the specified number of posts, ",(0,r.jsx)(n.code,{children:"false"})," or ",(0,r.jsx)(n.code,{children:"null"})," for all entries. Defaults to ",(0,r.jsx)(n.code,{children:"20"}),"."]})]}),(0,r.jsxs)(n.tr,{children:[(0,r.jsx)(n.td,{children:(0,r.jsx)(n.code,{children:"feedOptions.title"})}),(0,r.jsx)(n.td,{children:(0,r.jsx)(n.code,{children:"string"})}),(0,r.jsx)(n.td,{children:(0,r.jsx)(n.code,{children:"siteConfig.title"})}),(0,r.jsx)(n.td,{children:"Title of the feed."})]}),(0,r.jsxs)(n.tr,{children:[(0,r.jsx)(n.td,{children:(0,r.jsx)(n.code,{children:"feedOptions.description"})}),(0,r.jsx)(n.td,{children:(0,r.jsx)(n.code,{children:"string"})}),(0,r.jsx)(n.td,{children:(0,r.jsx)("code",{children:"`${siteConfig.title} Blog`"})}),(0,r.jsx)(n.td,{children:"Description of the feed."})]}),(0,r.jsxs)(n.tr,{children:[(0,r.jsx)(n.td,{children:(0,r.jsx)(n.code,{children:"feedOptions.copyright"})}),(0,r.jsx)(n.td,{children:(0,r.jsx)(n.code,{children:"string"})}),(0,r.jsx)(n.td,{children:(0,r.jsx)(n.code,{children:"undefined"})}),(0,r.jsx)(n.td,{children:"Copyright message."})]}),(0,r.jsxs)(n.tr,{children:[(0,r.jsx)(n.td,{children:(0,r.jsx)(n.code,{children:"feedOptions.xslt"})}),(0,r.jsx)(n.td,{children:(0,r.jsxs)("code",{children:["boolean | ",(0,r.jsx)(n.a,{href:"#FeedXSLTOptions",children:"FeedXSLTOptions"})]})}),(0,r.jsx)(n.td,{children:(0,r.jsx)(n.code,{children:"undefined"})}),(0,r.jsx)(n.td,{children:"Permits to style the blog XML feeds with XSLT so that browsers render them nicely."})]}),(0,r.jsxs)(n.tr,{children:[(0,r.jsx)(n.td,{children:(0,r.jsx)(n.code,{children:"feedOptions.language"})}),(0,r.jsxs)(n.td,{children:[(0,r.jsx)(n.code,{children:"string"})," (See ",(0,r.jsx)(n.a,{href:"http://www.w3.org/TR/REC-html40/struct/dirlang.html#langcodes",children:"documentation"})," for possible values)"]}),(0,r.jsx)(n.td,{children:(0,r.jsx)(n.code,{children:"undefined"})}),(0,r.jsx)(n.td,{children:"Language metadata of the feed."})]}),(0,r.jsxs)(n.tr,{children:[(0,r.jsx)(n.td,{children:(0,r.jsx)(n.code,{children:"sortPosts"})}),(0,r.jsx)(n.td,{children:(0,r.jsx)("code",{children:"'descending' | 'ascending' "})}),(0,r.jsx)(n.td,{children:(0,r.jsx)(n.code,{children:"'descending'"})}),(0,r.jsx)(n.td,{children:"Governs the direction of blog post sorting."})]}),(0,r.jsxs)(n.tr,{children:[(0,r.jsx)(n.td,{children:(0,r.jsx)(n.code,{children:"processBlogPosts"})}),(0,r.jsx)(n.td,{children:(0,r.jsx)("code",{children:(0,r.jsx)(n.a,{href:"#ProcessBlogPostsFn",children:"ProcessBlogPostsFn"})})}),(0,r.jsx)(n.td,{children:(0,r.jsx)(n.code,{children:"undefined"})}),(0,r.jsx)(n.td,{children:"An optional function which can be used to transform blog posts (filter, modify, delete, etc...)."})]}),(0,r.jsxs)(n.tr,{children:[(0,r.jsx)(n.td,{children:(0,r.jsx)(n.code,{children:"showLastUpdateAuthor"})}),(0,r.jsx)(n.td,{children:(0,r.jsx)(n.code,{children:"boolean"})}),(0,r.jsx)(n.td,{children:(0,r.jsx)(n.code,{children:"false"})}),(0,r.jsx)(n.td,{children:"Whether to display the author who last updated the blog post."})]}),(0,r.jsxs)(n.tr,{children:[(0,r.jsx)(n.td,{children:(0,r.jsx)(n.code,{children:"showLastUpdateTime"})}),(0,r.jsx)(n.td,{children:(0,r.jsx)(n.code,{children:"boolean"})}),(0,r.jsx)(n.td,{children:(0,r.jsx)(n.code,{children:"false"})}),(0,r.jsxs)(n.td,{children:["Whether to display the last date the blog 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,r.jsx)(n.code,{children:"actions/checkout"}),", use",(0,r.jsx)(n.code,{children:"fetch-depth: 0"}),"."]})]}),(0,r.jsxs)(n.tr,{children:[(0,r.jsx)(n.td,{children:(0,r.jsx)(n.code,{children:"tags"})}),(0,r.jsx)(n.td,{children:(0,r.jsx)(n.code,{children:"string | false | null | undefined"})}),(0,r.jsx)(n.td,{children:(0,r.jsx)(n.code,{children:"tags.yml"})}),(0,r.jsx)(n.td,{children:"Path to the YAML tags file listing pre-defined tags. Relative to the blog content directory."})]}),(0,r.jsxs)(n.tr,{children:[(0,r.jsx)(n.td,{children:(0,r.jsx)(n.code,{children:"onInlineTags"})}),(0,r.jsx)(n.td,{children:(0,r.jsx)(n.code,{children:"'ignore' | 'log' | 'warn' | 'throw'"})}),(0,r.jsx)(n.td,{children:(0,r.jsx)(n.code,{children:"warn"})}),(0,r.jsxs)(n.td,{children:["The plugin behavior when blog posts contain inline tags (not appearing in the list of pre-defined tags, usually ",(0,r.jsx)(n.code,{children:"tags.yml"}),")."]})]}),(0,r.jsxs)(n.tr,{children:[(0,r.jsx)(n.td,{children:(0,r.jsx)(n.code,{children:"onUntruncatedBlogPosts"})}),(0,r.jsx)(n.td,{children:(0,r.jsx)(n.code,{children:"'ignore' | 'log' | 'warn' | 'throw'"})}),(0,r.jsx)(n.td,{children:(0,r.jsx)(n.code,{children:"warn"})}),(0,r.jsx)(n.td,{children:"The plugin behavior when blog posts do not contain a truncate marker."})]})]})]})}),"\n",(0,r.jsx)(n.h3,{id:"types",children:"Types"}),"\n",(0,r.jsx)(n.h4,{id:"EditUrlFn",children:(0,r.jsx)(n.code,{children:"EditUrlFn"})}),"\n",(0,r.jsx)(n.pre,{children:(0,r.jsx)(n.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,r.jsx)(n.h4,{id:"ReadingTimeFn",children:(0,r.jsx)(n.code,{children:"ReadingTimeFn"})}),"\n",(0,r.jsx)(n.pre,{children:(0,r.jsx)(n.code,{className:"language-ts",children:"type ReadingTimeOptions = {\n wordsPerMinute: number;\n wordBound: (char: string) => boolean;\n};\n\ntype ReadingTimeCalculator = (params: {\n content: string;\n frontMatter?: BlogPostFrontMatter & Record<string, unknown>;\n options?: ReadingTimeOptions;\n}) => number;\n\ntype ReadingTimeFn = (params: {\n content: string;\n frontMatter: BlogPostFrontMatter & Record<string, unknown>;\n defaultReadingTime: ReadingTimeCalculator;\n}) => number | undefined;\n"})}),"\n",(0,r.jsx)(n.h4,{id:"FeedType",children:(0,r.jsx)(n.code,{children:"FeedType"})}),"\n",(0,r.jsx)(n.pre,{children:(0,r.jsx)(n.code,{className:"language-ts",children:"type FeedType = 'rss' | 'atom' | 'json';\n"})}),"\n",(0,r.jsx)(n.h4,{id:"FeedXSLTOptions",children:(0,r.jsx)(n.code,{children:"FeedXSLTOptions"})}),"\n",(0,r.jsxs)(n.p,{children:["Permits to style the blog XML feeds so that browsers render them nicely with ",(0,r.jsx)(n.a,{href:"https://developer.mozilla.org/en-US/docs/Web/XSLT",children:"XSLT"}),"."]}),"\n",(0,r.jsxs)(n.ul,{children:["\n",(0,r.jsxs)(n.li,{children:["Use ",(0,r.jsx)(n.code,{children:"true"})," to let the blog use its built-in ",(0,r.jsx)(n.code,{children:".xsl"})," and ",(0,r.jsx)(n.code,{children:".css"})," files to style the blog feed"]}),"\n",(0,r.jsxs)(n.li,{children:["Use a falsy value (",(0,r.jsx)(n.code,{children:"undefined | null | false"}),") to disable the feature"]}),"\n",(0,r.jsxs)(n.li,{children:["Use a ",(0,r.jsx)(n.code,{children:"string"})," to provide a file path to a custom ",(0,r.jsx)(n.code,{children:".xsl"})," file relative to the blog content folder. By convention, you must provide a ",(0,r.jsx)(n.code,{children:".css"})," file with the exact same name."]}),"\n"]}),"\n",(0,r.jsx)(n.pre,{children:(0,r.jsx)(n.code,{className:"language-ts",children:"type FeedXSLTOptions =\n | boolean\n | undefined\n | null\n | {\n rss?: string | boolean | null | undefined;\n atom?: string | boolean | null | undefined;\n };\n"})}),"\n",(0,r.jsx)(n.h4,{id:"CreateFeedItemsFn",children:(0,r.jsx)(n.code,{children:"CreateFeedItemsFn"})}),"\n",(0,r.jsx)(n.pre,{children:(0,r.jsx)(n.code,{className:"language-ts",children:"type CreateFeedItemsFn = (params: {\n blogPosts: BlogPost[];\n siteConfig: DocusaurusConfig;\n outDir: string;\n defaultCreateFeedItemsFn: CreateFeedItemsFn;\n}) => Promise<BlogFeedItem[]>;\n"})}),"\n",(0,r.jsx)(n.h4,{id:"ProcessBlogPostsFn",children:(0,r.jsx)(n.code,{children:"ProcessBlogPostsFn"})}),"\n",(0,r.jsx)(n.pre,{children:(0,r.jsx)(n.code,{className:"language-ts",children:"type ProcessBlogPostsFn = (params: {\n blogPosts: BlogPost[];\n}) => Promise<void | BlogPost[]>;\n"})}),"\n",(0,r.jsx)(n.h3,{id:"ex-config",children:"Example configuration"}),"\n",(0,r.jsx)(n.p,{children:"You can configure this plugin through preset options or plugin options."}),"\n",(0,r.jsx)(n.admonition,{type:"tip",children:(0,r.jsx)(n.p,{children:"Most Docusaurus users configure this plugin through the preset options."})}),"\n","\n",(0,r.jsx)(c.Z,{pluginName:"@docusaurus/plugin-content-blog",presetOptionName:"blog",code:"{\n path: 'blog',\n // Simple use-case: string editUrl\n // editUrl: 'https://github.com/facebook/docusaurus/edit/main/website/',\n // Advanced use-case: functional editUrl\n editUrl: ({locale, blogDirPath, blogPath, permalink}) =>\n `https://github.com/facebook/docusaurus/edit/main/website/${blogDirPath}/${blogPath}`,\n editLocalizedFiles: false,\n blogTitle: 'Blog title',\n blogDescription: 'Blog',\n blogSidebarCount: 5,\n blogSidebarTitle: 'All our posts',\n routeBasePath: 'blog',\n include: ['**/*.{md,mdx}'],\n exclude: [\n '**/_*.{js,jsx,ts,tsx,md,mdx}',\n '**/_*/**',\n '**/*.test.{js,jsx,ts,tsx}',\n '**/__tests__/**',\n ],\n postsPerPage: 10,\n blogListComponent: '@theme/BlogListPage',\n blogPostComponent: '@theme/BlogPostPage',\n blogTagsListComponent: '@theme/BlogTagsListPage',\n blogTagsPostsComponent: '@theme/BlogTagsPostsPage',\n remarkPlugins: [require('./my-remark-plugin')],\n rehypePlugins: [],\n beforeDefaultRemarkPlugins: [],\n beforeDefaultRehypePlugins: [],\n truncateMarker: /\x3c!--\\s*(truncate)\\s*--\x3e/,\n showReadingTime: true,\n feedOptions: {\n type: '',\n title: '',\n description: '',\n copyright: '',\n language: undefined,\n createFeedItems: async (params) => {\n const {blogPosts, defaultCreateFeedItems, ...rest} = params;\n return defaultCreateFeedItems({\n // keep only the 10 most recent blog posts in the feed\n blogPosts: blogPosts.filter((item, index) => index < 10),\n ...rest,\n });\n },\n },\n}"}),"\n",(0,r.jsx)(n.h2,{id:"markdown-front-matter",children:"Markdown front matter"}),"\n",(0,r.jsxs)(n.p,{children:["Markdown documents can use the following Markdown ",(0,r.jsx)(n.a,{href:"/docs/markdown-features#front-matter",children:"front matter"})," metadata fields, enclosed by a line ",(0,r.jsx)(n.code,{children:"---"})," on either side."]}),"\n",(0,r.jsx)(n.p,{children:"Accepted fields:"}),"\n",(0,r.jsx)(o.Z,{children:(0,r.jsxs)(n.table,{children:[(0,r.jsx)(n.thead,{children:(0,r.jsxs)(n.tr,{children:[(0,r.jsx)(n.th,{children:"Name"}),(0,r.jsx)(n.th,{children:"Type"}),(0,r.jsx)(n.th,{children:"Default"}),(0,r.jsx)(n.th,{children:"Description"})]})}),(0,r.jsxs)(n.tbody,{children:[(0,r.jsxs)(n.tr,{children:[(0,r.jsx)(n.td,{children:(0,r.jsx)(n.code,{children:"authors"})}),(0,r.jsx)(n.td,{children:(0,r.jsx)(n.code,{children:"Authors"})}),(0,r.jsx)(n.td,{children:(0,r.jsx)(n.code,{children:"undefined"})}),(0,r.jsxs)(n.td,{children:["List of blog post authors (or unique author). Read the ",(0,r.jsxs)(n.a,{href:"/docs/blog#blog-post-authors",children:[(0,r.jsx)(n.code,{children:"authors"})," guide"]})," for more explanations. Prefer ",(0,r.jsx)(n.code,{children:"authors"})," over the ",(0,r.jsx)(n.code,{children:"author_*"})," front matter fields, even for single author blog posts."]})]}),(0,r.jsxs)(n.tr,{children:[(0,r.jsx)(n.td,{children:(0,r.jsx)(n.code,{children:"author"})}),(0,r.jsx)(n.td,{children:(0,r.jsx)(n.code,{children:"string"})}),(0,r.jsx)(n.td,{children:(0,r.jsx)(n.code,{children:"undefined"})}),(0,r.jsxs)(n.td,{children:["\u26A0\uFE0F Prefer using ",(0,r.jsx)(n.code,{children:"authors"}),". The blog post author's name."]})]}),(0,r.jsxs)(n.tr,{children:[(0,r.jsx)(n.td,{children:(0,r.jsx)(n.code,{children:"author_url"})}),(0,r.jsx)(n.td,{children:(0,r.jsx)(n.code,{children:"string"})}),(0,r.jsx)(n.td,{children:(0,r.jsx)(n.code,{children:"undefined"})}),(0,r.jsxs)(n.td,{children:["\u26A0\uFE0F Prefer using ",(0,r.jsx)(n.code,{children:"authors"}),". The URL that the author's name will be linked to. This could be a GitHub, X, Facebook profile URL, etc."]})]}),(0,r.jsxs)(n.tr,{children:[(0,r.jsx)(n.td,{children:(0,r.jsx)(n.code,{children:"author_image_url"})}),(0,r.jsx)(n.td,{children:(0,r.jsx)(n.code,{children:"string"})}),(0,r.jsx)(n.td,{children:(0,r.jsx)(n.code,{children:"undefined"})}),(0,r.jsxs)(n.td,{children:["\u26A0\uFE0F Prefer using ",(0,r.jsx)(n.code,{children:"authors"}),". The URL to the author's thumbnail image."]})]}),(0,r.jsxs)(n.tr,{children:[(0,r.jsx)(n.td,{children:(0,r.jsx)(n.code,{children:"author_title"})}),(0,r.jsx)(n.td,{children:(0,r.jsx)(n.code,{children:"string"})}),(0,r.jsx)(n.td,{children:(0,r.jsx)(n.code,{children:"undefined"})}),(0,r.jsxs)(n.td,{children:["\u26A0\uFE0F Prefer using ",(0,r.jsx)(n.code,{children:"authors"}),". A description of the author."]})]}),(0,r.jsxs)(n.tr,{children:[(0,r.jsx)(n.td,{children:(0,r.jsx)(n.code,{children:"title"})}),(0,r.jsx)(n.td,{children:(0,r.jsx)(n.code,{children:"string"})}),(0,r.jsx)(n.td,{children:"Markdown title"}),(0,r.jsx)(n.td,{children:"The blog post title."})]}),(0,r.jsxs)(n.tr,{children:[(0,r.jsx)(n.td,{children:(0,r.jsx)(n.code,{children:"sidebar_label"})}),(0,r.jsx)(n.td,{children:(0,r.jsx)(n.code,{children:"string"})}),(0,r.jsx)(n.td,{children:(0,r.jsx)(n.code,{children:"title"})}),(0,r.jsxs)(n.td,{children:["A custom label for the blog sidebar, replacing the default one (",(0,r.jsx)(n.code,{children:"title"}),")."]})]}),(0,r.jsxs)(n.tr,{children:[(0,r.jsx)(n.td,{children:(0,r.jsx)(n.code,{children:"date"})}),(0,r.jsx)(n.td,{children:(0,r.jsx)(n.code,{children:"string"})}),(0,r.jsx)(n.td,{children:"File name or file creation time"}),(0,r.jsxs)(n.td,{children:["The blog post creation date. If not specified, this can be extracted from the file or folder name, e.g, ",(0,r.jsx)(n.code,{children:"2021-04-15-blog-post.mdx"}),", ",(0,r.jsx)(n.code,{children:"2021-04-15-blog-post/index.mdx"}),", ",(0,r.jsx)(n.code,{children:"2021/04/15/blog-post.mdx"}),". Otherwise, it is the Markdown file creation time."]})]}),(0,r.jsxs)(n.tr,{children:[(0,r.jsx)(n.td,{children:(0,r.jsx)(n.code,{children:"tags"})}),(0,r.jsx)(n.td,{children:(0,r.jsx)(n.code,{children:"Tag[]"})}),(0,r.jsx)(n.td,{children:(0,r.jsx)(n.code,{children:"undefined"})}),(0,r.jsxs)(n.td,{children:["A list of strings or objects of two string fields ",(0,r.jsx)(n.code,{children:"label"})," and ",(0,r.jsx)(n.code,{children:"permalink"})," to tag to your post. Strings can be a reference to keys of a ",(0,r.jsx)(n.a,{href:"#tags-file",children:"tags file"})," (usually ",(0,r.jsx)(n.code,{children:"tags.yml"}),")"]})]}),(0,r.jsxs)(n.tr,{children:[(0,r.jsx)(n.td,{children:(0,r.jsx)(n.code,{children:"draft"})}),(0,r.jsx)(n.td,{children:(0,r.jsx)(n.code,{children:"boolean"})}),(0,r.jsx)(n.td,{children:(0,r.jsx)(n.code,{children:"false"})}),(0,r.jsx)(n.td,{children:"Draft blog posts will only be available during development."})]}),(0,r.jsxs)(n.tr,{children:[(0,r.jsx)(n.td,{children:(0,r.jsx)(n.code,{children:"unlisted"})}),(0,r.jsx)(n.td,{children:(0,r.jsx)(n.code,{children:"boolean"})}),(0,r.jsx)(n.td,{children:(0,r.jsx)(n.code,{children:"false"})}),(0,r.jsx)(n.td,{children:'Unlisted blog posts will be available in both development and production. They will be "hidden" in production, not indexed, excluded from sitemaps, and can only be accessed by users having a direct link.'})]}),(0,r.jsxs)(n.tr,{children:[(0,r.jsx)(n.td,{children:(0,r.jsx)(n.code,{children:"hide_table_of_contents"})}),(0,r.jsx)(n.td,{children:(0,r.jsx)(n.code,{children:"boolean"})}),(0,r.jsx)(n.td,{children:(0,r.jsx)(n.code,{children:"false"})}),(0,r.jsx)(n.td,{children:"Whether to hide the table of contents to the right."})]}),(0,r.jsxs)(n.tr,{children:[(0,r.jsx)(n.td,{children:(0,r.jsx)(n.code,{children:"toc_min_heading_level"})}),(0,r.jsx)(n.td,{children:(0,r.jsx)(n.code,{children:"number"})}),(0,r.jsx)(n.td,{children:(0,r.jsx)(n.code,{children:"2"})}),(0,r.jsx)(n.td,{children:"The minimum heading level shown in the table of contents. Must be between 2 and 6 and lower or equal to the max value."})]}),(0,r.jsxs)(n.tr,{children:[(0,r.jsx)(n.td,{children:(0,r.jsx)(n.code,{children:"toc_max_heading_level"})}),(0,r.jsx)(n.td,{children:(0,r.jsx)(n.code,{children:"number"})}),(0,r.jsx)(n.td,{children:(0,r.jsx)(n.code,{children:"3"})}),(0,r.jsx)(n.td,{children:"The max heading level shown in the table of contents. Must be between 2 and 6."})]}),(0,r.jsxs)(n.tr,{children:[(0,r.jsx)(n.td,{children:(0,r.jsx)(n.code,{children:"keywords"})}),(0,r.jsx)(n.td,{children:(0,r.jsx)(n.code,{children:"string[]"})}),(0,r.jsx)(n.td,{children:(0,r.jsx)(n.code,{children:"undefined"})}),(0,r.jsxs)(n.td,{children:["Keywords meta tag, which will become the ",(0,r.jsx)(n.code,{children:'<meta name="keywords" content="keyword1,keyword2,..."/>'})," in ",(0,r.jsx)(n.code,{children:"<head>"}),", used by search engines."]})]}),(0,r.jsxs)(n.tr,{children:[(0,r.jsx)(n.td,{children:(0,r.jsx)(n.code,{children:"description"})}),(0,r.jsx)(n.td,{children:(0,r.jsx)(n.code,{children:"string"})}),(0,r.jsx)(n.td,{children:"The first line of Markdown content"}),(0,r.jsxs)(n.td,{children:["The description of your document, which will become the ",(0,r.jsx)(n.code,{children:'<meta name="description" content="..."/>'})," and ",(0,r.jsx)(n.code,{children:'<meta property="og:description" content="..."/>'})," in ",(0,r.jsx)(n.code,{children:"<head>"}),", used by search engines."]})]}),(0,r.jsxs)(n.tr,{children:[(0,r.jsx)(n.td,{children:(0,r.jsx)(n.code,{children:"image"})}),(0,r.jsx)(n.td,{children:(0,r.jsx)(n.code,{children:"string"})}),(0,r.jsx)(n.td,{children:(0,r.jsx)(n.code,{children:"undefined"})}),(0,r.jsxs)(n.td,{children:["Cover or thumbnail image that will be used as the ",(0,r.jsx)(n.code,{children:'<meta property="og:image" content="..."/>'})," in the ",(0,r.jsx)(n.code,{children:"<head>"}),", enhancing link previews on social media and messaging platforms."]})]}),(0,r.jsxs)(n.tr,{children:[(0,r.jsx)(n.td,{children:(0,r.jsx)(n.code,{children:"slug"})}),(0,r.jsx)(n.td,{children:(0,r.jsx)(n.code,{children:"string"})}),(0,r.jsx)(n.td,{children:"File path"}),(0,r.jsxs)(n.td,{children:["Allows to customize the blog post URL (",(0,r.jsx)(n.code,{children:"/<routeBasePath>/<slug>"}),"). Support multiple patterns: ",(0,r.jsx)(n.code,{children:"slug: my-blog-post"}),", ",(0,r.jsx)(n.code,{children:"slug: /my/path/to/blog/post"}),", slug: ",(0,r.jsx)(n.code,{children:"/"}),"."]})]}),(0,r.jsxs)(n.tr,{children:[(0,r.jsx)(n.td,{children:(0,r.jsx)(n.code,{children:"last_update"})}),(0,r.jsx)(n.td,{children:(0,r.jsx)(n.code,{children:"FrontMatterLastUpdate"})}),(0,r.jsx)(n.td,{children:(0,r.jsx)(n.code,{children:"undefined"})}),(0,r.jsxs)(n.td,{children:["Allows overriding the last update author/date. Date can be any ",(0,r.jsx)(n.a,{href:"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/parse",children:"parsable date string"}),"."]})]})]})]})}),"\n",(0,r.jsx)(n.pre,{children:(0,r.jsx)(n.code,{className:"language-ts",children:'type FrontMatterLastUpdate = {date?: string; author?: string};\n\ntype Tag = string | {label: string; permalink: string};\n\n// An author key references an author from the global plugin authors.yml file\ntype AuthorKey = string;\n\n// Social platform name -> Social platform link\n// Example: {MyPlatform: \'https://myplatform.com/myusername\'}\n// Pre-defined platforms\n// ("x", "github", "twitter", "linkedin", "stackoverflow", "instagram", "bluesky", "mastodon", "threads", "twitch", "youtube") accept handles:\n// Example: {github: \'slorber\'}\ntype AuthorSocials = Record<string, string>;\n\ntype Author = {\n key?: AuthorKey;\n name: string;\n title?: string;\n url?: string;\n image_url?: string;\n socials?: AuthorSocials;\n};\n\n// The front matter authors field allows various possible shapes\ntype Authors = AuthorKey | Author | (AuthorKey | Author)[];\n'})}),"\n",(0,r.jsx)(n.p,{children:"Example:"}),"\n",(0,r.jsx)(n.pre,{children:(0,r.jsx)(n.code,{className:"language-md",children:"---\ntitle: Welcome Docusaurus\nauthors:\n - slorber\n - yangshun\n - name: Joel Marcey\n title: Co-creator of Docusaurus 1\n url: https://github.com/JoelMarcey\n image_url: https://github.com/JoelMarcey.png\n socials:\n x: joelmarcey\n github: JoelMarcey\ntags: [docusaurus]\ndescription: This is my first post on Docusaurus.\nimage: https://i.imgur.com/mErPwqL.png\nhide_table_of_contents: false\n---\n\nA Markdown blog post\n"})}),"\n","\n",(0,r.jsx)(a.ZP,{}),"\n",(0,r.jsx)(n.h2,{id:"authors-file",children:"Authors File"}),"\n",(0,r.jsxs)(n.p,{children:["Use the ",(0,r.jsxs)(n.a,{href:"#authors",children:[(0,r.jsx)(n.code,{children:"authors"})," plugin option"]})," to configure the path of a YAML authors file."]}),"\n",(0,r.jsxs)(n.p,{children:["By convention, the plugin will look for a ",(0,r.jsx)(n.code,{children:"authors.yml"})," file at the root of your blog content folder(s)."]}),"\n",(0,r.jsxs)(n.p,{children:["This file can contain a list of predefined ",(0,r.jsx)(n.a,{href:"/docs/blog#global-authors",children:"global blog authors"}),". You can reference these authors by their keys in Markdown files thanks to the ",(0,r.jsxs)(n.a,{href:"#markdown-front-matter",children:[(0,r.jsx)(n.code,{children:"authors"})," front matter"]}),"."]}),"\n",(0,r.jsx)(n.h3,{id:"authors-file-types",children:"Types"}),"\n",(0,r.jsx)(n.p,{children:"The YAML content of the provided authors file should respect the following shape:"}),"\n",(0,r.jsx)(n.pre,{children:(0,r.jsx)(n.code,{className:"language-tsx",children:"type AuthorsMapInput = {\n [authorKey: string]: AuthorInput;\n};\n\ntype AuthorInput = {\n name?: string;\n title?: string;\n description?: string;\n imageURL?: string;\n url?: string;\n email?: string;\n page?: boolean | {permalink: string};\n socials?: Record<string, string>;\n [customAuthorAttribute: string]: unknown;\n};\n"})}),"\n",(0,r.jsx)(n.h3,{id:"authors-file-example",children:"Example"}),"\n",(0,r.jsx)(n.pre,{children:(0,r.jsx)(n.code,{className:"language-yml",metastring:'title="tags.yml"',children:"slorber:\n name: S\xe9bastien Lorber\n title: Docusaurus maintainer\n url: https://sebastienlorber.com\n image_url: https://github.com/slorber.png\n page: true\n socials:\n x: sebastienlorber\n github: slorber\n\njmarcey:\n name: Joel Marcey\n title: Co-creator of Docusaurus 1\n url: https://github.com/JoelMarcey\n image_url: https://github.com/JoelMarcey.png\n email: jimarcey@gmail.com\n page:\n permalink: '/joel-marcey'\n socials:\n x: joelmarcey\n github: JoelMarcey\n"})}),"\n",(0,r.jsx)(n.pre,{children:(0,r.jsx)(n.code,{className:"language-md",metastring:'title="blog/my-blog-post.md"',children:"---\nauthors: [slorber, jmarcey]\n---\n\n# My Blog Post\n\nContent\n"})}),"\n",(0,r.jsx)(n.h2,{id:"i18n",children:"i18n"}),"\n",(0,r.jsxs)(n.p,{children:["Read the ",(0,r.jsx)(n.a,{href:"/docs/i18n/introduction",children:"i18n introduction"})," first."]}),"\n",(0,r.jsx)(n.h3,{id:"translation-files-location",children:"Translation files location"}),"\n",(0,r.jsxs)(n.ul,{children:["\n",(0,r.jsxs)(n.li,{children:[(0,r.jsx)(n.strong,{children:"Base path"}),": ",(0,r.jsx)(n.code,{children:"website/i18n/[locale]/docusaurus-plugin-content-blog"})]}),"\n",(0,r.jsxs)(n.li,{children:[(0,r.jsx)(n.strong,{children:"Multi-instance path"}),": ",(0,r.jsx)(n.code,{children:"website/i18n/[locale]/docusaurus-plugin-content-blog-[pluginId]"})]}),"\n",(0,r.jsxs)(n.li,{children:[(0,r.jsx)(n.strong,{children:"JSON files"}),": extracted with ",(0,r.jsx)(n.a,{href:"/docs/cli#docusaurus-write-translations-sitedir",children:(0,r.jsx)(n.code,{children:"docusaurus write-translations"})})]}),"\n",(0,r.jsxs)(n.li,{children:[(0,r.jsx)(n.strong,{children:"Markdown files"}),": ",(0,r.jsx)(n.code,{children:"website/i18n/[locale]/docusaurus-plugin-content-blog"})]}),"\n"]}),"\n",(0,r.jsx)(n.h3,{id:"example-file-system-structure",children:"Example file-system structure"}),"\n",(0,r.jsx)(n.pre,{children:(0,r.jsx)(n.code,{className:"language-bash",children:"website/i18n/[locale]/docusaurus-plugin-content-blog\n\u2502\n\u2502 # translations for website/blog\n\u251C\u2500\u2500 authors.yml\n\u251C\u2500\u2500 first-blog-post.md\n\u251C\u2500\u2500 second-blog-post.md\n\u2502\n\u2502 # translations for the plugin options that will be rendered\n\u2514\u2500\u2500 options.json\n"})})]})}function p(e={}){let{wrapper:n}={...(0,l.a)(),...e.components};return n?(0,r.jsx)(n,{...e,children:(0,r.jsx)(g,{...e})}):g(e)}},58636:function(e,n,t){t.d(n,{Z:()=>l});var s=t(85893);t(67294);var r=t(90496);function l(e){let{children:n,hidden:t,className:l}=e;return(0,s.jsx)("div",{role:"tabpanel",className:(0,r.Z)("tabItem_pnkT",l),hidden:t,children:n})}},15398:function(e,n,t){t.d(n,{Z:()=>f});var s=t(85893),r=t(67294),l=t(90496),i=t(54947),d=t(3620),o=t(844),c=t(97486),a=t(32263),h=t(16971);function u(e){return r.Children.toArray(e).filter(e=>"\n"!==e).map(e=>{if(!e||r.isValidElement(e)&&function(e){let{props:n}=e;return!!n&&"object"==typeof n&&"value"in n}(e))return e;throw Error(`Docusaurus error: Bad <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 x(e){let{value:n,tabValues:t}=e;return t.some(e=>e.value===n)}var j=t(71607);function g(e){let{className:n,block:t,selectedValue:r,selectValue:d,tabValues:o}=e,c=[],{blockElementScrollPositionUntilNextRender:a}=(0,i.o5)(),h=e=>{let n=e.currentTarget,t=o[c.indexOf(n)].value;t!==r&&(a(n),d(t))},u=e=>{let n=null;switch(e.key){case"Enter":h(e);break;case"ArrowRight":{let t=c.indexOf(e.currentTarget)+1;n=c[t]??c[0];break}case"ArrowLeft":{let t=c.indexOf(e.currentTarget)-1;n=c[t]??c[c.length-1]}}n?.focus()};return(0,s.jsx)("ul",{role:"tablist","aria-orientation":"horizontal",className:(0,l.Z)("tabs",{"tabs--block":t},n),children:o.map(e=>{let{value:n,label:t,attributes:i}=e;return(0,s.jsx)("li",{role:"tab",tabIndex:r===n?0:-1,"aria-selected":r===n,ref:e=>{c.push(e)},onKeyDown:u,onClick:h,...i,className:(0,l.Z)("tabs__item","tabItem_AQgk",i?.className,{"tabs__item--active":r===n}),children:t??n},n)})})}function p(e){let{lazy:n,children:t,selectedValue:i}=e,d=(Array.isArray(t)?t:[t]).filter(Boolean);if(n){let e=d.find(e=>e.props.value===i);return e?(0,r.cloneElement)(e,{className:(0,l.Z)("margin-top--md",e.props.className)}):null}return(0,s.jsx)("div",{className:"margin-top--md",children:d.map((e,n)=>(0,r.cloneElement)(e,{key:n,hidden:e.props.value!==i}))})}function m(e){let n=function(e){let{defaultValue:n,queryString:t=!1,groupId:s}=e,l=function(e){let{values:n,children:t}=e;return(0,r.useMemo)(()=>{let e=n??u(t).map(e=>{let{props:{value:n,label:t,attributes:s,default:r}}=e;return{value:n,label:t,attributes:s,default:r}});return!function(e){let n=(0,a.lx)(e,(e,n)=>e.value===n.value);if(n.length>0)throw Error(`Docusaurus error: Duplicate values "${n.map(e=>e.value).join(", ")}" found in <Tabs>. Every value needs to be unique.`)}(e),e},[n,t])}(e),[i,j]=(0,r.useState)(()=>(function(e){let{defaultValue:n,tabValues:t}=e;if(0===t.length)throw Error("Docusaurus error: the <Tabs> component requires at least one <TabItem> children component");if(n){if(!x({value:n,tabValues:t}))throw Error(`Docusaurus error: The <Tabs> has a defaultValue "${n}" but none of its children has the corresponding value. Available values are: ${t.map(e=>e.value).join(", ")}. If you intend to show no default tab, use defaultValue={null} instead.`);return n}let s=t.find(e=>e.default)??t[0];if(!s)throw Error("Unexpected error: 0 tabValues");return s.value})({defaultValue:n,tabValues:l})),[g,p]=function(e){let{queryString:n=!1,groupId:t}=e,s=(0,d.k6)(),l=function(e){let{queryString:n=!1,groupId:t}=e;if("string"==typeof n)return n;if(!1===n)return null;if(!0===n&&!t)throw Error('Docusaurus error: The <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:n,groupId:t});return[(0,c._X)(l),(0,r.useCallback)(e=>{if(!l)return;let n=new URLSearchParams(s.location.search);n.set(l,e),s.replace({...s.location,search:n.toString()})},[l,s])]}({queryString:t,groupId:s}),[m,f]=function(e){let{groupId:n}=e,t=n?`docusaurus.tab.${n}`:null,[s,l]=(0,h.Nk)(t);return[s,(0,r.useCallback)(e=>{t&&l.set(e)},[t,l])]}({groupId:s}),b=(()=>{let e=g??m;return x({value:e,tabValues:l})?e:null})();return(0,o.Z)(()=>{b&&j(b)},[b]),{selectedValue:i,selectValue:(0,r.useCallback)(e=>{if(!x({value:e,tabValues:l}))throw Error(`Can't select invalid tab value=${e}`);j(e),p(e),f(e)},[p,f,l]),tabValues:l}}(e);return(0,s.jsxs)("div",{className:(0,l.Z)("tabs-container","tabList_Qoir"),children:[(0,s.jsx)(g,{...n,...e}),(0,s.jsx)(p,{...n,...e})]})}function f(e){let n=(0,j.Z)();return(0,s.jsx)(m,{...e,children:u(e.children)},String(n))}},56497:function(e,n,t){t.d(n,{Z:()=>l});var s=t(85893);t(67294);var r=t(71607);function l(e){let{children:n,fallback:t}=e;return(0,r.Z)()?(0,s.jsx)(s.Fragment,{children:n?.()}):t??null}},32240:function(e,n,t){t.d(n,{Z:()=>o});var s=t(85893),r=t(67294),l=t(96700),i=t(3620);let d=r.forwardRef(function(e,n){let{name:t,children:d}=e,o=function(e){let n=e;for(;(0,r.isValidElement)(n);)[n]=r.Children.toArray(n.props.children);if("string"!=typeof n)throw Error(`Could not extract APITable row name from JSX tree:
|
|
${JSON.stringify(e,null,2)}`);return n}(d),c=t?`${t}-${o}`:o,a=`#${c}`,h=(0,i.k6)();return(0,l.Z)().collectAnchor(c),(0,s.jsx)("tr",{id:c,tabIndex:0,ref:h.location.hash===a?n:void 0,onClick:e=>{let n="TD"===e.target.tagName.toUpperCase(),t=!!window.getSelection()?.toString();n&&!t&&h.push(a)},onKeyDown:e=>{"Enter"===e.key&&h.push(a)},children:d.props.children})});function o(e){let{children:n,name:t}=e;if("table"!==n.type)throw Error("Bad usage of APITable component.\nIt is probably that your Markdown table is malformed.\nMake sure to double-check you have the appropriate number of columns for each table row.");let[l,i]=r.Children.toArray(n.props.children),o=(0,r.useRef)(null);(0,r.useEffect)(()=>{o.current?.focus()},[o]);let c=r.Children.map(i.props.children,e=>(0,s.jsx)(d,{name:t,ref:o,children:e}));return(0,s.jsxs)("table",{className:"apiTable_e8hp",children:[l,(0,s.jsx)("tbody",{children:c})]})}},66359:function(e,n,t){t.d(n,{Z:()=>h});var s=t(85893);t(67294);var r=t(35363),l=t(90158),i=t(77827),d=t(15398),o=t(58636),c=t(95998);let a=void 0;function h(e){let{code:n,pluginName:t,presetOptionName:h}=e,u=(0,l.zu)(a).path;return(0,s.jsxs)(d.Z,{groupId:"api-config-ex",children:[(0,s.jsxs)(o.Z,{value:"preset",label:(0,i.I)({message:"Preset options"}),children:[(0,s.jsx)("p",{children:(0,s.jsx)(i.Z,{id:"apiDocs.configTabs.presetOptions.description",values:{presetLink:(0,s.jsx)(r.Z,{to:`${u}/using-plugins#docusauruspreset-classic`,children:(0,s.jsx)(i.Z,{children:"preset options"})})},children:"If you use a preset, configure this plugin through the {presetLink}:"})}),(0,s.jsx)(c.Z,{language:"js",title:"docusaurus.config.js",children:`module.exports = {
|
|
presets: [
|
|
[
|
|
'@docusaurus/preset-classic',
|
|
{
|
|
// highlight-start
|
|
${h}: ${n.replace(/\n/g,"\n ")},
|
|
// highlight-end
|
|
},
|
|
],
|
|
],
|
|
};`})]}),(0,s.jsxs)(o.Z,{value:"plugin",label:(0,i.I)({message:"Plugin options"}),children:[(0,s.jsx)("p",{children:(0,s.jsx)(i.Z,{children:"If you are using a standalone plugin, provide options directly to the plugin:"})}),(0,s.jsx)(c.Z,{language:"js",title:"docusaurus.config.js",children:`module.exports = {
|
|
plugins: [
|
|
[
|
|
'${t}',
|
|
// highlight-start
|
|
${n.replace(/\n/g,"\n ")},
|
|
// highlight-end
|
|
],
|
|
],
|
|
};`})]})]})}},95998:function(e,n,t){t.d(n,{Z:()=>en});var s,r={};t.r(r),t.d(r,{ButtonExample:()=>P});var l=t(85893),i=t(67294),d=t(90496),o=t(71607),c=t(10075),a=t(77827),h=t(8156),u=t(56497),x=t(85108),j=t(45245),g=t(26378);function p(){let{prism:e}=(0,g.L)(),{colorMode:n}=(0,j.I)(),t=e.theme,s=e.darkTheme||t;return"dark"===n?s:t}var m=t(67490);function f(e){let{children:n}=e;return(0,l.jsx)("div",{className:(0,d.Z)("playgroundHeader_Tvsk"),children:n})}function b(){return(0,l.jsx)("div",{children:"Loading..."})}function y(){return(0,l.jsx)(u.Z,{fallback:(0,l.jsx)(b,{}),children:()=>(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)(m.Z,{fallback:e=>(0,l.jsx)(x.Ac,{...e}),children:(0,l.jsx)(c.i5,{})}),(0,l.jsx)(c.IF,{})]})})}function v(){return(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)(f,{children:(0,l.jsx)(a.Z,{id:"theme.Playground.result",description:"The result label of the live codeblocks",children:"Result"})}),(0,l.jsx)("div",{className:"playgroundPreview_mApW",children:(0,l.jsx)(y,{})})]})}function w(){let e=(0,o.Z)();return(0,l.jsx)(c.uz,{className:"playgroundEditor_TySg"},String(e))}function k(){return(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)(f,{children:(0,l.jsx)(a.Z,{id:"theme.Playground.liveEditor",description:"The live editor label of the live codeblocks",children:"Live Editor"})}),(0,l.jsx)(w,{})]})}let T=e=>`${e};`;function B(e){let{children:n,transformCode:t,...s}=e,{siteConfig:{themeConfig:r}}=(0,h.Z)(),{liveCodeBlock:{playgroundPosition:i}}=r,d=p(),o=s.metastring?.includes("noInline")??!1;return(0,l.jsx)("div",{className:"playgroundContainer_6Ior",children:(0,l.jsx)(c.nu,{code:n?.replace(/\n$/,""),noInline:o,transformCode:t??T,theme:d,...s,children:"top"===i?(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)(v,{}),(0,l.jsx)(k,{})]}):(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)(k,{}),(0,l.jsx)(v,{})]})})})}function P(e){return(0,l.jsx)("button",{type:"button",...e,style:{backgroundColor:"white",color:"black",border:"solid red",borderRadius:20,padding:10,cursor:"pointer",...e.style}})}let L={React:i,...i,...r};var C=t(55951),N=t(6324),F=t.n(N);let A=/title=(?<quote>["'])(?<title>.*?)\1/,R=/\{(?<range>[\d,-]+)\}/,I={js:{start:"\\/\\/",end:""},jsBlock:{start:"\\/\\*",end:"\\*\\/"},jsx:{start:"\\{\\s*\\/\\*",end:"\\*\\/\\s*\\}"},bash:{start:"#",end:""},html:{start:"\x3c!--",end:"--\x3e"}},E={...I,lua:{start:"--",end:""},wasm:{start:"\\;\\;",end:""},tex:{start:"%",end:""},vb:{start:"['\u2018\u2019]",end:""},vbnet:{start:"(?:_\\s*)?['\u2018\u2019]",end:""},rem:{start:"[Rr][Ee][Mm]\\b",end:""},f90:{start:"!",end:""},ml:{start:"\\(\\*",end:"\\*\\)"},cobol:{start:"\\*>",end:""}},_=Object.keys(I);function M(e,n){let t=e.map(e=>{let{start:t,end:s}=E[e];return`(?:${t}\\s*(${n.flatMap(e=>[e.line,e.block?.start,e.block?.end].filter(Boolean)).join("|")})\\s*${s})`}).join("|");return RegExp(`^\\s*(?:${t})\\s*$`)}function S(e){let{as:n,...t}=e,s=function(e){let n={color:"--prism-color",backgroundColor:"--prism-background-color"},t={};return Object.entries(e.plain).forEach(e=>{let[s,r]=e,l=n[s];l&&"string"==typeof r&&(t[l]=r)}),t}(p());return(0,l.jsx)(n,{...t,style:s,className:(0,d.Z)(t.className,"codeBlockContainer_jDV4",C.k.common.codeBlock)})}let U={codeBlockContent:"codeBlockContent_vx7S",codeBlockTitle:"codeBlockTitle_bdru",codeBlock:"codeBlock_Gebt",codeBlockStandalone:"codeBlockStandalone_i_cY",codeBlockLines:"codeBlockLines_FJaf",codeBlockLinesWithNumbering:"codeBlockLinesWithNumbering_FU9Q",buttonGroup:"buttonGroup_cUGO"};function Z(e){let{children:n,className:t}=e;return(0,l.jsx)(S,{as:"pre",tabIndex:0,className:(0,d.Z)(U.codeBlockStandalone,"thin-scrollbar",t),children:(0,l.jsx)("code",{className:U.codeBlockLines,children:n})})}var D=t(50923);let O={attributes:!0,characterData:!0,childList:!0,subtree:!0};var $=t(7316);let W={codeLine:"codeLine_qRmp",codeLineNumber:"codeLineNumber_dS_J",codeLineContent:"codeLineContent_XF5l"};function X(e){let{line:n,classNames:t,showLineNumbers:s,getLineProps:r,getTokenProps:i}=e;1===n.length&&"\n"===n[0].content&&(n[0].content="");let o=r({line:n,className:(0,d.Z)(t,s&&W.codeLine)}),c=n.map((e,n)=>(0,l.jsx)("span",{...i({token:e})},n));return(0,l.jsxs)("span",{...o,children:[s?(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)("span",{className:W.codeLineNumber}),(0,l.jsx)("span",{className:W.codeLineContent,children:c})]}):c,(0,l.jsx)("br",{})]})}var q=t(44771);function z(e){return(0,l.jsx)("svg",{viewBox:"0 0 24 24",...e,children:(0,l.jsx)("path",{fill:"currentColor",d:"M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"})})}function H(e){return(0,l.jsx)("svg",{viewBox:"0 0 24 24",...e,children:(0,l.jsx)("path",{fill:"currentColor",d:"M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"})})}let J={copyButtonCopied:"copyButtonCopied_OkN_",copyButtonIcons:"copyButtonIcons_OqsO",copyButtonIcon:"copyButtonIcon_PgCn",copyButtonSuccessIcon:"copyButtonSuccessIcon_bsQG"};function V(e){let{code:n,className:t}=e,[s,r]=(0,i.useState)(!1),o=(0,i.useRef)(void 0),c=(0,i.useCallback)(()=>{(0,q.Z)(n),r(!0),o.current=window.setTimeout(()=>{r(!1)},1e3)},[n]);return(0,i.useEffect)(()=>()=>window.clearTimeout(o.current),[]),(0,l.jsx)("button",{type:"button","aria-label":s?(0,a.I)({id:"theme.CodeBlock.copied",message:"Copied",description:"The copied button label on code blocks"}):(0,a.I)({id:"theme.CodeBlock.copyButtonAriaLabel",message:"Copy code to clipboard",description:"The ARIA label for copy code blocks button"}),title:(0,a.I)({id:"theme.CodeBlock.copy",message:"Copy",description:"The copy button label on code blocks"}),className:(0,d.Z)("clean-btn",t,J.copyButton,s&&J.copyButtonCopied),onClick:c,children:(0,l.jsxs)("span",{className:J.copyButtonIcons,"aria-hidden":"true",children:[(0,l.jsx)(z,{className:J.copyButtonIcon}),(0,l.jsx)(H,{className:J.copyButtonSuccessIcon})]})})}function Y(e){return(0,l.jsx)("svg",{viewBox:"0 0 24 24",...e,children:(0,l.jsx)("path",{fill:"currentColor",d:"M4 19h6v-2H4v2zM20 5H4v2h16V5zm-3 6H4v2h13.25c1.1 0 2 .9 2 2s-.9 2-2 2H15v-2l-3 3l3 3v-2h2c2.21 0 4-1.79 4-4s-1.79-4-4-4z"})})}let G={wordWrapButtonIcon:"wordWrapButtonIcon_MQXS",wordWrapButtonEnabled:"wordWrapButtonEnabled_TBIH"};function K(e){let{className:n,onClick:t,isEnabled:s}=e,r=(0,a.I)({id:"theme.CodeBlock.wordWrapToggle",message:"Toggle word wrap",description:"The title attribute for toggle word wrapping button of code block lines"});return(0,l.jsx)("button",{type:"button",onClick:t,className:(0,d.Z)("clean-btn",n,s&&G.wordWrapButtonEnabled),"aria-label":r,title:r,children:(0,l.jsx)(Y,{className:G.wordWrapButtonIcon,"aria-hidden":"true"})})}function Q(e){var n;let{children:t,className:s="",metastring:r,title:c,showLineNumbers:a,language:h}=e,{prism:{defaultLanguage:u,magicComments:x}}=(0,g.L)(),j=(n=h??function(e){let n=e.split(" ").find(e=>e.startsWith("language-"));return n?.replace(/language-/,"")}(s)??u,n?.toLowerCase()),m=p(),f=function(){let[e,n]=(0,i.useState)(!1),[t,s]=(0,i.useState)(!1),r=(0,i.useRef)(null),l=(0,i.useCallback)(()=>{let t=r.current.querySelector("code");e?t.removeAttribute("style"):(t.style.whiteSpace="pre-wrap",t.style.overflowWrap="anywhere"),n(e=>!e)},[r,e]),d=(0,i.useCallback)(()=>{let{scrollWidth:e,clientWidth:n}=r.current;s(e>n||r.current.querySelector("code").hasAttribute("style"))},[r]);return!function(e,n){let[t,s]=(0,i.useState)(),r=(0,i.useCallback)(()=>{s(e.current?.closest("[role=tabpanel][hidden]"))},[e,s]);(0,i.useEffect)(()=>{r()},[r]),function(e,n){let t=arguments.length>2&&void 0!==arguments[2]?arguments[2]:O,s=(0,D.zX)(n),r=(0,D.Ql)(t);(0,i.useEffect)(()=>{let n=new MutationObserver(s);return e&&n.observe(e,r),()=>n.disconnect()},[e,s,r])}(t,e=>{e.forEach(e=>{"attributes"===e.type&&"hidden"===e.attributeName&&(n(),r())})},{attributes:!0,characterData:!1,childList:!1,subtree:!1})}(r,d),(0,i.useEffect)(()=>{d()},[e,d]),(0,i.useEffect)(()=>(window.addEventListener("resize",d,{passive:!0}),()=>{window.removeEventListener("resize",d)}),[d]),{codeBlockRef:r,isEnabled:e,isCodeScrollable:t,toggle:l}}(),b=(0,o.Z)(),y=(r?.match(A)?.groups.title??"")||c,{lineClassNames:v,code:w}=function(e,n){let t=e.replace(/\n$/,""),{language:s,magicComments:r,metastring:l}=n;if(l&&R.test(l)){let e=l.match(R).groups.range;if(0===r.length)throw Error(`A highlight range has been given in code block's metastring (\`\`\` ${l}), but no magic comment config is available. Docusaurus applies the first magic comment entry's className for metastring ranges.`);let n=r[0].className;return{lineClassNames:Object.fromEntries(F()(e).filter(e=>e>0).map(e=>[e-1,[n]])),code:t}}if(void 0===s)return{lineClassNames:{},code:t};let i=function(e,n){switch(e){case"js":case"javascript":case"ts":case"typescript":return M(["js","jsBlock"],n);case"jsx":case"tsx":return M(["js","jsBlock","jsx"],n);case"html":return M(["js","jsBlock","html"],n);case"python":case"py":case"bash":return M(["bash"],n);case"markdown":case"md":return M(["html","jsx","bash"],n);case"tex":case"latex":case"matlab":return M(["tex"],n);case"lua":case"haskell":return M(["lua"],n);case"sql":return M(["lua","jsBlock"],n);case"wasm":return M(["wasm"],n);case"vb":case"vba":case"visual-basic":return M(["vb","rem"],n);case"vbnet":return M(["vbnet","rem"],n);case"batch":return M(["rem"],n);case"basic":return M(["rem","f90"],n);case"fsharp":return M(["js","ml"],n);case"ocaml":case"sml":return M(["ml"],n);case"fortran":return M(["f90"],n);case"cobol":return M(["cobol"],n);default:return M(_,n)}}(s,r),d=t.split("\n"),o=Object.fromEntries(r.map(e=>[e.className,{start:0,range:""}])),c=Object.fromEntries(r.filter(e=>e.line).map(e=>{let{className:n,line:t}=e;return[t,n]})),a=Object.fromEntries(r.filter(e=>e.block).map(e=>{let{className:n,block:t}=e;return[t.start,n]})),h=Object.fromEntries(r.filter(e=>e.block).map(e=>{let{className:n,block:t}=e;return[t.end,n]}));for(let e=0;e<d.length;){let n=d[e].match(i);if(!n){e+=1;continue}let t=n.slice(1).find(e=>void 0!==e);c[t]?o[c[t]].range+=`${e},`:a[t]?o[a[t]].start=e:h[t]&&(o[h[t]].range+=`${o[h[t]].start}-${e-1},`),d.splice(e,1)}t=d.join("\n");let u={};return Object.entries(o).forEach(e=>{let[n,{range:t}]=e;F()(t).forEach(e=>{u[e]??=[],u[e].push(n)})}),{lineClassNames:u,code:t}}(t,{metastring:r,language:j,magicComments:x}),k=function(e){let{showLineNumbers:n,metastring:t}=e;return"boolean"==typeof n?n?1:void 0:"number"==typeof n?n:function(e){let n=e?.split(" ").find(e=>e.startsWith("showLineNumbers"));if(n)return n.startsWith("showLineNumbers=")?parseInt(n.replace("showLineNumbers=",""),10):1}(t)}({showLineNumbers:a,metastring:r});return(0,l.jsxs)(S,{as:"div",className:(0,d.Z)(s,j&&!s.includes(`language-${j}`)&&`language-${j}`),children:[y&&(0,l.jsx)("div",{className:U.codeBlockTitle,children:y}),(0,l.jsxs)("div",{className:U.codeBlockContent,children:[(0,l.jsx)($.y$,{theme:m,code:w,language:j??"text",children:e=>{let{className:n,style:t,tokens:s,getLineProps:r,getTokenProps:i}=e;return(0,l.jsx)("pre",{tabIndex:0,ref:f.codeBlockRef,className:(0,d.Z)(n,U.codeBlock,"thin-scrollbar"),style:t,children:(0,l.jsx)("code",{className:(0,d.Z)(U.codeBlockLines,void 0!==k&&U.codeBlockLinesWithNumbering),style:void 0===k?void 0:{counterReset:`line-count ${k-1}`},children:s.map((e,n)=>(0,l.jsx)(X,{line:e,getLineProps:r,getTokenProps:i,classNames:v[n],showLineNumbers:void 0!==k},n))})})}}),b?(0,l.jsxs)("div",{className:U.buttonGroup,children:[(f.isEnabled||f.isCodeScrollable)&&(0,l.jsx)(K,{className:U.codeButton,onClick:()=>f.toggle(),isEnabled:f.isEnabled}),(0,l.jsx)(V,{className:U.codeButton,code:w})]}):null]})]})}let ee=(s=function(e){let{children:n,...t}=e,s=(0,o.Z)(),r=i.Children.toArray(n).some(e=>(0,i.isValidElement)(e))?n:Array.isArray(n)?n.join(""):n;return(0,l.jsx)("string"==typeof r?Q:Z,{...t,children:r},String(s))},function(e){return e.live?(0,l.jsx)(B,{scope:L,...e}):(0,l.jsx)(s,{...e})});function en(e){return(0,l.jsx)(ee,{...e})}}}]); |