Barra Lateral
Criar uma barra lateral é útil para:
- Group multiple related documents
- Display a sidebar on each of those documents
- Provide paginated navigation, with next/previous button
Para usar as barras laterais no seu site do Docusaurus:
- Define a file that exports a dictionary of sidebar objects.
- Pass this object into the
@docusaurus/plugin-docs
plugin directly or via@docusaurus/preset-classic
.
docusaurus.config.js
export default {
presets: [
[
'@docusaurus/preset-classic',
{
docs: {
sidebarPath: './sidebars.js',
},
},
],
],
};
This section serves as an overview of miscellaneous features of the doc sidebar. In the following sections, we will more systematically introduce the following concepts:
📄️ Sidebar items
We have introduced three types of item types in the example in the previous section autogenerated, which we will explain in detail later.
📄️ Autogenerated
Docusaurus can create a sidebar automatically from your filesystem structure: each folder creates a sidebar category, and each file creates a doc link.
📄️ Usando múltiplas barras laterais
You can create a sidebar for each set of Markdown files that you want to group together.