feat: misc cleanups

This commit is contained in:
Barrett Ruth 2025-04-02 14:45:33 -04:00
parent 2c617c21c7
commit 255563f267
4 changed files with 21 additions and 10 deletions

View file

@ -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];
};