diff --git a/about.html b/about.html index 7ffff6b..74e98ec 100644 --- a/about.html +++ b/about.html @@ -12,7 +12,11 @@
- +
barrett@ruth:~$ /about @@ -77,7 +81,8 @@ Email
- - + + + diff --git a/scripts/common.js b/scripts/common.js index bd08f6f..545a804 100644 --- a/scripts/common.js +++ b/scripts/common.js @@ -39,7 +39,13 @@ const getTopicColor = (topicName) => { return "#d50032"; case "algorithms": return "#6a0dad"; + default: + return "#000000"; } }; -const urlToTopic = () => window.location.pathname.split("/")[2]; +const urlToTopic = () => { + const pathname = window.location.pathname.split("/"); + if (pathname.length < 3) return "DNE"; + return pathname[2]; +}; diff --git a/scripts/post.js b/scripts/post.js index 85fbfae..784df23 100644 --- a/scripts/post.js +++ b/scripts/post.js @@ -1,8 +1,3 @@ -document.documentElement.style.setProperty( - "--topic-color", - getTopicColor(urlToTopic()), -); - const tagToHeader = new Map([ ["H2", "#"], ["H3", "##"], @@ -17,6 +12,11 @@ const setStyle = (h) => { }; document.addEventListener("DOMContentLoaded", () => { + document.documentElement.style.setProperty( + "--topic-color", + getTopicColor(urlToTopic()), + ); + document.querySelectorAll(".post-article h2").forEach(setStyle); document.querySelectorAll(".post-article h3").forEach(setStyle); }); diff --git a/styles/post.css b/styles/post.css index c883b7e..c8d6571 100644 --- a/styles/post.css +++ b/styles/post.css @@ -36,9 +36,9 @@ li { } .post-meta { - font-style: italic; /* space between date and title */ margin-left: 100px; + font-size: 1.3em; } .post-title {