collections icon indicating copy to clipboard operation
collections copied to clipboard

Added 'newer' and 'older' references

Open seinolab opened this issue 7 years ago • 0 comments

I propose new references 'newer' and 'older'. These references keep chronological order. In other words, they are free from 'reverse' setting.

Consider the following example. Some users need both of the latest and oldest ordered collections. In such case, 'previous' and 'next' references are broken because the references are overwritten, but 'newer' and 'older' work correctly.

metalsmith.use(collections({
  latest: {
    pattern: '*.md',
    sortBy: 'date',
    reverse: true
  },
  oldest: {
    pattern: '*.md',
    sortBy: 'date',
    reverse: false
  }
}));

seinolab avatar Jul 07 '18 00:07 seinolab