Redesign buildNavigation function to be idempotent

Currently, the buildNavigation function modifies the state of each component version object by assigning the built navigation to the navigation property. Instead, it should be idempotent. It should return the navigation catalog and allow the consumer (such as the site generator) to assign the navigation to each component version object. This makes the function more reusable such as in extensions such as Assembler.

The function also assumes that all files in the nav family should be included in the navigation in the order specified on the .nav.index property on each file. Instead, the function should accept navigation configuration and look up the files listed in that configuration. Once again, this makes the function more reusable.

It would also be nice to be able to pass in custom attributes that override attributes on the component version. This can be useful for loading alternate navigation, such as in an extension like Assembler.

Perhaps:

NavigationCatalog buildNavigation(contentCatalog, navs, defaultAsciiDocConfig, asciidocAttributes)

We'll need to think a bit more about the function parameters. We'll either need to make the function backwards compatible or introduce a new one.

Edited by Dan Allen
To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information