Wave changes
This commit is contained in:
45
build-site.el
Executable file → Normal file
45
build-site.el
Executable file → Normal file
@@ -169,9 +169,9 @@ FMT / ARGS are passed to `format'."
|
||||
"kanban.css"
|
||||
"org-syntax.css"
|
||||
"misc.css"
|
||||
"toc.css"
|
||||
"media.css"
|
||||
"wird-tracker.css")
|
||||
"wird-tracker.css"
|
||||
)
|
||||
"\n")
|
||||
"\n"
|
||||
(mapconcat
|
||||
@@ -187,8 +187,23 @@ FMT / ARGS are passed to `format'."
|
||||
"svg-pan-zoom.min.js"
|
||||
"gallery-init.js"
|
||||
"sitemap-interactive.js"
|
||||
"wird-tracker.js")
|
||||
"\n"))
|
||||
"wird-tracker.js"
|
||||
)
|
||||
"\n")
|
||||
"<script src=\"/assets/scripts/mermaid.min.js\"></script>
|
||||
<script>
|
||||
window.addEventListener('load', function() {
|
||||
mermaid.initialize({ startOnLoad: false, theme: 'neutral' });
|
||||
document.querySelectorAll('.mermaid').forEach(el => {
|
||||
el.innerHTML = el.innerHTML
|
||||
.replace(/>/g, '>')
|
||||
.replace(/</g, '<')
|
||||
.replace(/&/g, '&');
|
||||
});
|
||||
mermaid.run({ querySelector: '.mermaid' });
|
||||
});
|
||||
</script>"
|
||||
)
|
||||
"Shared <head> HTML fragment injected into every page.")
|
||||
|
||||
;; ─────────────────────────────────────────────────────────────────────────────
|
||||
@@ -302,6 +317,26 @@ Created with %c on <a href=\"https://www.archlinux.org/\">Arch</a> \
|
||||
(concat body html))
|
||||
body))))
|
||||
|
||||
|
||||
;; 8.5 mermaid js support:
|
||||
|
||||
(defun z/org-html-mermaid-block (code _lang)
|
||||
"Export a mermaid src block as a mermaid div."
|
||||
(format "<div class=\"mermaid\">\n%s\n</div>" code))
|
||||
|
||||
;; Hook into ox-html's src block export
|
||||
(defun z/org-html-src-block-mermaid (orig-fun src-block contents info)
|
||||
(let ((lang (org-element-property :language src-block)))
|
||||
(if (string= lang "mermaid")
|
||||
(let ((code (org-remove-indentation
|
||||
(org-element-property :value src-block))))
|
||||
(format "<div class=\"mermaid\">\n%s\n</div>" code))
|
||||
(funcall orig-fun src-block contents info))))
|
||||
|
||||
(advice-add 'org-html-src-block :around #'z/org-html-src-block-mermaid)
|
||||
|
||||
|
||||
|
||||
;; ─────────────────────────────────────────────────────────────────────────────
|
||||
;; 9. Body-class injection (WIP / no-sidenotes)
|
||||
;; ─────────────────────────────────────────────────────────────────────────────
|
||||
@@ -706,4 +741,4 @@ A nil result means the timestamp cache is stale and we must force-republish."
|
||||
(z/log 'metric "Tag pages output: %d" (or tag-files 0))
|
||||
(z/log 'done "Build complete ✓"))
|
||||
|
||||
;;; build-site.el ends here
|
||||
;;; build-site.el ends here
|
||||
|
||||
Reference in New Issue
Block a user