Compare commits
5 Commits
897015f3f2
...
605aaab747
Author | SHA1 | Date |
---|---|---|
Shadowfacts | 605aaab747 | |
Shadowfacts | bc280943f3 | |
Shadowfacts | 6c6fa182af | |
Shadowfacts | 3c5995cf02 | |
Shadowfacts | 6b276fdbe0 |
|
@ -32,7 +32,8 @@ md.core.ruler.push("anchor", (state) => {
|
||||||
attrs: [
|
attrs: [
|
||||||
["class", "header-anchor"],
|
["class", "header-anchor"],
|
||||||
["href", "#" + slug],
|
["href", "#" + slug],
|
||||||
["aria-hidden", "true"]
|
["aria-hidden", "true"],
|
||||||
|
["role", "presentation"]
|
||||||
]
|
]
|
||||||
}),
|
}),
|
||||||
Object.assign(new state.Token("html_block", "", 0), { content: token.markup }),
|
Object.assign(new state.Token("html_block", "", 0), { content: token.markup }),
|
||||||
|
@ -46,4 +47,4 @@ md.core.ruler.push("anchor", (state) => {
|
||||||
|
|
||||||
export function render(text: string): string {
|
export function render(text: string): string {
|
||||||
return md.render(text);
|
return md.render(text);
|
||||||
}
|
}
|
||||||
|
|
|
@ -4,7 +4,7 @@
|
||||||
// Fonts
|
// Fonts
|
||||||
$sansSerif: Avenir, Lucida Grande, Arial, sans-serif;
|
$sansSerif: Avenir, Lucida Grande, Arial, sans-serif;
|
||||||
$serif: Charter, Georgia, serif;
|
$serif: Charter, Georgia, serif;
|
||||||
$monospace: SF Mono, Courier New, monospace;
|
$monospace: SF Mono, monospace;
|
||||||
|
|
||||||
// General
|
// General
|
||||||
body {
|
body {
|
||||||
|
@ -91,7 +91,9 @@ article {
|
||||||
font-family: $monospace;
|
font-family: $monospace;
|
||||||
color: var(--accent-color);
|
color: var(--accent-color);
|
||||||
user-select: none;
|
user-select: none;
|
||||||
|
text-decoration: none;
|
||||||
|
|
||||||
|
// hide link destination for header anchor links
|
||||||
&::before, &::after { content: ""; }
|
&::before, &::after { content: ""; }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -114,17 +116,11 @@ article {
|
||||||
font-family: $monospace;
|
font-family: $monospace;
|
||||||
color: var(--secondary-ui-text-color);
|
color: var(--secondary-ui-text-color);
|
||||||
}
|
}
|
||||||
pre {
|
pre code::before,
|
||||||
&::before, &::after {
|
pre code::after {
|
||||||
content: "```";
|
// we don't show the decorations for pre blocks, because it can interfere with scrolling horizontally
|
||||||
display: block;
|
content: "";
|
||||||
background: none;
|
display: none;
|
||||||
color: var(--secondary-ui-text-color);
|
|
||||||
}
|
|
||||||
code::before, code::after {
|
|
||||||
content: "";
|
|
||||||
display: none;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
strong::before, strong::after {
|
strong::before, strong::after {
|
||||||
content: "**";
|
content: "**";
|
||||||
|
@ -285,8 +281,8 @@ a {
|
||||||
}
|
}
|
||||||
|
|
||||||
pre {
|
pre {
|
||||||
overflow: scroll;
|
overflow-x: scroll;
|
||||||
|
|
||||||
-moz-tab-size: 4;
|
-moz-tab-size: 4;
|
||||||
-o-tab-size: 4;
|
-o-tab-size: 4;
|
||||||
tab-size: 4;
|
tab-size: 4;
|
||||||
|
|
|
@ -8,11 +8,10 @@ Modified to use colors from CSS vars, defined in theme.scss
|
||||||
overflow-x: auto;
|
overflow-x: auto;
|
||||||
padding: 0.5em;
|
padding: 0.5em;
|
||||||
color: var(--atom-mono-1);
|
color: var(--atom-mono-1);
|
||||||
|
background: var(--atom-base);
|
||||||
}
|
}
|
||||||
|
|
||||||
.hljs > code {
|
.hljs > code {
|
||||||
background: var(--atom-base);
|
|
||||||
display: block;
|
display: block;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -83,4 +82,4 @@ Modified to use colors from CSS vars, defined in theme.scss
|
||||||
|
|
||||||
.hljs-link {
|
.hljs-link {
|
||||||
text-decoration: underline;
|
text-decoration: underline;
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,4 +1,12 @@
|
||||||
fetchComments();
|
let commentsLoaded = false;
|
||||||
|
const details = document.getElementById("comments-container");
|
||||||
|
details.addEventListener("toggle", (even) => {
|
||||||
|
if (details.open && !commentsLoaded) {
|
||||||
|
fetchComments().then(() => {
|
||||||
|
commentsLoaded = true;
|
||||||
|
});
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
async function fetchComments() {
|
async function fetchComments() {
|
||||||
const res = await fetch(`/comments?id=${permalink}`);
|
const res = await fetch(`/comments?id=${permalink}`);
|
||||||
|
|
Loading…
Reference in New Issue