Docusaurus 2.2
· 1分で読めます
We are happy to announce Docusaurus 2.2.
The upgrade should be easy: as explained in our release process documentation, minor versions respect Semantic Versioning.
Highlights
Mermaid diagrams
In #7490, we added support for Mermaid diagrams. This fills the gap between GitHub Flavored Markdown which also added support recently. You can create Mermaid diagrams using Markdown code blocks:
```mermaid
sequenceDiagram
participant Alice
participant Bob
Alice->>John: Hello John, how are you?
loop Health check
John->>John: Fight against hypochondria
end
Note right of John: Rational thoughts <br/>prevail!
John-->>Alice: Great!
John->>Bob: How about you?
Bob-->>John: Jolly good!
```
http://localhost:3000
Make sure to check the documentation, and the more advanced examples
Config headTags
In #8151, we added the ability to apply arbitrary HTML <head>
tags to all pages of your site.
docusaurus.config.js
module.exports = {
headTags: [
{
tagName: 'link',
attributes: {
rel: 'icon',
href: '/img/docusaurus.png',
},
},
],
};
Accessibility
We did several accessibility improvements:
- #8207: improves keyboard navigation for mobile drawer hamburger button
- #8161: improves keyboard navigation for tabs
- #8204: makes the skip to content button support progressive enhancement
- #8174: improves screen reader announcement when toggling between light/dark mode
Developer Experience
We made validation stricter and improved error messages:
- #8234: in case of doc processing failure, prints the problematic markdown file path in the error message
- #8192 and #8159: validates
siteConfig.url
more strictly and with better error message - #8066: makes config
url
andbaseUrl
fail-safe and less sensitive to the presence or absence of a leading or trailing slash