diff options
| -rw-r--r-- | README.md | 2 | ||||
| -rw-r--r-- | hugo.toml | 9 | ||||
| -rw-r--r-- | layouts/_markup/render-passthrough.html | 13 |
3 files changed, 22 insertions, 2 deletions
@@ -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 @@ -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 -}} |
