aboutsummaryrefslogtreecommitdiff
path: root/layouts
diff options
context:
space:
mode:
authorRichard Qin <richard.qin.x@gmail.com>2026-09-09 14:05:02 +0800
committerRichard Qin <richard.qin.x@gmail.com>2026-09-09 14:05:02 +0800
commit1dc698835aba9999e03fcee1ab7553c615be2795 (patch)
treef5018143067339cd977007ea3b44fc6cdbcda847 /layouts
parent8eb90b9eac017a0c7ecbf0af5620274f8451e809 (diff)
downloadrhomepage-1dc698835aba9999e03fcee1ab7553c615be2795.tar.gz
rhomepage-1dc698835aba9999e03fcee1ab7553c615be2795.tar.xz
Add build-time MathML rendering
Diffstat (limited to 'layouts')
-rw-r--r--layouts/_markup/render-passthrough.html13
1 files changed, 13 insertions, 0 deletions
diff --git a/layouts/_markup/render-passthrough.html b/layouts/_markup/render-passthrough.html
new file mode 100644
index 0000000..4e4e779
--- /dev/null
+++ b/layouts/_markup/render-passthrough.html
@@ -0,0 +1,13 @@
+{{- $options := dict
+ "displayMode" (eq .Type "block")
+ "output" "mathml"
+ "strict" "error"
+ "throwOnError" true
+-}}
+{{- with try (transform.ToMath .Inner $options) -}}
+ {{- with .Err -}}
+ {{- errorf "Unable to render mathematical markup at %s: %s" $.Position . -}}
+ {{- else -}}
+ {{- .Value -}}
+ {{- end -}}
+{{- end -}}