fix: popular posts sort

This commit is contained in:
Cory Dransfeldt 2023-08-28 15:02:28 -07:00
parent 8b61b7783b
commit 008a0393c8
No known key found for this signature in database
2 changed files with 19 additions and 2 deletions

View file

@ -31,7 +31,7 @@ module.exports = {
if (analytics.find((p) => p.url.includes(post.url))) return true
})
.sort((a, b) => {
const visitors = (page) => analytics.filter((p) => p.url.includes(page.url)).pop().value
const visitors = (page) => analytics.filter((p) => p.url.includes(page.url)).pop().rank
return visitors(b) - visitors(a)
})
},