Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

@deltamualpha
Copy link
Contributor

When using metalsmith-metadata with watchers like watch() or browserSync() that perform partial rebuilds of content, the plugin throws errors because the json/yaml files it's looking for aren't part of the partial bundle of files. However, in these cases, we're generally ok, because the work has already been done and the key exists in the metadata already.

This pull request makes it so the plugin passes safely in this case, while still parsing and proceeding with overwriting an existing key if the json/yaml file in question is in the file list passed to it. It also adds tests for this behavior.

...and the file hasn't been explicitly passed to you. This prevents
errors when working with watch() or browserSync() plugins, since
those generally only pass a subset of the source directory through
an existing metalsmith object.
@deltamualpha
Copy link
Contributor Author

This might also solve the issue that #4 was targeting, since that PR doesn't make a lot of sense outside of the context of a partial listing of files being passed through files

@deltamualpha
Copy link
Contributor Author

Not to be a pest, @ianstormtaylor, but is this plugin even accepting PRs?

@levjj
Copy link

levjj commented Nov 7, 2015

Thanks @deltamualpha! This PR makes metalsmith-metadata compatible with metalsmith-watch (otherwise, it just throws errors at each change).
I wonder why this hasn't been merged yet.

@oupala
Copy link

oupala commented Nov 13, 2015

Too bad it hasn't been merged until now.

Please @ianstormtaylor or @lambtron merge that !

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants