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 ++++++--- scripts/onload.js | 5 +++++ 2 files changed, 11 insertions(+), 3 deletions(-) (limited to 'scripts') 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; diff --git a/scripts/onload.js b/scripts/onload.js index 9d9226e..10dcf1d 100644 --- a/scripts/onload.js +++ b/scripts/onload.js @@ -18,3 +18,8 @@ function blog(n) { // addNodes is called in loadPost(n); loadPost(n); } + +function index() { + postList(2); + addNodes(); +} -- cgit v1.2.3