feat(meditations): thanks djikstra
This commit is contained in:
parent
ecc52ce002
commit
b83f17d087
4 changed files with 110 additions and 3 deletions
|
|
@ -122,6 +122,8 @@ const getTopicColor = (topicName) => {
|
|||
return "#009975";
|
||||
case "algorithms":
|
||||
return "#d50032";
|
||||
case "meditations":
|
||||
return "#6a0dad";
|
||||
default:
|
||||
return "#000000";
|
||||
}
|
||||
|
|
|
|||
|
|
@ -19,6 +19,7 @@ const postMapping = new Map([
|
|||
"models of production",
|
||||
],
|
||||
],
|
||||
["meditations", ["the problem with cs curricula"]],
|
||||
]);
|
||||
|
||||
function refresh(e) {
|
||||
|
|
@ -42,10 +43,10 @@ function renderPosts(topic) {
|
|||
|
||||
// Normalize topic for lookup (in case it has spaces, like "operating systems")
|
||||
const normalizedTopic = topic.trim();
|
||||
|
||||
|
||||
// Get posts for this topic
|
||||
const topicPosts = postMapping.get(normalizedTopic);
|
||||
|
||||
|
||||
if (!topicPosts) {
|
||||
console.error(`No posts found for topic: ${normalizedTopic}`);
|
||||
return;
|
||||
|
|
@ -59,7 +60,7 @@ function renderPosts(topic) {
|
|||
|
||||
const link = document.createElement("a");
|
||||
const postLink = postName.toLowerCase().replace(/\s+/g, "-");
|
||||
|
||||
|
||||
// Convert topic to URL-friendly format
|
||||
const topicSlug = normalizedTopic.toLowerCase().replace(/\s+/g, "-");
|
||||
link.href = `/posts/${topicSlug}/${postLink}.html`;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue