1
0
Fork 0
mirror of https://github.com/GuerillaStudio/vanillalist.git synced 2024-12-30 11:51:57 +00:00

Sort plugins by id

This commit is contained in:
Tixie 2022-01-03 15:04:54 +01:00
parent 04f8d612da
commit d42952bef6

View file

@ -18,7 +18,7 @@ module.exports = function (eleventyConfig) {
return fs.promises.readFile(filename, { encoding: 'utf-8' }) return fs.promises.readFile(filename, { encoding: 'utf-8' })
}) })
const plugins = await Promise.all(files) const plugins = await Promise.all(files)
return plugins.map(JSON.parse).sort((a, b) => new Date(b.date) - new Date(a.date)) return plugins.map(JSON.parse).sort((a, b) => b.id - a.id)
}); });
eleventyConfig.addFilter('JSONstringify', (value) => { eleventyConfig.addFilter('JSONstringify', (value) => {