Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add a new signature to metalsmith.metadata, reading it from a file or directory #404

Open
Tracked by #405
webketje opened this issue Feb 26, 2024 · 0 comments
Open
Tracked by #405

Comments

@webketje
Copy link
Member

webketje commented Feb 26, 2024

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))}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant