The SidebarPlugin generates the necessary page metadata needed for the vertical navigation shown on some Mosaic pages.

The output from the plugin is added to a sidebarData metadata property of the page.

The rootDirGlob is used to determine the "root" directories of the sidebar. So for example:

  • */*/* - generate sidebar data for the pages that are 3 directories deep in the filesystem hierarchy
  • */!(product-a)/* - same as above but ignore the product-a directory
  • products/product-b - generate a sidebar just for product-b in the products directory

To rearrange pages in the sidebar or to apply a different label to a page you can configure the sidebar using page frontmatter.

This plugin runs with a priority of 3.

PropertyDescription
filenamefilename of the sidebar json, linked to each related page via ref
rootDirGlobGlob pattern for matching directories which should be the root of the sidebar

This plugin is included in the mosaic config shipped by the Mosaic standard generator. So if you use the below import in your mosaic.config.mjs file then the plugin is included already:

To add it yourself, add the following to the plugins collection:

Mosaic BETA

Coming soon