diff options
author | altaf-creator <dev@altafcreator.com> | 2024-06-09 22:31:41 +0700 |
---|---|---|
committer | altaf-creator <dev@altafcreator.com> | 2024-06-09 22:31:41 +0700 |
commit | 18775fb340b3aaefec0870ab36d1aefd2a44c3ae (patch) | |
tree | 5d50e40d97e31b1238e4925a99b556c48d057a6b /scripts | |
parent | d607ac12097afb5cb6f398a4e7b5cf4316efedc6 (diff) |
blog desc, academic, simpliCity page improvements (unfinished)
Diffstat (limited to 'scripts')
-rw-r--r-- | scripts/blog.js | 9 | ||||
-rw-r--r-- | scripts/onload.js | 5 |
2 files changed, 11 insertions, 3 deletions
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();
+}
|