From 547cf0665fe70cc8eaef9688d1679795f215f12b Mon Sep 17 00:00:00 2001 From: bingus_violet Date: Sun, 7 Jul 2024 23:27:13 -0500 Subject: [PATCH] Pray this works --- blog.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/blog.js b/blog.js index 8ba5779..c6fbc14 100644 --- a/blog.js +++ b/blog.js @@ -13,6 +13,7 @@ const defaultConfig = { module.exports = { blogPosts: () => { var posts = [] + var pinned = [] var dir = fs.readdirSync(paths.posts) dir.sort(function(a, b) { @@ -39,14 +40,13 @@ module.exports = { } if (config.pinned) { - posts.push(config) + pinned.unshift(config) } else { posts.unshift(config) } } } - posts.reverse() - return posts + return pinned + posts } }