Order tag posts by descending date

This commit is contained in:
Lewis Dale 2023-12-02 09:37:44 +00:00
parent 483d11b88d
commit e828f9f590

View File

@ -5,7 +5,7 @@ module.exports = async () => {
const cache = await postCache();
return Object.values(cache.tags).map(tag => {
const posts = Object.values(cache.posts).filter(post => post.tags.includes(tag.id));
const posts = Object.values(cache.posts).filter(post => post.tags.includes(tag.id)).sort((a, b) => new Date(b.date).getTime() - new Date(a.date).getTime());
return {
...tag,