Add a new signature to metalsmith.metadata, reading it from a file or directory
Author: webketjeCreated Feb 26, 2024Updated Feb 26, 2024
Labelsstage:approvedtype:feature
Another plugin already has a similar feature (need to look up which).
The proposal is to add a signature
metalsmith.metadata('path/to/file/resolved/to/metalsmith/directory')to read metadata from a file or a directory of files in which each filename maps to a metadata key.
This is an important step in making metalsmith headless-cms-friendly, in that global metadata can then be edited via a web interface (if desired). It resolves to metalsmith.directory so that users who may prefer not adding the metalsmith config to the source folder for processing can store it somewhere else
If the current setter is { ...oldMeta, ...newMeta } the new setter is { ...oldMeta, ...(fileSystemAdapter(newMetaLookup))}
Source: metalsmith/metalsmith