summaryrefslogtreecommitdiff
path: root/themes/hugo-coder/layouts/partials/posts/math.html
diff options
context:
space:
mode:
Diffstat (limited to 'themes/hugo-coder/layouts/partials/posts/math.html')
m---------themes/hugo-coder0
-rw-r--r--themes/hugo-coder/layouts/partials/posts/math.html38
2 files changed, 38 insertions, 0 deletions
diff --git a/themes/hugo-coder b/themes/hugo-coder
deleted file mode 160000
Subproject 55b2a150f990bc56364dba347bc9acc6aab07be
diff --git a/themes/hugo-coder/layouts/partials/posts/math.html b/themes/hugo-coder/layouts/partials/posts/math.html
new file mode 100644
index 0000000..bc39ce5
--- /dev/null
+++ b/themes/hugo-coder/layouts/partials/posts/math.html
@@ -0,0 +1,38 @@
1{{- if or (.Params.math) (.Site.Params.math) -}}
2 <script src="https://polyfill.io/v3/polyfill.min.js?features=es6"></script>
3 {{/* The file is already minified */}}
4 <script id="MathJax-script" async src="https://cdn.jsdelivr.net/npm/mathjax@3/es5/tex-mml-chtml.js"></script>
5 <script>
6 MathJax = {
7 tex: {
8 inlineMath: [
9 ['$', '$'], ['\\(', '\\)']
10 ],
11 processEscapes: true,
12 processEnvironments: true
13 },
14 options: {
15 skipHtmlTags: ['script', 'noscript', 'style', 'textarea', 'pre']
16 }
17 };
18 </script>
19{{- end -}}
20{{- if or (.Params.katex) (.Site.Params.katex) -}}
21 <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/katex@0.13.11/dist/katex.min.css"
22 integrity="sha384-Um5gpz1odJg5Z4HAmzPtgZKdTBHZdw8S29IecapCSB31ligYPhHQZMIlWLYQGVoc" crossorigin="anonymous">
23 {{/* The loading of KaTeX is deferred to speed up page rendering */}}
24 <script defer src="https://cdn.jsdelivr.net/npm/katex@0.13.11/dist/katex.min.js"
25 integrity="sha384-YNHdsYkH6gMx9y3mRkmcJ2mFUjTd0qNQQvY9VYZgQd7DcN7env35GzlmFaZ23JGp" crossorigin="anonymous"></script>
26 <script defer src="https://cdn.jsdelivr.net/npm/katex@0.13.11/dist/contrib/auto-render.min.js"
27 integrity="sha384-vZTG03m+2yp6N6BNi5iM4rW4oIwk5DfcNdFfxkk9ZWpDriOkXX8voJBFrAO7MpVl" crossorigin="anonymous"
28 onload="renderMathInElement(document.body,
29 {
30 delimiters: [
31 {left: '$$', right: '$$', display:true},
32 {left: '$', right: '$', display:false},
33 {left: '\\(', right: '\\)', display: false},
34 {left: '\\[', right: '\\]', display: true}
35 ]
36 }
37 );"></script>
38{{- end -}}