Aller au contenu principal

Docusaurus 2.2

· 4 minutes de lecture
Sébastien Lorber
Mainteneur de Docusaurus, rédacteur de This Week In React

We are happy to announce Docusaurus 2.2.

La mise à jour devrait être facile : comme expliqué dans notre documentation du processus de publication, les versions mineures respectent le versionnage sémantique.

Docusaurus 2.2 social card

Points importants

Diagrammes Mermaid

In #7490, we added support for Mermaid diagrams. This fills the gap between GitHub Flavored Markdown which also added support recently. Vous pouvez créer des diagrammes Mermaid en utilisant des blocs de code Markdown :

```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',
},
},
],
};

Accessibilité

Nous avons fait plusieurs améliorations d'accessibilité :

  • #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

Expérience de développeur

Nous avons rendu la validation plus stricte et amélioré les messages d'erreur :

  • #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 and baseUrl fail-safe and less sensitive to the presence or absence of a leading or trailing slash

Traductions

Nous avons ajouté la prise en charge de la traduction du thème par défaut pour plusieurs langues :

  • 🇹🇷 #8105: completes Turkish translations
  • 🇷🇺 #8253: completes Russian translations
  • 🇫🇷 #8243: completes French translations
  • 🇯🇵 #8075: completes Japanese translations
astuce

Terminer les traductions du thème est un effort en cours et un moyen facile de contribuer à Docusaurus. Nous ajoutons régulièrement de nouvelles fonctionnalités de thème, pour lesquelles nous avons souvent besoin de nouvelles traductions.

Autres modifications

Voici les autres changements notables :

  • #8210: the docusaurus swizzle CLI has a new --config option
  • #8109: mobile navigation performance optimizations, prefetch resources earlier
  • #8059: versions/locales navbar dropdowns preserve hash and querystring on navigation
  • #8227: the client redirect plugin preserves hash and querystring on redirect

Check the 2.2.0 changelog entry for an exhaustive list of changes.