From ac692d402a9f94459d9000805044ebcc29dc3a20 Mon Sep 17 00:00:00 2001 From: Ellpeck Date: Thu, 24 Jun 2021 00:23:02 +0200 Subject: [PATCH] actually remove the anchors code lmao --- scripts/blog.js | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/scripts/blog.js b/scripts/blog.js index d612f64..d3af4c3 100644 --- a/scripts/blog.js +++ b/scripts/blog.js @@ -23,23 +23,21 @@ $.ajax({ function populateBlog(json, currentCategory) { const currCat = currentCategory; - let anchors = $('#blog-cat-anchors'); let archive = $('#blog-archive'); let list = $('#blog-list'); let cats = $('#blog-cats'); - anchors.html(""); archive.html(""); list.html(""); cats.html(""); // force all and featured categories to be first - addCategory(json, cats, anchors, "All Posts", currCat); - addCategory(json, cats, anchors, "Featured", currCat); + addCategory(json, cats, "All Posts", currCat); + addCategory(json, cats, "Featured", currCat); for (let i = json.length - 1; i >= 0; i--) { let post = json[i]; for (let cat of post.cat) - addCategory(json, cats, anchors, cat, currCat); + addCategory(json, cats, cat, currCat); if (currCat === "all-posts" || post.cat.some(c => c.toLowerCase().replace(" ", "-") === currCat)) { let p = /*html*/ `
@@ -65,7 +63,7 @@ function populateBlog(json, currentCategory) { populateBlog(json, "featured"); } -function addCategory(json, cats, anchors, cat, currCat) { +function addCategory(json, cats, cat, currCat) { let catId = cat.toLowerCase().replace(" ", "-"); let catAnchor = `blog-cat-${catId}`; if (!$(`#${catAnchor}`).length) { @@ -74,6 +72,5 @@ function addCategory(json, cats, anchors, cat, currCat) { populateBlog(json, catId); history.replaceState(null, null, `#blog-${catId}`); }); - anchors.append( /*html*/ ``); } } \ No newline at end of file