assemble.io
assemble.io copied to clipboard
Sorting collection via task options example does not work
Note: this issue is related to #126, but it is not the same. #126 about "withSort" helper usage and this one about task options usage.
The collection sorting example (http://assemble.io/docs/Collections.html) looks like this:
assemble: {
options: {
pages: [
{data: {title: 'Post #1' }, content: '{{md "blog/post1.md"}}' },
{data: {title: 'Post #2' }, content: '{{md "blog/post2.md"}}' },
],
collections: [
{
title: 'pages',
sortorder: 'desc'
}
]
}
}
Similar example is for "tags" collection. Such configuration (with title: 'pages') does not work and name: "pages" should be used instead:
assemble: {
options: {
pages: [
{data: {title: 'Post #1' }, content: '{{md "blog/post1.md"}}' },
{data: {title: 'Post #2' }, content: '{{md "blog/post2.md"}}' },
],
collections: [
{
name: 'pages',
sortorder: 'desc'
}
]
}
}
There's a pending PR on the assemble repo that might fix this. I'll be taking a look at it today.