diff --git a/public/scripts/index.js b/public/scripts/index.js index e176442..e6076d6 100644 --- a/public/scripts/index.js +++ b/public/scripts/index.js @@ -76,7 +76,10 @@ const div = document.createElement("div"); div.className = "post"; const a = document.createElement("a"); - const slug = post.id.split("/").pop().replace(/\.mdx?$/, ""); + const slug = post.id + .split("/") + .pop() + .replace(/\.mdx?$/, ""); a.href = `/posts/${topic}/${slug}.html`; a.textContent = post.data.title; a.style.textDecoration = "underline"; @@ -173,7 +176,7 @@ ""; if (color) link.style.color = color; }, - true + true, ); document.body.addEventListener( @@ -183,7 +186,7 @@ if (!link) return; if (!link.classList.contains("active")) link.style.color = ""; }, - true + true, ); window.addEventListener("beforeunload", () => { diff --git a/src/utils/colors.js b/src/utils/colors.js index 91e8819..1ca1177 100644 --- a/src/utils/colors.js +++ b/src/utils/colors.js @@ -11,4 +11,4 @@ export function getTopicColor(topicName) { default: return "#000000"; } -} \ No newline at end of file +}