serve blogs in correct order

Signed-off-by: Ari Archer <ari.web.xyz@gmail.com>
This commit is contained in:
Ari Archer 2023-08-29 10:38:24 +03:00
parent 5ee00714cd
commit 6596a19e29

View file

@ -40,9 +40,7 @@ async function main() {
FETCH_BLOG_POSTS().then((j) => { FETCH_BLOG_POSTS().then((j) => {
blog.innerText = ""; blog.innerText = "";
Object.entries(j) Object.entries(j).forEach((post) => {
.reverse()
.forEach((post) => {
let id = post[0]; let id = post[0];
post = post[1]; post = post[1];
@ -57,14 +55,11 @@ async function main() {
new Date(post["time"] * 1000).toUTCString(), new Date(post["time"] * 1000).toUTCString(),
], ],
null, null,
{ href: `${BLOG_SITE}/b/${id}` } { href: `${BLOG_SITE}/b/${id}` },
),
mkelem(
"pre",
linkify(post["content"]).concat([" ..."])
), ),
mkelem("pre", linkify(post["content"]).concat([" ..."])),
], ],
blog blog,
); );
}); });
}); });
@ -86,7 +81,7 @@ async function main() {
}), }),
mkelem("pre", linkify(post[1], COMMENT_SITE)), mkelem("pre", linkify(post[1], COMMENT_SITE)),
], ],
comment comment,
); );
}); });
}); });