-
Notifications
You must be signed in to change notification settings - Fork 5
Expand file tree
/
Copy pathpage.html
More file actions
48 lines (48 loc) · 1.59 KB
/
page.html
File metadata and controls
48 lines (48 loc) · 1.59 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
{% block head %}
<!doctype html>
<html class="no-js" lang="en" dir="ltr">
<head>
<meta charset="utf-8">
<meta http-equiv="x-ua-compatible" content="ie=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>{{ page.title }} - {{SITENAME}}</title>
{% include "styles.html" %}
</head>
<body class="d-flex flex-column h-100">
<main class="flex-shrink-0">
<div>
{% include "menu.html" %}
{% include "generic.html" %}
{% include "footer.html" %}
</div>
</main>
<script>
document.addEventListener("DOMContentLoaded", () => {
function decodeHtmlEntities(str) {
const txt = document.createElement("textarea");
txt.innerHTML = str;
return txt.value;
}
document.querySelectorAll("pre > code.language-mermaid").forEach((code, i) => {
let decoded = decodeHtmlEntities(code.innerHTML);
// Normalize whitespace
decoded = decoded.replace(/\t/g, " ");
decoded = decoded.replace(/^\s*\n/, "").replace(/\n\s*$/, "");
const div = document.createElement("div");
div.className = "mermaid";
div.textContent = decoded;
code.parentElement.replaceWith(div);
console.log(`=== Mermaid block ${i} ===`);
console.log(decoded);
});
// Mermaid v10+ runs asynchronously
mermaid.run({ querySelector: ".mermaid" })
.catch(err => {
console.error("Mermaid rendering failed:", err);
});
});
</script>
<script>hljs.highlightAll();</script>
</body>
</html>
{% endblock %}