summaryrefslogtreecommitdiff
path: root/scripts/blog.js
diff options
context:
space:
mode:
Diffstat (limited to 'scripts/blog.js')
-rw-r--r--scripts/blog.js9
1 files changed, 6 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;