Multiple Instances
By default, the Starlight Obsidian plugin generates pages for one vault based on the provided plugin configuration.
If you want to generate pages for multiple vaults, the Starlight Obsidian plugin exposes a createStarlightObsidianPlugin()
function that allows you to create multiple instances of the plugin.
createStarlightObsidianPlugin()
Calling the createStarlightObsidianPlugin()
function returns an array with exactly two values:
- A new Starlight Obsidian plugin instance that you can add to your Starlight configuration.
- A reference to the generated sidebar group for that instance that you can add to your sidebar.
The following example creates two Starlight Obsidian plugin instances for two different vaults: one for a vault about astronomy and another for a vault about biology. The associated sidebar groups are then added to the sidebar: