feat: prettier
This commit is contained in:
parent
0b8cb4f0bc
commit
9f5fa03ff0
2 changed files with 7 additions and 4 deletions
|
|
@ -76,7 +76,10 @@
|
||||||
const div = document.createElement("div");
|
const div = document.createElement("div");
|
||||||
div.className = "post";
|
div.className = "post";
|
||||||
const a = document.createElement("a");
|
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.href = `/posts/${topic}/${slug}.html`;
|
||||||
a.textContent = post.data.title;
|
a.textContent = post.data.title;
|
||||||
a.style.textDecoration = "underline";
|
a.style.textDecoration = "underline";
|
||||||
|
|
@ -173,7 +176,7 @@
|
||||||
"";
|
"";
|
||||||
if (color) link.style.color = color;
|
if (color) link.style.color = color;
|
||||||
},
|
},
|
||||||
true
|
true,
|
||||||
);
|
);
|
||||||
|
|
||||||
document.body.addEventListener(
|
document.body.addEventListener(
|
||||||
|
|
@ -183,7 +186,7 @@
|
||||||
if (!link) return;
|
if (!link) return;
|
||||||
if (!link.classList.contains("active")) link.style.color = "";
|
if (!link.classList.contains("active")) link.style.color = "";
|
||||||
},
|
},
|
||||||
true
|
true,
|
||||||
);
|
);
|
||||||
|
|
||||||
window.addEventListener("beforeunload", () => {
|
window.addEventListener("beforeunload", () => {
|
||||||
|
|
|
||||||
|
|
@ -11,4 +11,4 @@ export function getTopicColor(topicName) {
|
||||||
default:
|
default:
|
||||||
return "#000000";
|
return "#000000";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue