Skip to content

Commit

Permalink
add math support: default false
Browse files Browse the repository at this point in the history
  • Loading branch information
Zhi Shao committed Nov 19, 2024
1 parent 16bfbed commit ef6e1e5
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 0 deletions.
12 changes: 12 additions & 0 deletions hugo.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,25 @@ disableKinds: ["taxonomy", "term", "RSS", "sitemap", "robotsTXT"]
params:
contentUrl: "https://content.ehipassa.org/"
description: "Theravada Buddhism 佛教 上座部 古籍"
math: false

markup:
goldmark:
extensions:
extras:
mark:
enable: true
passthrough:
delimiters:
block:
- - \[
- \]
- - $$
- $$
inline:
- - \(
- \)
enable: true
parser:
attribute:
block: true
Expand Down
3 changes: 3 additions & 0 deletions layouts/_default/baseof.html
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,9 @@
{{ range .Params.css }}
<link rel="stylesheet" href="{{.}}">
{{ end }}
{{ if .Param "math" }}
{{ partialCached "math.html" . }}
{{ end }}
<link rel="apple-touch-icon" href="/images/avatar.webp">
<link rel="icon" href="/images/fav.png">
{{ block "title" . }}{{ end }}
Expand Down
10 changes: 10 additions & 0 deletions layouts/partials/math.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
<!-- https://gohugo.io/content-management/mathematics/ -->
<script id="MathJax-script" async src="https://cdn.jsdelivr.net/npm/mathjax@3/es5/tex-chtml.js"></script>
<script>
MathJax = {
tex: {
displayMath: [['\\[', '\\]'], ['$$', '$$']],
inlineMath: [['\\(', '\\)']]
}
};
</script>

0 comments on commit ef6e1e5

Please sign in to comment.