docusaurus/assets/js/028951d7.71e26f2c.js
2025-12-09 14:21:12 +00:00

1 line
11 KiB
JavaScript

"use strict";(self.webpackChunkwebsite=self.webpackChunkwebsite||[]).push([["46330"],{80944:function(e,s,n){n.d(s,{A:()=>r});let r={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"}},18481:function(e,s,n){n.d(s,{A:()=>r});let r=n.p+"assets/images/social-card-e1b6e0c51be29d4ab2d4c966d220410c.png"},62017:function(e,s,n){n.d(s,{A:()=>r});let r=n.p+"assets/images/broken-anchor-4191e5dd94aef9e8c5e3524880670f0f.jpg"},60222:function(e,s,n){n.d(s,{A:()=>r});let r=n.p+"assets/images/social-card-e1b6e0c51be29d4ab2d4c966d220410c.png"},20060:function(e,s,n){n.r(s),n.d(s,{assets:()=>c,contentTitle:()=>i,default:()=>u,frontMatter:()=>a,metadata:()=>r,toc:()=>l});var r=n(87818),t=n(74848),o=n(56151);n(52903),n(62919),n(47407);let a={title:"Docusaurus 3.1",authors:["slorber"],tags:["release"],image:"./img/social-card.png",date:new Date("2024-01-05T00:00:00.000Z")},i,c={image:n(18481).A,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){let s={a:"a",admonition:"admonition",code:"code",h2:"h2",h3:"h3",img:"img",li:"li",p:"p",pre:"pre",strong:"strong",ul:"ul",...(0,o.R)(),...e.components};return(0,t.jsxs)(t.Fragment,{children:[(0,t.jsxs)(s.p,{children:["We are happy to announce ",(0,t.jsx)(s.strong,{children:"Docusaurus 3.1"}),"."]}),"\n",(0,t.jsxs)(s.p,{children:["The upgrade should be easy: as explained in our ",(0,t.jsx)(s.a,{href:"/community/release-process",children:"release process documentation"}),", minor versions respect ",(0,t.jsx)(s.a,{href:"https://semver.org/",children:"Semantic Versioning"}),"."]}),"\n",(0,t.jsx)(s.p,{children:(0,t.jsx)(s.img,{alt:"Docusaurus blog post social card",src:n(60222).A+"",width:"1200",height:"600"})}),"\n","\n",(0,t.jsx)(s.h2,{id:"highlights",children:"Highlights"}),"\n",(0,t.jsx)(s.h3,{id:"broken-anchors-checker",children:"Broken anchors checker"}),"\n",(0,t.jsxs)(s.p,{children:["In ",(0,t.jsx)(s.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)(s.p,{children:(0,t.jsx)(s.img,{alt:"Docusaurus blog post social card",src:n(62017).A+"",width:"1920",height:"896"})}),"\n",(0,t.jsxs)(s.admonition,{title:"Make it fail fast",type:"tip",children:[(0,t.jsxs)(s.p,{children:["The new ",(0,t.jsx)(s.a,{href:"/docs/api/docusaurus-config#onBrokenAnchors",children:(0,t.jsx)(s.code,{children:"onBrokenAnchors"})})," option has value ",(0,t.jsx)(s.code,{children:"warn"})," by default, for retro-compatibility reasons."]}),(0,t.jsxs)(s.p,{children:["We recommend to turn it to ",(0,t.jsx)(s.code,{children:"throw"})," and fail your CI builds instead of deploying broken anchors to productions."]})]}),"\n",(0,t.jsxs)(s.admonition,{type:"note",children:[(0,t.jsxs)(s.p,{children:["For users and plugin authors implementing custom ",(0,t.jsx)(s.code,{children:"<Heading>"})," and ",(0,t.jsx)(s.code,{children:"<Link>"})," components, we provide a new ",(0,t.jsx)(s.a,{href:"/docs/docusaurus-core#useBrokenLinks",children:(0,t.jsx)(s.code,{children:"useBrokenLinks"})})," React hook API."]}),(0,t.jsxs)(s.p,{children:[(0,t.jsx)(s.strong,{children:"Most Docusaurus users don't need to care about it"}),", built-in components (",(0,t.jsx)(s.code,{children:"docusaurus/Link"})," and ",(0,t.jsx)(s.code,{children:"@theme/Heading"}),") already use it internally."]})]}),"\n",(0,t.jsxs)(s.h3,{id:"parsefrontmatter-hook",children:[(0,t.jsx)(s.code,{children:"parseFrontMatter"})," hook"]}),"\n",(0,t.jsxs)(s.p,{children:["In ",(0,t.jsx)(s.a,{href:"https://github.com/facebook/docusaurus/pull/9624",children:"#9624"}),", we added a new ",(0,t.jsxs)(s.a,{href:"/docs/api/docusaurus-config#markdown",children:[(0,t.jsx)(s.code,{children:"siteConfig.markdown.parseFrontMatter"})," function hook"]}),"."]}),"\n",(0,t.jsx)(s.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)(s.pre,{children:(0,t.jsx)(s.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)(s.p,{children:["Read the ",(0,t.jsx)(s.a,{href:"/docs/markdown-features#front-matter",children:"front matter guide"})," and the ",(0,t.jsxs)(s.a,{href:"/docs/api/docusaurus-config#markdown",children:[(0,t.jsx)(s.code,{children:"parseFrontMatter"})," API ref"]})," for details."]}),"\n",(0,t.jsx)(s.h2,{id:"other-changes",children:"Other changes"}),"\n",(0,t.jsx)(s.p,{children:"Other notable changes include:"}),"\n",(0,t.jsxs)(s.ul,{children:["\n",(0,t.jsxs)(s.li,{children:[(0,t.jsx)(s.a,{href:"https://github.com/facebook/docusaurus/pull/9674",children:"#9674"}),": add ",(0,t.jsx)(s.code,{children:"siteConfig.markdown.remarkRehypeOptions"})," to pass options to ",(0,t.jsx)(s.code,{children:"remark-rehype"}),", letting you customize things such as MDX footnote label"]}),"\n",(0,t.jsxs)(s.li,{children:[(0,t.jsx)(s.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)(s.li,{children:[(0,t.jsx)(s.a,{href:"https://github.com/facebook/docusaurus/pull/9610",children:"#9610"}),": enable CLI port configuration via ",(0,t.jsx)(s.code,{children:"PORT"})," environment variable"]}),"\n",(0,t.jsxs)(s.li,{children:[(0,t.jsx)(s.a,{href:"https://github.com/facebook/docusaurus/pull/9477",children:"#9477"}),": complete Brazilian Portuguese (pt-BR) translations"]}),"\n"]}),"\n",(0,t.jsxs)(s.p,{children:["Check the ",(0,t.jsx)(s.strong,{children:(0,t.jsx)(s.a,{href:"/changelog/3.1.0",children:"3.1.0 changelog entry"})})," for an exhaustive list of changes."]})]})}function u(e={}){let{wrapper:s}={...(0,o.R)(),...e.components};return s?(0,t.jsx)(s,{...e,children:(0,t.jsx)(d,{...e})}):d(e)}},62919:function(e,s,n){n.d(s,{A:()=>o});var r=n(74848);n(96540);var t=n(52903);function o({url:e}){return(0,r.jsx)("div",{style:{padding:10},children:(0,r.jsx)(t.A,{url:e,style:{minWidth:"min(100%,45vw)",width:800,maxWidth:"100%",overflow:"hidden"},bodyStyle:{padding:0},children:(0,r.jsx)("iframe",{src:e,title:e,style:{display:"block",width:"100%",height:300}})})})}},52903:function(e,s,n){n.d(s,{A:()=>a});var r=n(74848);n(96540);var t=n(11118),o=n(80944);function a({children:e,minHeight:s,url:n="http://localhost:3000",style:a,bodyStyle:i}){return(0,r.jsxs)("div",{className:o.A.browserWindow,style:{...a,minHeight:s},children:[(0,r.jsxs)("div",{className:o.A.browserWindowHeader,children:[(0,r.jsxs)("div",{className:o.A.buttons,children:[(0,r.jsx)("span",{className:o.A.dot,style:{background:"#f25f58"}}),(0,r.jsx)("span",{className:o.A.dot,style:{background:"#fbbe3c"}}),(0,r.jsx)("span",{className:o.A.dot,style:{background:"#58cb42"}})]}),(0,r.jsx)("div",{className:(0,t.A)(o.A.browserWindowAddressBar,"text--truncate"),children:n}),(0,r.jsx)("div",{className:o.A.browserWindowMenuIcon,children:(0,r.jsxs)("div",{children:[(0,r.jsx)("span",{className:o.A.bar}),(0,r.jsx)("span",{className:o.A.bar}),(0,r.jsx)("span",{className:o.A.bar})]})})]}),(0,r.jsx)("div",{className:o.A.browserWindowBody,style:i,children:e})]})}},47407:function(e,s,n){n.d(s,{A:()=>o});var r=n(74848),t=n(96540);function o({children:e="Boom!",message:s="Boom!\nSomething bad happened, but you can try again!",cause:n}){let[o,a]=(0,t.useState)(!1);if(o)throw Error(s,{cause:n?Error(n):void 0});return(0,r.jsx)("button",{className:"button button--danger",type:"button",onClick:()=>a(!0),children:e})}},56151:function(e,s,n){n.d(s,{R:()=>a,x:()=>i});var r=n(96540);let t={},o=r.createContext(t);function a(e){let s=r.useContext(o);return r.useMemo(function(){return"function"==typeof e?e(s):{...s,...e}},[s,e])}function i(e){let s;return s=e.disableParentContext?"function"==typeof e.components?e.components(t):e.components||t:a(e.components),r.createElement(o.Provider,{value:s},e.children)}},87818:function(e){e.exports=JSON.parse('{"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":false,"label":"Release","permalink":"/blog/tags/release","description":"Blog posts about Docusaurus\' new releases"}],"readingTime":2.01,"hasTruncateMarker":true,"authors":[{"name":"S\xe9bastien Lorber","title":"Docusaurus maintainer, This Week In React editor","url":"https://thisweekinreact.com","page":{"permalink":"/blog/authors/slorber"},"description":"A freelance React and React-Native developer near Paris and Docusaurus maintainer. Also runs ThisWeekInReact.com, a newsletter to stay updated with the React ecosystem.","socials":{"bluesky":"https://bsky.app/profile/sebastienlorber.com","x":"https://x.com/sebastienlorber","linkedin":"https://www.linkedin.com/in/sebastienlorber/","github":"https://github.com/slorber","instagram":"https://www.instagram.com/thisweekinreact","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":false,"lastUpdatedAt":1765289882000,"lastUpdatedBy":"dependabot[bot]","prevItem":{"title":"Docusaurus 3.2","permalink":"/blog/releases/3.2"},"nextItem":{"title":"Announcing Docusaurus 3.0","permalink":"/blog/releases/3.0"}}')}}]);