Description
I just found out about Metalsmith while looking for alternatives to Jekyll that don't require me to put frontmatter in my markup files and so far my reaction has been... wow. You managed to capture the essence of a static site generator, and distill it down into ~345 lines of code. Seriously. I haven't been this impressed with the sheer simplicity of a project's architecture since I looked at the internals of Rack. Maybe my opinion will change once I actually try to start using Metalsmith, but for now I have to say... this looks pretty awesome.
Anyway, back to the issue at hand. While reading Metalsmith's source code, I noticed that the code which reads the YAML frontmatter into the file metadata smells suspiciously like a plugin. It takes the file data in, mutates it (adding metadata, truncating the contents), and returns.
Would you be okay with a PR which extracts that code to a plugin? Obviously it would have to be enabled by default, as there are likely plugins in the wild which rely on that metadata being present, but it still seems like a worthwhile refactoring. Also, is there anything special I should be aware of when writing such a PR? Thanks.