mirror of
https://github.com/facebook/docusaurus.git
synced 2025-05-08 14:47:12 +02:00
1 line
No EOL
12 KiB
JavaScript
1 line
No EOL
12 KiB
JavaScript
"use strict";(self.webpackChunkwebsite=self.webpackChunkwebsite||[]).push([[8648],{40805:(e,s,r)=>{r.d(s,{Z:()=>n});const n=r.p+"assets/images/social-card-402517ac2205718a22585e627fe1351c.png"},6698:(e,s,r)=>{r.d(s,{Z:()=>l});var n=r(24246),a=(r(27378),r(40624));const t={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 o(e,s,r){return s in e?Object.defineProperty(e,s,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[s]=r,e}function i(e){for(var s=1;s<arguments.length;s++){var r=null!=arguments[s]?arguments[s]:{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(s){o(e,s,r[s])}))}return e}function c(e,s){return s=null!=s?s:{},Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(s)):function(e,s){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);s&&(n=n.filter((function(s){return Object.getOwnPropertyDescriptor(e,s).enumerable}))),r.push.apply(r,n)}return r}(Object(s)).forEach((function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(s,r))})),e}function l({children:e,minHeight:s,url:r="http://localhost:3000",style:o,bodyStyle:l}){return(0,n.jsxs)("div",{className:t.browserWindow,style:c(i({},o),{minHeight:s}),children:[(0,n.jsxs)("div",{className:t.browserWindowHeader,children:[(0,n.jsxs)("div",{className:t.buttons,children:[(0,n.jsx)("span",{className:t.dot,style:{background:"#f25f58"}}),(0,n.jsx)("span",{className:t.dot,style:{background:"#fbbe3c"}}),(0,n.jsx)("span",{className:t.dot,style:{background:"#58cb42"}})]}),(0,n.jsx)("div",{className:(0,a.Z)(t.browserWindowAddressBar,"text--truncate"),children:r}),(0,n.jsx)("div",{className:t.browserWindowMenuIcon,children:(0,n.jsxs)("div",{children:[(0,n.jsx)("span",{className:t.bar}),(0,n.jsx)("span",{className:t.bar}),(0,n.jsx)("span",{className:t.bar})]})})]}),(0,n.jsx)("div",{className:t.browserWindowBody,style:l,children:e})]})}},89686:(e,s,r)=>{r.d(s,{Z:()=>n});const n=r.p+"assets/images/social-card-402517ac2205718a22585e627fe1351c.png"},73660:(e,s,r)=>{r.r(s),r.d(s,{assets:()=>l,contentTitle:()=>i,default:()=>u,frontMatter:()=>o,metadata:()=>c,toc:()=>d});var n=r(24246),a=r(71670),t=r(6698);const o={title:"Docusaurus 2.2",authors:["slorber"],tags:["release"],image:"./img/social-card.png",date:new Date("2022-10-29T00:00:00.000Z")},i=void 0,c={permalink:"/blog/releases/2.2",editUrl:"https://github.com/facebook/docusaurus/edit/main/website/blog/releases/2.2/index.mdx",source:"@site/blog/releases/2.2/index.mdx",title:"Docusaurus 2.2",description:"We are happy to announce Docusaurus 2.2.",date:"2022-10-29T00:00:00.000Z",tags:[{inline:!1,label:"Release",permalink:"/blog/tags/release",description:"Blog posts about Docusaurus' new releases"}],readingTime:2.2,hasTruncateMarker:!0,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.\n",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 2.2",authors:["slorber"],tags:["release"],image:"./img/social-card.png",date:"2022-10-29T00:00:00.000Z"},unlisted:!1,lastUpdatedAt:172407932e4,lastUpdatedBy:"Joel Campos",prevItem:{title:"Docusaurus 2.3",permalink:"/blog/releases/2.3"},nextItem:{title:"Docusaurus 2.1",permalink:"/blog/2022/09/01/docusaurus-2.1"}},l={image:r(40805).Z,authorsImageUrls:[void 0]},d=[{value:"Highlights",id:"highlights",level:2},{value:"Mermaid diagrams",id:"mermaid-diagrams",level:3},{value:"Config <code>headTags</code>",id:"config-headtags",level:3},{value:"Accessibility",id:"accessibility",level:3},{value:"Developer Experience",id:"developer-experience",level:3},{value:"Translations",id:"translations",level:3},{value:"Other changes",id:"other-changes",level:2}];function h(e){const s={a:"a",admonition:"admonition",code:"code",h2:"h2",h3:"h3",img:"img",li:"li",mermaid:"mermaid",p:"p",pre:"pre",strong:"strong",ul:"ul",...(0,a.a)(),...e.components};return(0,n.jsxs)(n.Fragment,{children:[(0,n.jsxs)(s.p,{children:["We are happy to announce ",(0,n.jsx)(s.strong,{children:"Docusaurus 2.2"}),"."]}),"\n",(0,n.jsxs)(s.p,{children:["The upgrade should be easy: as explained in our ",(0,n.jsx)(s.a,{href:"/community/release-process",children:"release process documentation"}),", minor versions respect ",(0,n.jsx)(s.a,{href:"https://semver.org/",children:"Semantic Versioning"}),"."]}),"\n",(0,n.jsx)(s.p,{children:(0,n.jsx)(s.img,{alt:"Docusaurus 2.2 social card",src:r(89686).Z+"",width:"1200",height:"600"})}),"\n","\n",(0,n.jsx)(s.h2,{id:"highlights",children:"Highlights"}),"\n",(0,n.jsx)(s.h3,{id:"mermaid-diagrams",children:"Mermaid diagrams"}),"\n",(0,n.jsxs)(s.p,{children:["In ",(0,n.jsx)(s.a,{href:"https://github.com/facebook/docusaurus/pull/7490",children:"#7490"}),", we added support for Mermaid diagrams. This fills the gap between GitHub Flavored Markdown which also ",(0,n.jsx)(s.a,{href:"https://github.blog/2022-02-14-include-diagrams-markdown-files-mermaid/",children:"added support recently"}),". You can create Mermaid diagrams using Markdown code blocks:"]}),"\n",(0,n.jsx)(s.pre,{children:(0,n.jsx)(s.code,{className:"language-md",children:"```mermaid\nsequenceDiagram\n participant Alice\n participant Bob\n Alice->>John: Hello John, how are you?\n loop Health check\n John->>John: Fight against hypochondria\n end\n Note right of John: Rational thoughts <br/>prevail!\n John--\x3e>Alice: Great!\n John->>Bob: How about you?\n Bob--\x3e>John: Jolly good!\n```\n"})}),"\n","\n",(0,n.jsx)(t.Z,{children:(0,n.jsx)(s.mermaid,{value:"sequenceDiagram\n participant Alice\n participant Bob\n Alice->>John: Hello John, how are you?\n loop Health check\n John->>John: Fight against hypochondria\n end\n Note right of John: Rational thoughts <br/>prevail!\n John--\x3e>Alice: Great!\n John->>Bob: How about you?\n Bob--\x3e>John: Jolly good!"})}),"\n",(0,n.jsxs)(s.p,{children:["Make sure to check the ",(0,n.jsx)(s.a,{href:"/docs/markdown-features/diagrams",children:"documentation"}),", and the ",(0,n.jsx)(s.a,{href:"/tests/pages/diagrams",children:"more advanced examples"})]}),"\n",(0,n.jsxs)(s.h3,{id:"config-headtags",children:["Config ",(0,n.jsx)(s.code,{children:"headTags"})]}),"\n",(0,n.jsxs)(s.p,{children:["In ",(0,n.jsx)(s.a,{href:"https://github.com/facebook/docusaurus/pull/8151",children:"#8151"}),", we added the ability to apply arbitrary HTML ",(0,n.jsx)(s.code,{children:"<head>"})," tags to all pages of your site."]}),"\n",(0,n.jsx)(s.pre,{children:(0,n.jsx)(s.code,{className:"language-js",metastring:'title="docusaurus.config.js"',children:"module.exports = {\n headTags: [\n {\n tagName: 'link',\n attributes: {\n rel: 'icon',\n href: '/img/docusaurus.png',\n },\n },\n ],\n};\n"})}),"\n",(0,n.jsx)(s.h3,{id:"accessibility",children:"Accessibility"}),"\n",(0,n.jsx)(s.p,{children:"We did several accessibility improvements:"}),"\n",(0,n.jsxs)(s.ul,{children:["\n",(0,n.jsxs)(s.li,{children:[(0,n.jsx)(s.a,{href:"https://github.com/facebook/docusaurus/pull/8207",children:"#8207"}),": improves keyboard navigation for mobile drawer hamburger button"]}),"\n",(0,n.jsxs)(s.li,{children:[(0,n.jsx)(s.a,{href:"https://github.com/facebook/docusaurus/pull/8161",children:"#8161"}),": improves keyboard navigation for tabs"]}),"\n",(0,n.jsxs)(s.li,{children:[(0,n.jsx)(s.a,{href:"https://github.com/facebook/docusaurus/pull/8204",children:"#8204"}),": makes the skip to content button support progressive enhancement"]}),"\n",(0,n.jsxs)(s.li,{children:[(0,n.jsx)(s.a,{href:"https://github.com/facebook/docusaurus/pull/8174",children:"#8174"}),": improves screen reader announcement when toggling between light/dark mode"]}),"\n"]}),"\n",(0,n.jsx)(s.h3,{id:"developer-experience",children:"Developer Experience"}),"\n",(0,n.jsx)(s.p,{children:"We made validation stricter and improved error messages:"}),"\n",(0,n.jsxs)(s.ul,{children:["\n",(0,n.jsxs)(s.li,{children:[(0,n.jsx)(s.a,{href:"https://github.com/facebook/docusaurus/pull/8234",children:"#8234"}),": in case of doc processing failure, prints the problematic markdown file path in the error message"]}),"\n",(0,n.jsxs)(s.li,{children:[(0,n.jsx)(s.a,{href:"https://github.com/facebook/docusaurus/pull/8192",children:"#8192"})," and ",(0,n.jsx)(s.a,{href:"https://github.com/facebook/docusaurus/pull/8159",children:"#8159"}),": validates ",(0,n.jsx)(s.code,{children:"siteConfig.url"})," more strictly and with better error message"]}),"\n",(0,n.jsxs)(s.li,{children:[(0,n.jsx)(s.a,{href:"https://github.com/facebook/docusaurus/pull/8066",children:"#8066"}),": makes config ",(0,n.jsx)(s.code,{children:"url"})," and ",(0,n.jsx)(s.code,{children:"baseUrl"})," fail-safe and less sensitive to the presence or absence of a leading or trailing slash"]}),"\n"]}),"\n",(0,n.jsx)(s.h3,{id:"translations",children:"Translations"}),"\n",(0,n.jsx)(s.p,{children:"We completed the default theme translation support for multiple languages:"}),"\n",(0,n.jsxs)(s.ul,{children:["\n",(0,n.jsxs)(s.li,{children:["\ud83c\uddf9\ud83c\uddf7 ",(0,n.jsx)(s.a,{href:"https://github.com/facebook/docusaurus/pull/8105",children:"#8105"}),": completes Turkish translations"]}),"\n",(0,n.jsxs)(s.li,{children:["\ud83c\uddf7\ud83c\uddfa ",(0,n.jsx)(s.a,{href:"https://github.com/facebook/docusaurus/pull/8253",children:"#8253"}),": completes Russian translations"]}),"\n",(0,n.jsxs)(s.li,{children:["\ud83c\uddeb\ud83c\uddf7 ",(0,n.jsx)(s.a,{href:"https://github.com/facebook/docusaurus/pull/8243",children:"#8243"}),": completes French translations"]}),"\n",(0,n.jsxs)(s.li,{children:["\ud83c\uddef\ud83c\uddf5 ",(0,n.jsx)(s.a,{href:"https://github.com/facebook/docusaurus/pull/8075",children:"#8075"}),": completes Japanese translations"]}),"\n"]}),"\n",(0,n.jsx)(s.admonition,{type:"tip",children:(0,n.jsxs)(s.p,{children:["Completing theme translations is an ",(0,n.jsx)(s.a,{href:"https://github.com/facebook/docusaurus/issues/3526",children:"ongoing effort"})," and an easy way to contribute to Docusaurus. We add new theme features regularly, for which we often ",(0,n.jsx)(s.a,{href:"https://github.com/facebook/docusaurus/issues/3526",children:"need new translations"}),"."]})}),"\n",(0,n.jsx)(s.h2,{id:"other-changes",children:"Other changes"}),"\n",(0,n.jsx)(s.p,{children:"Other notable changes include:"}),"\n",(0,n.jsxs)(s.ul,{children:["\n",(0,n.jsxs)(s.li,{children:[(0,n.jsx)(s.a,{href:"https://github.com/facebook/docusaurus/pull/8210",children:"#8210"}),": the ",(0,n.jsx)(s.code,{children:"docusaurus swizzle"})," CLI has a new ",(0,n.jsx)(s.code,{children:"--config"})," option"]}),"\n",(0,n.jsxs)(s.li,{children:[(0,n.jsx)(s.a,{href:"https://github.com/facebook/docusaurus/pull/8109",children:"#8109"}),": mobile navigation performance optimizations, prefetch resources earlier"]}),"\n",(0,n.jsxs)(s.li,{children:[(0,n.jsx)(s.a,{href:"https://github.com/facebook/docusaurus/pull/8059",children:"#8059"}),": versions/locales navbar dropdowns preserve hash and querystring on navigation"]}),"\n",(0,n.jsxs)(s.li,{children:[(0,n.jsx)(s.a,{href:"https://github.com/facebook/docusaurus/pull/8227",children:"#8227"}),": the client redirect plugin preserves hash and querystring on redirect"]}),"\n"]}),"\n",(0,n.jsxs)(s.p,{children:["Check the ",(0,n.jsx)(s.strong,{children:(0,n.jsx)(s.a,{href:"/changelog/2.2.0",children:"2.2.0 changelog entry"})})," for an exhaustive list of changes."]})]})}function u(e={}){const{wrapper:s}={...(0,a.a)(),...e.components};return s?(0,n.jsx)(s,{...e,children:(0,n.jsx)(h,{...e})}):h(e)}},71670:(e,s,r)=>{r.d(s,{Z:()=>i,a:()=>o});var n=r(27378);const a={},t=n.createContext(a);function o(e){const s=n.useContext(t);return n.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(a):e.components||a:o(e.components),n.createElement(t.Provider,{value:s},e.children)}}}]); |