Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/koirand/pulp.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKazuki Koide <koirand.jp@gmail.com>2020-11-01 15:24:31 +0300
committerGitHub <noreply@github.com>2020-11-01 15:24:31 +0300
commite82a480e455c0d31592f37d29073305e2c99743e (patch)
tree35652c4a57e6232aec6791c269d1e1322ad41516
parentc2c9e4245638816e1998a0787fe968a4ce77b1ec (diff)
parent3fcbe790af0269941975c17cd2f9619ab36880ef (diff)
Merge pull request #79 from binzhang-u5f6c/master
add mathjax support
-rw-r--r--layouts/partials/footer.html3
-rw-r--r--layouts/partials/mathjax_support.html19
2 files changed, 22 insertions, 0 deletions
diff --git a/layouts/partials/footer.html b/layouts/partials/footer.html
index a35c5a4..c7d0f3a 100644
--- a/layouts/partials/footer.html
+++ b/layouts/partials/footer.html
@@ -5,6 +5,9 @@
using the <a href="https://github.com/koirand/pulp/">pulp</a> theme.
</p>
</footer>
+{{ if .Params.mathjax }}
+ {{ partial "mathjax_support.html" . }}
+{{ end }}
{{- range .Site.Params.custom_js -}}
<script src="{{ . }}"></script>
{{ end }}
diff --git a/layouts/partials/mathjax_support.html b/layouts/partials/mathjax_support.html
new file mode 100644
index 0000000..3696d5c
--- /dev/null
+++ b/layouts/partials/mathjax_support.html
@@ -0,0 +1,19 @@
+<script src="https://polyfill.io/v3/polyfill.min.js?features=es6"></script>
+<script id="MathJax-script" async
+ src="https://cdn.jsdelivr.net/npm/mathjax@3.0.1/es5/tex-mml-chtml.js">
+</script>
+<script>
+MathJax.Hub.Config({
+ tex2jax: {
+ inlineMath: [['$','$'], ['\\(','\\)']],
+ displayMath: [['$$','$$'], ['\[','\]']],
+ processEscapes: true,
+ processEnvironments: true,
+ skipTags: ['script', 'noscript', 'style', 'textarea', 'pre','code'],
+ TeX: {
+ equationNumbers: { autoNumber: "AMS" },
+ extensions: ["AMSmath.js", "AMSsymbols.js"]
+ }
+ }
+});
+</script>