Pray this works

This commit is contained in:
bingus_violet 2024-07-07 23:27:13 -05:00
parent 3f032510f0
commit 547cf0665f

View file

@ -13,6 +13,7 @@ const defaultConfig = {
module.exports = { module.exports = {
blogPosts: () => { blogPosts: () => {
var posts = [] var posts = []
var pinned = []
var dir = fs.readdirSync(paths.posts) var dir = fs.readdirSync(paths.posts)
dir.sort(function(a, b) { dir.sort(function(a, b) {
@ -39,14 +40,13 @@ module.exports = {
} }
if (config.pinned) { if (config.pinned) {
posts.push(config) pinned.unshift(config)
} else { } else {
posts.unshift(config) posts.unshift(config)
} }
} }
} }
posts.reverse() return pinned + posts
return posts
} }
} }