Initial import of Hugo site to Forgejo
This commit is contained in:
commit
cb1ba0317f
1259 changed files with 236349 additions and 0 deletions
21
static/js/init-mermaid-umd.js
Normal file
21
static/js/init-mermaid-umd.js
Normal file
|
|
@ -0,0 +1,21 @@
|
|||
(function () {
|
||||
function render() {
|
||||
const nodes = document.querySelectorAll('.mermaid');
|
||||
console.log('[mermaid] nodes on page:', nodes.length);
|
||||
|
||||
if (!window.mermaid) {
|
||||
console.error('[mermaid] window.mermaid is missing');
|
||||
return;
|
||||
}
|
||||
window.mermaid.initialize({ startOnLoad: false });
|
||||
window.mermaid.run({ querySelector: '.mermaid' });
|
||||
console.log('[mermaid] run() called');
|
||||
}
|
||||
|
||||
if (document.readyState === 'loading') {
|
||||
document.addEventListener('DOMContentLoaded', render, { once: true });
|
||||
} else {
|
||||
render();
|
||||
}
|
||||
})();
|
||||
|
||||
Loading…
Add table
Add a link
Reference in a new issue