Skip to content

Commit 44c697e

Browse files
committed
Updated buttons
1 parent 9909b02 commit 44c697e

4 files changed

Lines changed: 12 additions & 7 deletions

File tree

about.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ <h2>Tech Stack</h2>
5858
<footer id="footer-placeholder"></footer>
5959

6060
<script src="js/theme.js"></script>
61-
<script src="js/header-footer.js"></script>
61+
<script src="js/header-footer.js"></script>
6262
</body>
6363

6464
</html>

index.html

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,6 @@
2121
<p>Welcome! This is where I share random ideas and stuff I created about school, life, etc. (Not any type of
2222
category that I want to fall into, journal, diary, because it would feel kind of restrictive on 'how'/'what'
2323
should I write about anything.)</p>
24-
<button id="theme-toggle">Dark Mode</button>
2524
</div>
2625
</header>
2726

js/main.js

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,13 @@
11
document.addEventListener("DOMContentLoaded", () => {
22
const container = document.getElementById("posts-list");
33

4-
fetch("metadata/entries.json")
5-
.then((res) => res.json())
4+
fetch("/posts/metadata/entries.json")
5+
.then((res) => {
6+
if (!res.ok) {
7+
throw new Error(`HTTP error ${res.status}`);
8+
}
9+
return res.json();
10+
})
611
.then((posts) => {
712
posts.forEach((post) => {
813
const entry = document.createElement("div");
@@ -22,5 +27,9 @@ document.addEventListener("DOMContentLoaded", () => {
2227

2328
container.appendChild(entry);
2429
});
30+
})
31+
.catch((err) => {
32+
console.error("Failed to load blog entries:", err);
33+
container.innerHTML = "<p>Unable to load posts at this time.</p>";
2534
});
2635
});

post.html

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,6 @@
1818

1919
<body>
2020
<header id="header-placeholder"></header>
21-
22-
<button id="theme-toggle">Dark Mode</button>
2321
<main>
2422
<article id="post-content">
2523
<!-- Post content dynamically loaded here -->
@@ -40,7 +38,6 @@ <h1>Blog</h1>
4038
<script src="https://cdn.jsdelivr.net/npm/mathjax@3/es5/tex-mml-chtml.js" async></script>
4139
<script src="js/posts.js"></script>
4240
<script src="js/theme.js"></script>
43-
<script src="js/main.js"></script>
4441
<script src="js/header-footer.js"></script>
4542

4643
</body>

0 commit comments

Comments
 (0)