docusaurus/assets/js/028951d7.e74de968.js
2024-07-19 13:14:58 +00:00

1 line
No EOL
11 KiB
JavaScript

"use strict";(self.webpackChunkwebsite=self.webpackChunkwebsite||[]).push([[46255],{70539:(e,r,n)=>{n.d(r,{Z:()=>t});const t=n.p+"assets/images/social-card-e1b6e0c51be29d4ab2d4c966d220410c.png"},13381:(e,r,n)=>{n.d(r,{Z:()=>o});var t=n(24246),s=(n(27378),n(6698));function o({url:e}){return(0,t.jsx)("div",{style:{padding:10},children:(0,t.jsx)(s.Z,{url:e,style:{minWidth:"min(100%,45vw)",width:800,maxWidth:"100%",overflow:"hidden"},bodyStyle:{padding:0},children:(0,t.jsx)("iframe",{src:e,title:e,style:{display:"block",width:"100%",height:300}})})})}},6698:(e,r,n)=>{n.d(r,{Z:()=>l});var t=n(24246),s=(n(27378),n(40624));const o={browserWindow:"browserWindow_my1Q",browserWindowHeader:"browserWindowHeader_jXSR",row:"row_KZDM",buttons:"buttons_uHc7",right:"right_oyze",browserWindowAddressBar:"browserWindowAddressBar_Pd8y",dot:"dot_giz1",browserWindowMenuIcon:"browserWindowMenuIcon_Vhuh",bar:"bar_rrRL",browserWindowBody:"browserWindowBody_Idgs"};function a(e,r,n){return r in e?Object.defineProperty(e,r,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[r]=n,e}function i(e){for(var r=1;r<arguments.length;r++){var n=null!=arguments[r]?arguments[r]:{},t=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(t=t.concat(Object.getOwnPropertySymbols(n).filter((function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable})))),t.forEach((function(r){a(e,r,n[r])}))}return e}function c(e,r){return r=null!=r?r:{},Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):function(e,r){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var t=Object.getOwnPropertySymbols(e);r&&(t=t.filter((function(r){return Object.getOwnPropertyDescriptor(e,r).enumerable}))),n.push.apply(n,t)}return n}(Object(r)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})),e}function l({children:e,minHeight:r,url:n="http://localhost:3000",style:a,bodyStyle:l}){return(0,t.jsxs)("div",{className:o.browserWindow,style:c(i({},a),{minHeight:r}),children:[(0,t.jsxs)("div",{className:o.browserWindowHeader,children:[(0,t.jsxs)("div",{className:o.buttons,children:[(0,t.jsx)("span",{className:o.dot,style:{background:"#f25f58"}}),(0,t.jsx)("span",{className:o.dot,style:{background:"#fbbe3c"}}),(0,t.jsx)("span",{className:o.dot,style:{background:"#58cb42"}})]}),(0,t.jsx)("div",{className:(0,s.Z)(o.browserWindowAddressBar,"text--truncate"),children:n}),(0,t.jsx)("div",{className:o.browserWindowMenuIcon,children:(0,t.jsxs)("div",{children:[(0,t.jsx)("span",{className:o.bar}),(0,t.jsx)("span",{className:o.bar}),(0,t.jsx)("span",{className:o.bar})]})})]}),(0,t.jsx)("div",{className:o.browserWindowBody,style:l,children:e})]})}},3818:(e,r,n)=>{n.d(r,{Z:()=>o});var t=n(24246),s=n(27378);function o({children:e="Boom!",message:r="Boom!\nSomething bad happened, but you can try again!",cause:n}){const[o,a]=(0,s.useState)(!1);if(o)throw new Error(r,{cause:n?new Error(n):void 0});return(0,t.jsx)("button",{className:"button button--danger",type:"button",onClick:()=>a(!0),children:e})}},73382:(e,r,n)=>{n.d(r,{Z:()=>t});const t=n.p+"assets/images/broken-anchor-4191e5dd94aef9e8c5e3524880670f0f.jpg"},98969:(e,r,n)=>{n.d(r,{Z:()=>t});const t=n.p+"assets/images/social-card-e1b6e0c51be29d4ab2d4c966d220410c.png"},66819:(e,r,n)=>{n.r(r),n.d(r,{assets:()=>c,contentTitle:()=>a,default:()=>u,frontMatter:()=>o,metadata:()=>i,toc:()=>l});var t=n(24246),s=n(71670);n(6698),n(13381),n(3818);const o={title:"Docusaurus 3.1",authors:["slorber"],tags:["release"],image:"./img/social-card.png",date:new Date("2024-01-05T00:00:00.000Z")},a=void 0,i={permalink:"/blog/releases/3.1",editUrl:"https://github.com/facebook/docusaurus/edit/main/website/blog/releases/3.1/index.mdx",source:"@site/blog/releases/3.1/index.mdx",title:"Docusaurus 3.1",description:"We are happy to announce Docusaurus 3.1.",date:"2024-01-05T00:00:00.000Z",tags:[{inline:!1,label:"Release",permalink:"/blog/tags/release",description:"Blog posts about Docusaurus' new releases"}],readingTime:1.665,hasTruncateMarker:!0,authors:[{name:"S\xe9bastien Lorber",title:"Docusaurus maintainer, This Week In React editor",url:"https://thisweekinreact.com",socials:{x:"https://x.com/sebastienlorber",linkedin:"https://www.linkedin.com/in/sebastienlorber/",github:"https://github.com/slorber",newsletter:"https://thisweekinreact.com"},imageURL:"https://github.com/slorber.png",key:"slorber"}],frontMatter:{title:"Docusaurus 3.1",authors:["slorber"],tags:["release"],image:"./img/social-card.png",date:"2024-01-05T00:00:00.000Z"},unlisted:!1,lastUpdatedAt:1721394658e3,lastUpdatedBy:"S\xe9bastien Lorber",prevItem:{title:"Docusaurus 3.2",permalink:"/blog/releases/3.2"},nextItem:{title:"Announcing Docusaurus 3.0",permalink:"/blog/releases/3.0"}},c={image:n(70539).Z,authorsImageUrls:[void 0]},l=[{value:"Highlights",id:"highlights",level:2},{value:"Broken anchors checker",id:"broken-anchors-checker",level:3},{value:"<code>parseFrontMatter</code> hook",id:"parsefrontmatter-hook",level:3},{value:"Other changes",id:"other-changes",level:2}];function d(e){const r={a:"a",admonition:"admonition",code:"code",h2:"h2",h3:"h3",img:"img",li:"li",p:"p",pre:"pre",strong:"strong",ul:"ul",...(0,s.a)(),...e.components};return(0,t.jsxs)(t.Fragment,{children:[(0,t.jsxs)(r.p,{children:["We are happy to announce ",(0,t.jsx)(r.strong,{children:"Docusaurus 3.1"}),"."]}),"\n",(0,t.jsxs)(r.p,{children:["The upgrade should be easy: as explained in our ",(0,t.jsx)(r.a,{href:"/community/release-process",children:"release process documentation"}),", minor versions respect ",(0,t.jsx)(r.a,{href:"https://semver.org/",children:"Semantic Versioning"}),"."]}),"\n",(0,t.jsx)(r.p,{children:(0,t.jsx)(r.img,{alt:"Docusaurus blog post social card",src:n(98969).Z+"",width:"1200",height:"600"})}),"\n","\n",(0,t.jsx)(r.h2,{id:"highlights",children:"Highlights"}),"\n",(0,t.jsx)(r.h3,{id:"broken-anchors-checker",children:"Broken anchors checker"}),"\n",(0,t.jsxs)(r.p,{children:["In ",(0,t.jsx)(r.a,{href:"https://github.com/facebook/docusaurus/pull/9528",children:"#9528"}),", we improved the built-in broken links checker to also detect broken anchors."]}),"\n",(0,t.jsx)(r.p,{children:(0,t.jsx)(r.img,{alt:"Docusaurus blog post social card",src:n(73382).Z+"",width:"1920",height:"896"})}),"\n",(0,t.jsxs)(r.admonition,{title:"Make it fail fast",type:"tip",children:[(0,t.jsxs)(r.p,{children:["The new ",(0,t.jsx)(r.a,{href:"/docs/api/docusaurus-config#onBrokenAnchors",children:(0,t.jsx)(r.code,{children:"onBrokenAnchors"})})," option has value ",(0,t.jsx)(r.code,{children:"warn"})," by default, for retro-compatibility reasons."]}),(0,t.jsxs)(r.p,{children:["We recommend to turn it to ",(0,t.jsx)(r.code,{children:"throw"})," and fail your CI builds instead of deploying broken anchors to productions."]})]}),"\n",(0,t.jsxs)(r.admonition,{type:"note",children:[(0,t.jsxs)(r.p,{children:["For users and plugin authors implementing custom ",(0,t.jsx)(r.code,{children:"<Heading>"})," and ",(0,t.jsx)(r.code,{children:"<Link>"})," components, we provide a new ",(0,t.jsx)(r.a,{href:"/docs/docusaurus-core#useBrokenLinks",children:(0,t.jsx)(r.code,{children:"useBrokenLinks"})})," React hook API."]}),(0,t.jsxs)(r.p,{children:[(0,t.jsx)(r.strong,{children:"Most Docusaurus users don't need to care about it"}),", built-in components (",(0,t.jsx)(r.code,{children:"docusaurus/Link"})," and ",(0,t.jsx)(r.code,{children:"@theme/Heading"}),") already use it internally."]})]}),"\n",(0,t.jsxs)(r.h3,{id:"parsefrontmatter-hook",children:[(0,t.jsx)(r.code,{children:"parseFrontMatter"})," hook"]}),"\n",(0,t.jsxs)(r.p,{children:["In ",(0,t.jsx)(r.a,{href:"https://github.com/facebook/docusaurus/pull/9624",children:"#9624"}),", we added a new ",(0,t.jsxs)(r.a,{href:"/docs/api/docusaurus-config#markdown",children:[(0,t.jsx)(r.code,{children:"siteConfig.markdown.parseFrontMatter"})," function hook"]}),"."]}),"\n",(0,t.jsx)(r.p,{children:"This makes it possible to implement convenient front matter transformations, shortcuts, or to integrate with external systems using front matter that Docusaurus plugins do not support."}),"\n",(0,t.jsx)(r.pre,{children:(0,t.jsx)(r.code,{className:"language-js",metastring:'title="docusaurus.config.js"',children:"export default {\n markdown: {\n // highlight-start\n parseFrontMatter: async (params) => {\n // Reuse the default parser\n const result = await params.defaultParseFrontMatter(params);\n\n // Process front matter description placeholders\n result.frontMatter.description =\n result.frontMatter.description?.replaceAll('{{MY_VAR}}', 'MY_VALUE');\n\n // Create your own front matter shortcut\n if (result.frontMatter.i_do_not_want_docs_pagination) {\n result.frontMatter.pagination_prev = null;\n result.frontMatter.pagination_next = null;\n }\n\n // Rename an unsupported front matter coming from another system\n if (result.frontMatter.cms_seo_summary) {\n result.frontMatter.description = result.frontMatter.cms_seo_summary;\n delete result.frontMatter.cms_seo_summary;\n }\n\n return result;\n },\n // highlight-end\n },\n};\n"})}),"\n",(0,t.jsxs)(r.p,{children:["Read the ",(0,t.jsx)(r.a,{href:"/docs/markdown-features#front-matter",children:"front matter guide"})," and the ",(0,t.jsxs)(r.a,{href:"/docs/api/docusaurus-config#markdown",children:[(0,t.jsx)(r.code,{children:"parseFrontMatter"})," API ref"]})," for details."]}),"\n",(0,t.jsx)(r.h2,{id:"other-changes",children:"Other changes"}),"\n",(0,t.jsx)(r.p,{children:"Other notable changes include:"}),"\n",(0,t.jsxs)(r.ul,{children:["\n",(0,t.jsxs)(r.li,{children:[(0,t.jsx)(r.a,{href:"https://github.com/facebook/docusaurus/pull/9674",children:"#9674"}),": add ",(0,t.jsx)(r.code,{children:"siteConfig.markdown.remarkRehypeOptions"})," to pass options to ",(0,t.jsx)(r.code,{children:"remark-rehype"}),", letting you customize things such as MDX footnote label"]}),"\n",(0,t.jsxs)(r.li,{children:[(0,t.jsx)(r.a,{href:"https://github.com/facebook/docusaurus/pull/9671",children:"#9671"}),": add code block MagicComments support for (Visual) Basic/Batch/Fortran/COBOL/ML"]}),"\n",(0,t.jsxs)(r.li,{children:[(0,t.jsx)(r.a,{href:"https://github.com/facebook/docusaurus/pull/9610",children:"#9610"}),": enable CLI port configuration via ",(0,t.jsx)(r.code,{children:"PORT"})," environment variable"]}),"\n",(0,t.jsxs)(r.li,{children:[(0,t.jsx)(r.a,{href:"https://github.com/facebook/docusaurus/pull/9477",children:"#9477"}),": complete Brazilian Portuguese (pt-BR) translations"]}),"\n"]}),"\n",(0,t.jsxs)(r.p,{children:["Check the ",(0,t.jsx)(r.strong,{children:(0,t.jsx)(r.a,{href:"/changelog/3.1.0",children:"3.1.0 changelog entry"})})," for an exhaustive list of changes."]})]})}function u(e={}){const{wrapper:r}={...(0,s.a)(),...e.components};return r?(0,t.jsx)(r,{...e,children:(0,t.jsx)(d,{...e})}):d(e)}},71670:(e,r,n)=>{n.d(r,{Z:()=>i,a:()=>a});var t=n(27378);const s={},o=t.createContext(s);function a(e){const r=t.useContext(o);return t.useMemo((function(){return"function"==typeof e?e(r):{...r,...e}}),[r,e])}function i(e){let r;return r=e.disableParentContext?"function"==typeof e.components?e.components(s):e.components||s:a(e.components),t.createElement(o.Provider,{value:r},e.children)}}}]);