diff --git a/about.html b/about.html index 404b493..ffedbaa 100644 --- a/about.html +++ b/about.html @@ -10,7 +10,7 @@ Barrett Ruth - +
diff --git a/index.html b/index.html index 6772c4e..866c574 100644 --- a/index.html +++ b/index.html @@ -9,7 +9,7 @@ Barrett Ruth - +
diff --git a/posts/algorithms/two-pointers.html b/posts/algorithms/two-pointers.html index 081c89e..056b48a 100644 --- a/posts/algorithms/two-pointers.html +++ b/posts/algorithms/two-pointers.html @@ -19,7 +19,7 @@ > Barrett Ruth - +
(window.location.href = "/")); } -function getTopicColor(topicName) { +const getTopicColor = (topicName) => { switch (topicName) { case "software": return "#0073e6"; @@ -40,4 +40,6 @@ function getTopicColor(topicName) { case "algorithms": return "#6a0dad"; } -} +}; + +const urlToTopic = () => window.location.pathname.split("/")[2]; diff --git a/scripts/index.js b/scripts/index.js index fbae034..ae96124 100644 --- a/scripts/index.js +++ b/scripts/index.js @@ -12,7 +12,7 @@ const postMapping = new Map([ [ { name: "models of production", link: "models-of-production" }, { name: "the short run" }, - { name: "to invest or not to invest" }, + { name: "in the aggregate" }, ], ], ["Trading", [{ name: "InteractiveBrokers TWS" }, { name: "valuation" }]], @@ -23,7 +23,7 @@ const postMapping = new Map([ ]); function refresh(e) { - e.preventDefault(); + if (window.location.pathname !== "/") e.preventDefault(); const topics = document.querySelectorAll(".topic a"); diff --git a/scripts/post.js b/scripts/post.js index 6925aa0..bd408af 100644 --- a/scripts/post.js +++ b/scripts/post.js @@ -1,7 +1,3 @@ -const urlToTopic = () => { - return new URL(window.location.href).pathname.split("/")[2]; -}; - document.documentElement.style.setProperty( "--topic-color", getTopicColor(urlToTopic()), diff --git a/styles/common.css b/styles/common.css index 37f9fe5..de1c1ff 100644 --- a/styles/common.css +++ b/styles/common.css @@ -49,7 +49,7 @@ li { margin-bottom: 10px; } -.graph { +.graph-background { background-image: linear-gradient( to right, rgba(200, 200, 200, 0.4) 1px,