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

assign data.path where undefined #66

Closed
wants to merge 1 commit into from
Closed

assign data.path where undefined #66

wants to merge 1 commit into from

Conversation

leviwheatcroft
Copy link
Member

Just a suggestion for a solution to the conflict with metalsmith-path and metalsmith-paths, and maybe more acceptable solution than #62

I get that plugins should do one thing well, but I don't think this plugin is trying to be a replacement for those other plugins just by adding path to the meta data. the behaviour of this plugin pretty much requires the path property in the meta.

@bashaus
Copy link
Contributor

bashaus commented Oct 21, 2016

Hi @leviwheatcroft -

I did have this idea as well, but I think the problem with this is there might be conflicts as to which one is loaded first - and there is no guarantee that it would be loaded in any particular order.

The other thing is that each plugin in metalsmith is supposed to be as simple as possible - so you can use multiple plugins instead of having one behemoth plugin that tries to do too many things.

So I'm going to recommend against this.

@leviwheatcroft
Copy link
Member Author

Hey @bashaus,

Regarding the load order, I don't really see the problem... if another plugin like metalsmith-path is called earlier then path property isn't overwritten, and calling another plugin after this one would have no effect regardless. Yes someone might expect this plugin to over write the path property, but that would be counter intuitive given that they would have explicitly set the path property with another plugin.

I understand your perspective regarding simple plugins, and tried to address this in my top comment. You could say plugins should be as simple as possible, but I think it's more apt to say plugins should do one thing. In that context, if metalsmith-collections does not set data.path then it fails this requirement, because while it may create the collection object in global meta that object isn't useful without the path property for most use cases.

Simplifying a plugin to the point at which an additional plugin is imposed on users is, in my opinion, the antithesis of simple plugins.

In any case, I'm a newcomer to metalsmith so more than happy to defer to your and the maintainer's experience here.

@woodyrew
Copy link
Member

Merged, Conflicts resolved

@woodyrew woodyrew closed this Oct 17, 2018
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.

None yet

3 participants