Dendron multivault gotchas

Building a site with multiple "root" files

Dendron organises its vaults around the idea of root files. These are a single-page entry point to all of the other notes. If you're running multi-vault you'll see multiple root files listed in the tree view.

If you try and run the command Dendron: Site Build you'll get an error ("mult notes found for root") that there are multiple root files. You can fix this by telling the Dendron build process which root files to use. You do this by editing the dendron.yml file.

Check the following has sensible settings (the "payload" bit refers to the names of the vaults you've created). If it doesn't exit, create it under (i.e. indented beneath) the Site: property.

duplicateNoteBehavior: 
  action: "useVault"
  payload: [myVault]

Remember this is going to be the same for all files each vault if they have a name clash. You can specify the order, apparently, but I couldn't get it to work with multiple vaults. It threw an error about not finding the index.

Build and publish don't (yet) apply to the whole workspace

Dendron builds and/or publishes all the vaults in your workspace, remote vaults and all. If you want to publish different notes to different places you need to create separate workspaces for each location.

You'll find all the files from all of the vaults in one single website folder, the "siteRootDir" value in dendron.yml. This is "docs" by default.

The remote multivault model

This confused me for a long time. The way I think of it is like this:

  • Each remote vault is a collection of just the notes in that tree
  • It's the local workspace that contains the dendron.yml file necessary to build a site.
  • If you want to build the site for, say AWS Amplify, then you need the contents of the local files there too
  • BUT then you'll end up with nested Git repositories, which is a BAD THING.