Closed dillonbheadley closed 8 years ago
This seems like the sort of thing that'd be best to do with a plugin further down the pipe. After .use(frontmatter())
, add another plugin that reads the metadata from existing files and replaces references to other YAML files with the parsed contents of those files.
That's one of the really nice things about Metalsmith; it's easy to add extra steps like this to customize the build to your liking.
If you need an example to help you get started, metalsmith-metafiles
does something similar (though not quite the same), so you could reference the source code of that plugin when writing yours.
Or alternately maybe an existing plugin like metalsmith-metadata
might do what you want. (It adjusts global metadata though, not per-file metadata.)
Something like: books.md:
Would that be possible? That way we could have a separate source of data that could be referenced by multiple files as needed.