Skip to content

Commit e127d58

Browse files
authored
Merge pull request #2 from xnzone/math
support math
2 parents f3c63e7 + b279cb6 commit e127d58

File tree

2 files changed

+24
-0
lines changed

2 files changed

+24
-0
lines changed

layouts/partials/head.html

+2
Original file line numberDiff line numberDiff line change
@@ -19,3 +19,5 @@
1919
{{ $js := slice $fusejs $search | resources.Concat "js/bundle.js" | resources.Fingerprint "sha512" }}
2020
<script defer type="text/javascript" src="{{ $js.Permalink }}" integrity="{{ $js.Data.Integrity }}"></script>
2121
{{- end }}
22+
23+
{{ partial "math.html" . }}

layouts/partials/math.html

+22
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
{{ if .Params.math }}
2+
<script>
3+
MathJax = {
4+
tex: {
5+
inlineMath: [["$", "$"]],
6+
},
7+
displayMath: [
8+
["$$", "$$"],
9+
["\[\[", "\]\]"],
10+
],
11+
svg: {
12+
fontCache: "global",
13+
},
14+
};
15+
</script>
16+
<script src="https://polyfill.io/v3/polyfill.min.js?features=es6"></script>
17+
<script
18+
id="MathJax-script"
19+
async
20+
src="https://cdn.jsdelivr.net/npm/mathjax@3/es5/tex-mml-chtml.js"
21+
></script>
22+
{{ end }}

0 commit comments

Comments
 (0)