Sort frontmatter according to the fields order in config file. Closes #215

This commit is contained in:
Cássio Zen
2017-01-19 12:09:18 -02:00
parent 01e11e9213
commit b64259cb5a
3 changed files with 20 additions and 5 deletions

View File

@ -202,7 +202,8 @@ class Backend {
entryToRaw(collection, entry) {
const format = resolveFormat(collection, entry);
return format && format.toFile(entry);
const fieldsOrder = collection.get('fields').map(f => f.get('name')).toArray();
return format && format.toFile(entry, fieldsOrder);
}
}