summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--README.md2
-rw-r--r--hugo.toml9
-rw-r--r--layouts/_markup/render-passthrough.html13
3 files changed, 22 insertions, 2 deletions
diff --git a/README.md b/README.md
index 953b1a0..8b2d67f 100644
--- a/README.md
+++ b/README.md
@@ -4,7 +4,7 @@ A small, document-first personal site built with Hugo, semantic HTML, and one CS
## Requirements
-- Hugo 0.123.7 or newer
+- Hugo 0.165.0 or newer
- POSIX `sh`
- Make
diff --git a/hugo.toml b/hugo.toml
index 0873861..c266924 100644
--- a/hugo.toml
+++ b/hugo.toml
@@ -1,6 +1,6 @@
baseURL = "http://localhost:1314/"
title = "RICHARD QIN'S HOME PAGE"
-languageCode = "en"
+locale = "en"
defaultContentLanguage = "en"
timeZone = "Asia/Shanghai"
uglyURLs = true
@@ -31,6 +31,13 @@ enableRobotsTXT = false
baseName = "rss"
[markup]
+ [markup.goldmark]
+ [markup.goldmark.extensions]
+ [markup.goldmark.extensions.passthrough]
+ enable = true
+ [markup.goldmark.extensions.passthrough.delimiters]
+ block = [['$$', '$$']]
+ inline = [['$', '$']]
[markup.highlight]
codeFences = false
guessSyntax = false
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 -}}