At ClaimR we have been using Docusaurus v2 for our developer and documentation website for a while now. After a couple of months of using it we can confidently say that we’re very happy with our choice.

Docusaurus comes batteries-included, so you immediately get a lot of value, while it is flexible enough to tailor it to your needs if there’s something you like differently. Also, their documentation is superb, as you would expect from a framework who owes its existence to its ability to create documentation websites.

Image for post

Docu-what?

For anyone unfamiliar to Docusaurus, Docusaurus an open-source framework created by Facebook for making documentation websites for all their open-source tools. If you have been working on some NodeJS projects, then you have likely used documentation generated by Docusaurus, just to name some examples: JestCreate React App, and Redux.

Now Facebook is working on the next iteration for Docusaurus, called Docusaurus v2. Which makes it a performant static site generator to quickly create all sorts of websites. Support for documentation is still a first-class citizen, but now you are free to use it to create whatever your heart desires. Officially it’s still in alpha, but to our experience it’s already very stable and new projects are encouraged by Facebook to adopt Docusaurus v2.

Why Would I Need Plugins?

The main reason why plugins exist in the Docusaurus ecosystem is reusability. There are plenty of bits of code which have a generic purpose, with plugins you can share these bits of code between these projects. Docusaurus uses plugins to separate the logic for creating blogs or documentation pages from core Docusaurus. Plugins can also be used for adding functionalities which aren’t directly user facing, e.g. there are official plugins for optimizing images, adding Google Analytics or creating sitemaps.

The official plugins are very useful, but it might be that your use-case is not satisfied by them. In our case at ClaimR we are using a different analytics provider than Google Analytics. Plugins are very useful here, as you can use them to inject the tracking code in every generated page.

#plugins #nodejs #typescript #docusaurus #documentation

How to Build a Plugin for Docusaurus
7.20 GEEK