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

Plugins order in metalsmith.json #21

Closed
velocityzen opened this issue Mar 15, 2014 · 4 comments
Closed

Plugins order in metalsmith.json #21

velocityzen opened this issue Mar 15, 2014 · 4 comments
Labels

Comments

@velocityzen
Copy link

Plugins section:

"plugins": {
    "metalsmith-drafts": true,
    "metalsmith-markdown": true,
    "metalsmith-permalinks": "posts/:title",
    "metalsmith-templates": "handlebars"
  }

according to ECMAScript specification: The mechanics and order of enumerating the properties ... is not specified.
Here must be an array.

@esundahl
Copy link

Pretty sure it's guaranteed in node. Properties are enumerated in the order they are defined.

@ianstormtaylor
Copy link
Contributor

if it ever becomes a problem i'm down to change it up, but for as long as we can get away with it i like the simplicity of an object over an array :)

@ghost
Copy link

ghost commented Apr 10, 2014

@esundahl Not completely sure if there are pure numbers.

var obj = {
  "first":"first",
  "2":"2",
  "34":"34",
  "1":"1",
  "second":"second"
};
for (var i in obj) { console.log(i); };
// Order listed:
// "1"
// "2"
// "34"
// "first"
// "second"

Anyway, who will use numbers as plugin names?

@esundahl
Copy link

ahh, good to know. thanks @jakwings

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

No branches or pull requests

3 participants