For example, we want to add color as a field to a tree.
In the old times, we would add color to a plugin source code: color: page.frontmatter.color || 'blue'. My proposal is to add an option additionalFields to plugin interface:
[
'@b0g3r/generate-tree',
{
locales: LOCALES,
additionalFields: {
color: (page) => page.frontmatter.color || 'blue',
title: (page) => page.frontmatter.title || page.title || '',
...
}
},
],
We should carefully check the ability to use these dynamic field names in the plugin type system.