From 18775fb340b3aaefec0870ab36d1aefd2a44c3ae Mon Sep 17 00:00:00 2001 From: altaf-creator Date: Sun, 9 Jun 2024 22:31:41 +0700 Subject: blog desc, academic, simpliCity page improvements (unfinished) --- scripts/blog.js | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'scripts/blog.js') diff --git a/scripts/blog.js b/scripts/blog.js index 65fc02e..bbded40 100644 --- a/scripts/blog.js +++ b/scripts/blog.js @@ -11,9 +11,10 @@ function postList(n = 0) { } // i ❤ for loops - for (var i = n - 1; i >= 0; i--) { - console.log("dkfjlaafjsdk" + i) - postCard(data.posts[i]); + for (var i = data.posts.length - 1; i >= 0; i--) { + if (i >= data.posts.length - n) { + postCard(data.posts[i]); + } } }); } @@ -80,12 +81,14 @@ function loadPost(n) { var date = document.getElementById("date"); var author = document.getElementById("author"); var tags = document.getElementById("tag-container"); + var description = document.getElementById("description"); var content = document.getElementById("content"); banner.src = post.banner; title.innerHTML = post.title; date.innerHTML = post.date; author.innerHTML = post.author; + description.innerHTML = post.description; post.tags.forEach(createTags); tags.innerHTML = evaluatedTags; -- cgit v1.2.3