From 6596a19e293bdebd0752893b3fe581befb228430 Mon Sep 17 00:00:00 2001 From: Ari Archer Date: Tue, 29 Aug 2023 10:38:24 +0300 Subject: [PATCH] serve blogs in correct order Signed-off-by: Ari Archer --- content/js/index/index.js | 49 ++++++++++++++++++--------------------- 1 file changed, 22 insertions(+), 27 deletions(-) diff --git a/content/js/index/index.js b/content/js/index/index.js index b0cbc7b..c5137c6 100644 --- a/content/js/index/index.js +++ b/content/js/index/index.js @@ -40,33 +40,28 @@ async function main() { FETCH_BLOG_POSTS().then((j) => { blog.innerText = ""; - Object.entries(j) - .reverse() - .forEach((post) => { - let id = post[0]; - post = post[1]; + Object.entries(j).forEach((post) => { + let id = post[0]; + post = post[1]; - mkelem( - "li", - [ - mkelem( - "a", - [ - post["title"], - " -- ", - new Date(post["time"] * 1000).toUTCString(), - ], - null, - { href: `${BLOG_SITE}/b/${id}` } - ), - mkelem( - "pre", - linkify(post["content"]).concat([" ..."]) - ), - ], - blog - ); - }); + mkelem( + "li", + [ + mkelem( + "a", + [ + post["title"], + " -- ", + new Date(post["time"] * 1000).toUTCString(), + ], + null, + { href: `${BLOG_SITE}/b/${id}` }, + ), + mkelem("pre", linkify(post["content"]).concat([" ..."])), + ], + blog, + ); + }); }); FETCH_COMMENTS().then((j) => { @@ -86,7 +81,7 @@ async function main() { }), mkelem("pre", linkify(post[1], COMMENT_SITE)), ], - comment + comment, ); }); });