diff --git a/node/blog.js b/node/blog.js index 9a76d2d..4474539 100644 --- a/node/blog.js +++ b/node/blog.js @@ -29,40 +29,39 @@ function createBlogPages(folder) { let json = JSON.parse(data); for (let i = 0; i < json.length; i++) { let post = json[i]; - let id = post["id"]; - fs.readFile(folder + "blog/" + id + ".md", function (_, content) { + fs.readFile(folder + "blog/" + post.id + ".md", function (_, content) { let dom = new JSDOM(template); var document = dom.window.document; - document.title += " - " + post["name"]; - document.querySelector('meta[property="og:title"]').setAttribute("content", post["name"]); - document.querySelector('meta[name="description"]').setAttribute("content", post["summary"]); - document.querySelector('meta[property="og:description"]').setAttribute("content", post["summary"]); + document.title += " - " + post.name; + document.querySelector('meta[property="og:title"]').setAttribute("content", post.name); + document.querySelector('meta[name="description"]').setAttribute("content", post.summary); + document.querySelector('meta[property="og:description"]').setAttribute("content", post.summary); var nav = ""; nav += 'Back to Main Page'; if (i > 0) - nav += 'Previous Post'; + nav += 'Previous Post'; if (i < json.length - 1) - nav += 'Next Post'; + nav += 'Next Post'; document.getElementById("nav-items").innerHTML = nav; var c = ""; c += '
';
- a += 'Q: ' + question["q"] + '
';
- a += 'A: ' + question["a"];
+ a += 'Q: ' + question.q + '
';
+ a += 'A: ' + question.a;
a += '
' + project["desc"] + '
'; - if (project["status"]) - p += '' + project["status"] + ''; + p += '' + project.desc + '
'; + if (project.status) + p += '' + project.status + ''; - let links = project["links"]; - if (links) { - for (let name in links) { - p += '' + name + ''; + if (project.links) { + for (let name in project.links) { + p += '' + name + ''; } } diff --git a/scripts/social.js b/scripts/social.js index 93b535c..0bbb8f5 100644 --- a/scripts/social.js +++ b/scripts/social.js @@ -37,12 +37,12 @@ const socials = [{ let s = ''; for (social of socials) { - s += ''; - let icon = social["name"].toLowerCase(); - if (dark && social["darkIcon"]) + s += ''; + let icon = social.name.toLowerCase(); + if (dark && social.darkIcon) icon += '_dark'; s += ''; - s += social["name"]; + s += social.name; s += '' } $('#social-list').html(s);