Aninhar subcategorias sob suas categorias principais na barra lateral

It sounds as though your use case is more suited to discourse-docs than the sidebar.

You can see an example of the view and filtering it provides here Docs - Discourse Meta