Open webketje opened 9 months ago
To avoid the usecase at https://github.com/metalsmith/collections/issues/79#issuecomment-1027474334 the user could be given the option to transform the render context passed to a template. By default this would be (backwards-compatible):
function renderContext(fileMeta, path, globalMeta) { return { ...globalMeta, ...fileMeta } }
The collections use case can then use a single collections property both on the file & global meta, and the renderContext can be remapped:
collections
function renderContext(fileMeta, path, globalMeta) { return { ...globalMeta, ...fileMeta, collections: { all: globalMeta.collections, own: fileMeta.collections }} }
Not to mention some manual data imports could be added as well
To avoid the usecase at https://github.com/metalsmith/collections/issues/79#issuecomment-1027474334 the user could be given the option to transform the render context passed to a template. By default this would be (backwards-compatible):
The collections use case can then use a single
collections
property both on the file & global meta, and the renderContext can be remapped:Not to mention some manual data imports could be added as well