Add Zola templates and browser-tested site scaffold
This commit is contained in:
parent
fd5fc944e6
commit
a33673243e
1 changed files with 2114 additions and 0 deletions
27
static/post.js
Normal file
27
static/post.js
Normal file
|
|
@ -0,0 +1,27 @@
|
|||
import mermaid from "/vendor/mermaid/mermaid.esm.min.mjs";
|
||||
|
||||
const diagrams = document.querySelectorAll('pre code[data-lang="mermaid"]');
|
||||
|
||||
for (const code of diagrams) {
|
||||
const diagram = document.createElement("div");
|
||||
diagram.className = "mermaid";
|
||||
diagram.textContent = code.textContent;
|
||||
code.parentElement.replaceWith(diagram);
|
||||
}
|
||||
|
||||
mermaid.initialize({
|
||||
startOnLoad: false,
|
||||
theme: "neutral",
|
||||
fontFamily: "Comic Neue",
|
||||
});
|
||||
await mermaid.run();
|
||||
|
||||
window.MathJax = {
|
||||
loader: { paths: { fonts: "/vendor/fonts" } },
|
||||
output: { font: "mathjax-fira" },
|
||||
chtml: { matchFontHeight: false },
|
||||
};
|
||||
|
||||
const script = document.createElement("script");
|
||||
script.src = "/vendor/mathjax/tex-chtml-nofont.js";
|
||||
document.head.append(script);
|
||||
Loading…
Reference in a new issue